• This repository has been archived on 15/Mar/2023
  • Stars
    star
    184
  • Rank 201,833 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Github hooks to provide an encouraging atmosphere for new contributors

Highfive

This repository is no longer running on rust-lang infrastructure; instead the relevant code lives in triagebot. This repository has been archived to retain it for the future.


GitHub hooks to provide an encouraging atmosphere for new contributors. Highfive assigns pull requests to users based on rules in configuration files. You can see Highfive in action in several Rust repositories. See the rust-lang/rust pull requests, for example.

This project drives the @rust-highfive bot and was originally a fork of servo/highfive, used by Servo and Servo's @highfive bot. For more history see the comments in #35.

Table of Contents

  1. Installation
  2. Testing
  3. Adding a Project
  4. Enabling a Repository
  5. Local Development
  6. License

Installation

To install highfive, you just need to execute the setup.py script or use pip directly. Both commands have to be executed from the directory where setup.py is located.

$ python setup.py install

or

$ pip install . # the dot is important ;)

Testing

Before running tests, make sure the test-requirements are installed by running the following command:

$ pip install -r test-requirements.txt

Once the dependencies are installed, you can run all tests by executing:

$ pytest

Tests are labeled as "unit", "integration", and "hermetic". All unit tests are hermetic, but only some integration tests are hermetic. A non-hermetic test makes network requests. To run only hermetic tests do:

$ pytest -m hermetic

Hermetic tests are run in PR builds. All tests are run in daily cron builds.

Adding a Project

To make rust-highfive interact with a new repo, add a configuration file in highfive/configs, with a filename of the form reponame.json. The file should look like:

{
    "groups":{
        "all": ["@username", "@otheruser"],
        "subteamname": ["@subteammember", "@username"]
    },
    "dirs":{
        "dirname":  ["subteamname", "@anotheruser"]
    },
    "contributing": "http://project.tld/contributing_guide.html",
    "expected_branch": "develop",
    "mentions": {
        "src/doc": {
            "message": "Documentation was changed.",
            "reviewers": ["@DocumentationReviewPerson"]
        },
        "test.rs": {
            "message": "Some changes occurred in a test file.",
            "reviewers": ["@TestReviewPerson"]
        }
    },
    "new_pr_labels": ["S-waiting-for-review"]
}

The groups section allows you to alias lists of usernames. You should specify at least one user in the group "all". Other keys are optional.

In the dirs section, you map directories of the repository to users or groups who're eligible to review PRs. This section can be left blank.

contributing specifies the contribution guide link in the message which welcomes new contributors to the repository. If contributing is not present, the contributing chapter of the rustc-dev-guide will be linked instead.

If PRs should be filed against a branch other than master, specify the correct destination in the expected_branch field. If expected_branch is left out, highfive will assume that PRs should be filed against master. The bot posts a warning on any PR that targets an unexpected branch.

The mentions section is used by Highfive when new PRs are created. If a PR diff modifies files in the paths configured in the mentions section, a comment is made with the given message that mentions the specified users. Mentions paths have either one or two behaviors.

  • Every path in a diff is checked whether it begins with a path in the mentions list. If there is a match, the mention comment is made.
  • If a path in the diff ends with a mentions path ending in .rs, the mention is a match, and a comment is made.

new_pr_labels contains a list of labels to apply to each new PR. If it's left out or empty, no new labels will be applied.

Enabling a Repository

Once the PR updating the repository configuration has been merged, run the update-webhooks.py script at the root of this repository:

$ python3 update-webhooks.py

The script requires the GITHUB_TOKEN environment variable to be set to a valid GitHub API token, and it will make sure the configuration of all the repositories you have admin access to is correct.

Local Development

You can run Highfive on your machine and configure a repository to use your local instance. Here is one approach for running a local server:

  • Create a virtualenv to isolate the Python environment from the rest of the system, and install highfive in it:
    $ virtualenv -p python2 env
    $ env/bin/pip install -e .
    
  • Run the highfive command to start a development server on port 8000:
    $ env/bin/highfive
    
  • Your Highfive instance will need to be reachable from outside of your machine. One way to do this is to use ngrok to get a temporary domain name that proxies to your Highfive instance. Additionally, you will be able to use ngrok's inspector to easily examine and replay the requests.
  • Set up the webhook by following the instructions in Enabling a Repo, substituting your local Highfive IP address or domain name and port number (if necessary).
  • Obtain an OAuth token. In the account you are creating the token in, go to https://github.com/settings/tokens. Grant access to the repository scope.
  • Put the authorization information obtained in the previous step into a file named .env in the top of the repository (i.e., the directory containing this file). Here is a template of what it should look like:
    HIGHFIVE_GITHUB_TOKEN=your-token
    
    Do not check in this file or commit your OAuth token to a repository in any other way. It is a secret.

Here are some details to be aware of:

  • For Highfive to know how to select reviewers for your repository, you need a configuration file in highfive/configs.
  • Highfive ignores comments from the integration user near the top of new_commment in highfive/newpr.py.

Docker

Alternatively, you can build a Docker image that runs Highfive.

$ docker build -t highfive .

To run a container, you must mount a config file. Assuming you are launching a container from a directory containing a config file, you can do the following.

$ docker run -d --rm --name highfive -p 8000:80 -e HIGHFIVE_GITHUB_TOKEN=token -e HIGHFIVE_WEBHOOK_SECRET=secret highfive

At this point, Highfive is accessible at http://localhost:8080.

License

Highfive is licensed under the terms of both the MIT License and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

More Repositories

1

rust

Empowering everyone to build reliable and efficient software.
Rust
85,122
star
2

rustlings

🦀 Small exercises to get you used to reading and writing Rust code!
Rust
47,148
star
3

mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
Rust
15,892
star
4

book

The Rust Programming Language
Rust
13,981
star
5

rust-analyzer

A Rust compiler front-end for IDEs
Rust
13,175
star
6

cargo

The Rust package manager
Rust
11,293
star
7

rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
Rust
9,860
star
8

rust-by-example

Learn Rust with examples (Live code editor included)
6,109
star
9

rustup

The Rust toolchain installer
Rust
5,558
star
10

rustfmt

Format Rust code
Rust
5,524
star
11

rfcs

RFCs for changes to Rust
Markdown
5,390
star
12

futures-rs

Zero-cost asynchronous programming in Rust
Rust
5,119
star
13

rust-bindgen

Automatically generates Rust FFI bindings to C (and some C++) libraries.
Rust
3,830
star
14

rust.vim

Vim configuration for Rust.
Vim Script
3,628
star
15

miri

An interpreter for Rust's mid-level intermediate representation
Rust
3,581
star
16

rls

Repository for the Rust Language Server (aka RLS)
Rust
3,529
star
17

regex

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
Rust
3,083
star
18

crates.io

The Rust package registry
Rust
2,554
star
19

hashbrown

Rust port of Google's SwissTable hash map
Rust
2,194
star
20

log

Logging implementation for Rust
Rust
2,046
star
21

this-week-in-rust

Data for this-week-in-rust.org
HTML
1,826
star
22

libc

Raw bindings to platform APIs for Rust
Rust
1,786
star
23

chalk

An implementation and definition of the Rust trait system using a PROLOG-like logic solver
Rust
1,713
star
24

async-book

Asynchronous Programming in Rust
Shell
1,640
star
25

nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
CSS
1,608
star
26

rustc-dev-guide

A guide to how rustc works and how to contribute to it.
HTML
1,522
star
27

git2-rs

libgit2 bindings for Rust
Rust
1,520
star
28

cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
Rust
1,491
star
29

vscode-rust

Rust extension for Visual Studio Code
TypeScript
1,388
star
30

rustc_codegen_cranelift

Cranelift based backend for rustc
Rust
1,348
star
31

polonius

Defines the Rust borrow checker.
Rust
1,207
star
32

api-guidelines

Rust API guidelines
1,186
star
33

reference

The Rust Reference
Rust
1,090
star
34

rust-playground

The Rust Playground
Rust
1,076
star
35

rust-mode

Emacs configuration for Rust
Emacs Lisp
1,009
star
36

docs.rs

crates.io documentation generator
Rust
891
star
37

rustfix

Automatically apply the suggestions made by rustc
Rust
857
star
38

rustc_codegen_gcc

libgccjit AOT codegen for rustc
Rust
850
star
39

portable-simd

The testing ground for the future of portable SIMD in Rust
Rust
775
star
40

datafrog

A lightweight Datalog engine in Rust
Rust
770
star
41

flate2-rs

DEFLATE, gzip, and zlib bindings for Rust
Rust
730
star
42

rust-semverver

Automatic checking for semantic versioning in library crates
Rust
637
star
43

socket2

Advanced configuration options for sockets.
Rust
633
star
44

unsafe-code-guidelines

Forum for discussion about what unsafe code can and can't do
618
star
45

crater

Run experiments across parts of the Rust ecosystem!
Rust
588
star
46

stdarch

Rust's standard library vendor-specific APIs and run-time feature detection
Rust
585
star
47

packed_simd

Portable Packed SIMD Vectors for Rust standard library
Rust
561
star
48

rustc-perf

Website for graphing performance of rustc
Rust
539
star
49

libm

A port of MUSL's libm to Rust.
Rust
481
star
50

cfg-if

A if/elif-like macro for Rust #[cfg] statements
Rust
479
star
51

crates.io-index

Registry index for crates.io
476
star
52

backtrace-rs

Backtraces in Rust
Rust
473
star
53

style-team

Home of the Rust style team
Rust
438
star
54

docker-rust

The official Docker images for Rust
Dockerfile
399
star
55

glob

Support for matching file paths against Unix shell style patterns.
Rust
381
star
56

rust-forge

Information useful to people contributing to Rust
Rust
380
star
57

compiler-team

A home for compiler team planning documents, meeting minutes, and other such things.
HTML
369
star
58

wg-async

Working group dedicated to improving the foundations of Async I/O in Rust
Rust
357
star
59

www.rust-lang.org

The home of the Rust website
Fluent
352
star
60

compiler-builtins

Porting `compiler-rt` intrinsics to Rust
Rust
328
star
61

measureme

Support crate for rustc's self-profiling feature
Rust
316
star
62

blog.rust-lang.org

The Rust Programming Language Blog
HTML
302
star
63

glacier

A big 'ol pile of ICE.
Rust
289
star
64

team

Rust teams structure
Rust
288
star
65

rustc-hash

Custom hash algorithm used by rustc (plus hashmap/set aliases): fast, deterministic, not secure
Rust
276
star
66

project-error-handling

Error handling project group
263
star
67

atom-ide-rust

Rust IDE support for Atom, powered by the Rust Analyzer or Rust Language Server
JavaScript
260
star
68

stacker

Manual segmented stacks for Rust
Rust
252
star
69

cmake-rs

Rust build dependency for running cmake
Rust
241
star
70

edition-guide

A guide to changes between various editions of Rust
233
star
71

getopts

The getopts repo maintained by the rust-lang project
Rust
229
star
72

a-mir-formality

a model of MIR and the Rust type/trait system
Rust
228
star
73

rust-roadmap-2017

Tracking Rust's roadmap
218
star
74

areweasyncyet.rs

Are we async yet?
Rust
209
star
75

rust-playpen

A web interface for running Rust code
Rust
208
star
76

annotate-snippets-rs

Library for snippet annotations
Rust
200
star
77

rustc-demangle

Rust symbol demangling
Rust
196
star
78

wg-allocators

Home of the Allocators working group: Paving a path for a standard set of allocator traits to be used in collections!
188
star
79

lang-team

Home of the Rust lang team
JavaScript
184
star
80

rust-guidelines

This repository has moved
179
star
81

rustwide

Execute your code on the Rust ecosystem.
Rust
174
star
82

ferris-says

A Rust flavored implementation of `cowsay`
Rust
172
star
83

cargo-bisect-rustc

Bisects rustc, either nightlies or CI artifacts
Rust
171
star
84

homu

A bot that integrates with GitHub and your favorite continuous integration service
Python
164
star
85

rfcbot-rs

Coordinates asynchronous decision making on Rust repositories. Status of tracked issues and PRs can be viewed at https://rfcbot.rs.
Rust
157
star
86

triagebot

Automation/tooling for Rust spaces
Rust
155
star
87

prev.rust-lang.org

The previous Rust website. The current website's code is at https://github.com/rust-lang/www.rust-lang.org.
HTML
153
star
88

pkg-config-rs

Build library for invoking pkg-config for Rust
Rust
147
star
89

thanks

Celebrate Rust contributors.
Rust
143
star
90

rustc-reading-club

Rust Code Reading Clubs
141
star
91

gll

GLL parsing framework.
Rust
136
star
92

ena

An implementation of union-find / congruence-closure in Rust. Extracted from rustc for independent experimentation.
Rust
131
star
93

simpleinfra

Rust Infrastructure automation
HCL
128
star
94

wg-cargo-std-aware

Repo for working on "std aware cargo"
125
star
95

rust-memory-model

Collecting examples and information to help design a memory model for Rust.
Python
125
star
96

rust-artwork

Official artwork for the Rust project.
120
star
97

rustup-components-history

Rustup package status history
Rust
100
star
98

libs-team

The home of the library team
Rust
100
star
99

const-eval

home for proposals in and around compile-time function evaluation
CSS
98
star
100

wg-grammar

Where the work of WG-grammar, aiming to provide a canonical grammar for Rust, resides
Rust
98
star