Swift AWS Lambda to automatically assign engineers to pull requests with a Slack integration

Overview

logo

PR Assigner

A Swift AWS Lambda to automatically assign engineers to pull requests with a Slack integration.

Features
๐Ÿ™… Never drop a Slack message with @here to ask for a review again
๐Ÿš€ Runs using Swift AWS Lambda (no CI involved)
๐Ÿ‘ค Selects n engineers randomly to assign to the PR
๐Ÿค™๐Ÿป Skips engineers with a custom status on Slack (ex. ๐Ÿค’ sick, ๐ŸŒด on holiday , ๐Ÿ“š training day)
๐Ÿ’ฌ Posts a message on a Slack room tagging assigned engineers
๐Ÿ”’ CODEOWNERS is fully supported and they will be tagged on Slack
โž• You can still manually assign PRs and PR Assigner will just add who is missing to the party

Requirements

  • Install Docker
  • Xcode 12.3+
  • Swift 5.3+

Getting started

To setup PR Assigner in your repo, you need:

  • A list of engineers that can't wait to review PRs!
  • A GitHub repo where you have admin permissions (you'll need to setup a hook).
  • An AWS environment where you'll deploy PR Assigner as a lambda.
  • A Slack app approved in your workspace with chat:write and users:read scopes.
  • A Slack channel where your Slack app and engineers are part of.

For more info on how to setup PR Assigner in your repos, you can head over to our documentation.

Installation

$ git clone https://github.com/justeat/PRAssigner.git
$ cd PRAssigner/
  • Store your AWS credentials in a .credz file
export AWS_SECRET_ACCESS_KEY=
export AWS_ACCESS_KEY_ID=
export AWS_DEFAULT_REGION=
  • Create a .secrets.yml file based on the .secrets_template.yml file and customize accordingly
$ cp .secrets_template.yml .secrets.yml
$ nano .secrets.yml
  • Deploy PR Assigner
$ ./PRAssigner.sh ship

Usage

You can customize how PR Assigner works by adding a .pr-assigner.yml file in the root of your repo.

# List of GitHub pull request event actions to continue the execution of PR Assigner.
# Full list here: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pullrequestevent
pr_actions:
  - "opened"
  - "reopened"
  - "review_requested"

# Number of reviewers to assign to the PR on GitHub.
number_of_reviewers: 2

# List of Slack status that let discard the selected reviewer.
# They are all emoji in the Slack format.
discardable_slack_status:
  - ":face_with_thermometer:"
  - ":palm_tree:"
  - ":books:"

# If true, reviewers won't get assigned to draft PRs.
skip_draft: false

# Slack channel in which will be posted messages tagging selected reviewers.
# Make sure both your Slack app and all your candidates reviewers are invited in this channel.
#
# It can be both the channel name (ex. #ios-pull-requests) or the Slack ID.
# The channel can be public or private.
slack_pr_channel: "#ios-pull-requests"

# List of candidates to be assigned to a PR.
# The value needs to contain the GitHub username and the Slack ID separate by ":" (ex. "andreaantonioni:ABCD1234").
reviewers:
  - "andreaantonioni:ABCD1234"

Licence

PR Assigner is available under the Apache License Version 2.0, January 2004. See the LICENSE file for more info.

  • Just Eat iOS team
You might also like...
Swift-ndi - Swift wrapper around NewTek's NDI SDK

swift-ndi Swift wrapper around NewTek's NDI SDK. Make sure you extracted latest

__.swift is a port of Underscore.js to Swift.

__.swift Now, __.swift is version 0.2.0! With the chain of methods, __.swift became more flexible and extensible. Documentation: http://lotz84.github.

SNTabBarDemo-Swift - Cool TabBar With Swift
SNTabBarDemo-Swift - Cool TabBar With Swift

SNTabBarDemo-Swift Cool TabBar How To Use // MARK: - setup private func setu

Swift-when - Expression switch support in Swift

Swift When - supporting switch expressions in Swift! What is it? Basically, it a

Swift-compute-runtime - Swift runtime for Fastly Compute@Edge

swift-compute-runtime Swift runtime for Fastly Compute@Edge Getting Started Crea

Swift-HorizontalPickerView - Customizable horizontal picker view component written in Swift for UIKit/iOS

Horizontal Picker View Customizable horizontal picker view component written in

swift-highlight a pure-Swift data structure library designed for server applications that need to store a lot of styled text

swift-highlight is a pure-Swift data structure library designed for server applications that need to store a lot of styled text. The Highlight module is memory-efficient and uses slab allocations and small-string optimizations to pack large amounts of styled text into a small amount of memory, while still supporting efficient traversal through the Sequence protocol.

Sovran-Swift: Small, efficient, easy. State Management for Swift

Sovran-Swift: Small, efficient, easy. State Management for Swift

Approximate is a Swift package that provides implementations of floating point comparisons for the Swift ecosystem

Approximate Approximate floating point equality comparisons for the Swift Programming Language. Introduction Approximate is a Swift package that provi

Comments
  • Too broad permissions

    Too broad permissions

    Hello @andreaantonioni, I was looking into integrating the PRAssigner into our workflow. As described in the documentation, a question was raised about the number of permissions required. Does this tool require all of them? Also, do they need to have such a broad scope ex. IAMFullAccess, AmazonS3FullAccess ?

    opened by sschizas 1
Swift implementation of AWS Lambda Events

Swift AWS Lambda Events Overview Swift AWS Lambda Runtime was designed to make building Lambda functions in Swift simple and safe. The library is an i

Swift on Server 29 Dec 19, 2022
Swiftbot on slack. Inspired by kishikawakatsumi/swift-compiler-discord-bot

Swiftbot Swiftbot on slack. Inspired by kishikawakatsumi/swift-compiler-discord-bot Usage $ swiftbot --token xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxx

noppefoxwolf 55 Jan 8, 2022
Sync Slack status to macOS Monterey Focus mode

SyncFocusWithSlack Sync Slack status to macOS Monterey Focus mode โš ๏ธ This app ac

Yusuf ร–zgรผl 14 Nov 23, 2022
๐Ÿ“˜A library for isolated developing UI components and automatically taking snapshots of them.

A library for isolated developing UI components and automatically taking snapshots of them. Playbook Playbook is a library that provides a sandbox for

Playbook 969 Dec 27, 2022
Automatically set your keyboard's backlight based on your Mac's ambient light sensor.

QMK Ambient Backlight Automatically set your keyboard's backlight based on your Mac's ambient light sensor. Compatibility macOS Big Sur or later, a Ma

Karl Shea 29 Aug 6, 2022
BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Blockchain Commons, LLC โ€” A โ€œnot-for-profitโ€ benefit corporation 4 Oct 6, 2022
Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Apple 2k Dec 28, 2022
Swift-DocC is a documentation compiler for Swift frameworks and packages aimed at making it easy to write and publish great developer documentation.

Swift-DocC is a documentation compiler for Swift frameworks and packages aimed at making it easy to write and publish great developer docum

Apple 833 Jan 3, 2023
Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux)

SwiftFoundation Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. Goals Provide a cross-platform in

null 620 Oct 11, 2022
Swift - โœ๏ธSwift ๊ณต๋ถ€ ์ €์žฅ์†Œโœ๏ธ

Swift ์Šค์œ„ํ”„ํŠธ์˜ ๊ธฐ์ดˆ 1. Swift์˜ ๊ธฐ๋ณธ 2. ๋ณ€์ˆ˜์™€ ์ƒ์ˆ˜ [3. ๋ฐ์ดํ„ฐ ํƒ€์ž… ๊ธฐ๋ณธ] [4. ๋ฐ์ดํ„ฐ ํƒ€์ž… ๊ณ ๊ธ‰] 5. ์—ฐ์‚ฐ์ž 6. ํ๋ฆ„ ์ œ์–ด 7. ํ•จ์ˆ˜ 8. ์˜ต์…”๋„ ๊ฐ์ฒด์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ๊ณผ ์Šค์œ„ํ”„ํŠธ 9. ๊ตฌ์กฐ์ฒด์™€ ํด๋ž˜์Šค 10. ํ”„๋กœํผํ‹ฐ์™€ ๋ฉ”์„œ๋“œ 11. ์ธ์Šคํ„ด์Šค ์ƒ

Jiwon 0 Mar 9, 2022