-
Notifications
You must be signed in to change notification settings - Fork 69
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
[vets-api] Fix backend CI labeling bugs #19659
Conversation
Generated by 🚫 Danger |
@@ -21,14 +21,6 @@ jobs: | |||
steps: | |||
- uses: actions/checkout@v4 | |||
|
|||
- name: Remove Review label |
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.
Handled in ready-for-review
@@ -20,14 +20,6 @@ jobs: | |||
with: | |||
fetch-depth: 2 | |||
|
|||
- name: Remove Review label |
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.
Handled in ready-for-review
- name: Set Test Status | ||
id: test-status | ||
if: always() | ||
run: | | ||
if [ "${{ job.status }}" = "success" ]; then | ||
echo "status=success" >> $GITHUB_OUTPUT | ||
else | ||
echo "status=failure" >> $GITHUB_OUTPUT | ||
fi |
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.
By capturing the result, we can make sure only one of the two labels gets set at a time
types: [completed] | ||
jobs: | ||
ready_for_review: | ||
get-pr-data: |
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.
workflow_run didn't have access to the PR, so this job retrieves it properly
exit 1 | ||
fi | ||
|
||
handle-draft-state: |
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.
to simplify other jobs, I handle the removal of the "ready" tag on drafts here
env: | ||
pr_number: ${{ needs.get-pr-data.outputs.pr_number }} | ||
pr_labels: ${{ needs.get-pr-data.outputs.pr_labels }} | ||
pr_requested_teams: ${{ needs.get-pr-data.outputs.pr_requested_teams }} |
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.
set the outputs of get-pr-data job as env vars to clean up logic
Your tests were failing initially (they hit the timeout bug), so I re-ran them and now they're passing. But I just realized 😕 I don't think the
|
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.
approving so we can see if this makes the automation happy. I think some more testing needs to be done, though. See comment above ☝️
check-approval-requirements: | ||
name: Check Approval Requirements |
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.
small thing, but what do you think of changing the name of one of these to "require backend review" or something. I've seen people get confused about why this check hangs.
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.
💯
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'll just use require-backend-approval
to match the label/job name
Summary
test-passing
/test-failure
conflict by evaluating overall result, instead of "existence" of a failure (while the job could still pass on retryomit-backend-approval
label and approval commentgithub.event.pull_request
). So I added a step (get_pr_data) to pull the PR number from the workflow_run and retrieve the PR (and set the required vars as outputs)require_backend_label
workflow could be easily added toready_for_review
to remove chance of race conditioncheckout
actionsRelated issue(s)
Testing
test-failure
labeltest-passing
labellint-failure
added/removed properly