-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add github action based check enforcer #3287
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: |
bc37562
to
ce12eb9
Compare
.github/workflows/check_suite.yaml
Outdated
GITHUB_PAYLOAD: ${{ toJson(github.event) }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "Sparse checkout azure-sdk-tools..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets see what this looks like without needing to do a sparse checkout. The normal checkout I believe is already shallow by default. However if we can move this to be an action outside of the repo maybe we don't need to explicitly checkout at all because github will handle it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've walked the go code a few times, and nothing jumps out at me. To be entirely honest I haven't gotten to the nitty-gritty into go code enough to see any hidden bugs here though.
e5bb54c
to
bd3b104
Compare
bd3b104
to
ac13351
Compare
NOTE Based on feedback, I have moved the main action implementation into its own repository here. This PR now contains a simple yaml file for referencing the external repository action.
This adds a new implementation of check enforcer intended to be run within a github actions context. To see an example of it running for a repository, check out the actions in my fork.
Design Goals and Current Problems:
Details
Design Decisions
There are a few key design decisions made with this change, that I am eager will spark discussion.
Implementation Details
The program is currently written to take a single argument which is a path to a payload file. The payload is expected to be some form of a github event. Currently, it supports two payloads: check_suite and issue_comment.
Currently I wrote the program with no dependencies (except for local testing) in order to support the fastest possible runtime of a check enforcer action. If we go with this approach and roll it out, and things look good, I plan to design and add support for publishing a tool instead of building and running from source. At this point dependencies won't have as large of a download overhead and we can introduce them. Primarily I plan to replace my homerolled github client with the primary github client for go.
For behavior and UX details, as well as instructions to enable, see the README file in this PR at
tools/check-enforcer-actions/README.md
. This tool has functional parity with the current check enforcer.