Git Product home page Git Product logo

ci-gate's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar jstarry avatar kevingrandon avatar mvines avatar pgarg66 avatar rtsao avatar yihau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ci-gate's Issues

Trigger Buildkite builds for commits that land in master

I ported over all of our webhooks to use ci-gate, but it seems that master is no longer building. It'd be nice to also trigger master from this so we don't have to have two webhooks.

Wondering if you're open to doing this by default, or if we should have an environment variable to turn this on.

Flag 3rd party modifications to select files

Certain PRs from 3rd parties require more scrutiny, such as a buildkite pipeline definition. Build a mechanism to notify mantainers of such changes by a comment in the PR and/or a label that must be manually removed from the PR (in addition to manually adding the CI label) to grant CI.

Unit testing

Would you be open to adding a unit testing framework for this repo? Given the nature of this logic, my recommendation would be going with Jest for it's powerful mocking abilities. A unit testing framework would allow for more contributions, as we could make them with confidence.

Add 'automerge' label support

Adding this label to a PR should cause the PR to get merged automatically once CI is green and the PR is approved by a reviewer

Clean up / document buildkite assumptions

The current setup makes several assumptions about how your buildkite pipelines are setup. Some of these assumptions are unnecessary and should be refactored/removed, while others just need to be documented.

Add support for branch cherry picking

Once PRs are merged into the master branch (or any other branch), the user should be able to set a label on the PR to have the system attempt to cherry pick it into another branch (based on the label name).

Support buildkite beta public pipelines

Buildkite now offers a beta feature to mark pipelines as beta, which is a great start towards making this project obsolete: see
buildkite/feedback#137 (comment)

For buildkite public pipelines, ci-gate does not need to serve its own version of the buildkite log and thus can avoid overriding the buldkite github commit status URL. Unless the buildkite API provides a way to check if a pipeline is public, we’d likely just use another environment variable to whitelist pipelines as public.

Extract user whitelist from github API?

Rather that using the CI_USER_WHITELIST environment variable to determine who gets automatic CI service, can this be determined by looking at who has write access to the destination repository?

Use SHA instead of PR head reference

We're seeing a bunch of CI failures after switching to CI-Gate with the following error:

error: cannot lock ref 'refs/remotes/origin/pull/XXX/head': unable to resolve reference 'refs/remotes/origin/pull/XXX/head'

The only difference in the build log appears that we're no longer using the commit sha, and are instead using the PR head reference.

Happy to try to work on this, just want to see if this would be an acceptable change to merge upstream.

Use GitHub checks API rather than labels to trigger CI

With the GitHub Checks API, it is possible to add a neutral/failing commit status that includes a button to trigger an arbitrary action.

For example, this might look something like:
screen shot 2019-01-30 at 10 54 44 am

Clicking "details" will take you to the checks tab of the PR, which might show something like:

screen shot 2019-01-30 at 10 55 58 am

Clicking the button will trigger a check_run.requested_action event. Then this app can respond to the action_requested webhook and trigger a CI run.

I think this is preferable than the label-based approach for a few reasons:

  • Adding/removing labels creates noise in the PR
  • Because checks apply to a specific commit, it avoids the current potential race conditions where a user pushes new commits right before a label is added
  • Having an explicit status check and associated action button is more intuitive than a convention regarding adding/removing labels

If this app used probot, the code might look something like this:

context.github.checks.create(
  context.repo({
    name: "CI Gate",
    head_branch,
    head_sha,
    status: "completed",
    conclusion: "action_required",
    completed_at: new Date(),
    output: {
      title: "CI run not yet authorized",
      summary:
        "Click the above <kbd>Trigger CI run</kbd> button to trigger a CI run."
    },
    actions: [
      {
        label: "Trigger CI run",
        description: "Trigger a CI run",
        identifier: "trigger_ci"
      }
    ]
  })
);

If that sounds good to you, I could probably help implement this.

Add support for a label to suppress CI

Sometimes people like to push PRs to show their work but it's known that the PR is not ready to be merged. In such a case, it would be nice to have a label (noci?) to prevent testing a PR that is known to not work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.