Suggested github action change, to prevent clutter in draft PRs#2940
Suggested github action change, to prevent clutter in draft PRs#2940
Conversation
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
🚨 Please update the changelog. This PR cannot be merged until |
|
According to the above time line, this did not work as expected. Although the new job immediately failed, the other jobs proceeded to run anyway. I think this is a syntax error, so I'll try to fix now. |
|
This didn't work, since the first check was skipped - converting back to a draft to try fixing. I will convert back to "Ready for review" once I think I've fixed it. |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
🚨 Please update the changelog. This PR cannot be merged until |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
🚨 Please update the changelog. This PR cannot be merged until |
so that this action will run when the PR is switched to draft (to allow the first job to fail, rather than skip)
|
On second thought, I do not believe this PR warrants a changelog entry, since it does not alter the actual code base. |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
🚨 Please update the changelog. This PR cannot be merged until |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
🚨 Please update the changelog. This PR cannot be merged until |
|
Thanks @morrowcj for noticing and working on this. Side note: all PRs need an entry in changelog. The decision about the importance of each entry is made when we are reading the changelog and consuming its content. |
That makes sense to me, and I agree with the pros and cons you stated. I'm interested to hear what others think!
Good to know: done! |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
Feedback from a few members of the dev team at yesterday's Work Together session seemed generally positive to this idea. One additional suggestion that came up is possibly including an option to manually trigger the jobs that are skipped on a draft branch. This can likely be accomplished with the workflow_dispatch event. |
316fb75 to
4a0c9ce
Compare
|
After a quick commit attempting enable this functionality and re-converting to a draft, I have confirmed that the changes were successful. The actions could be manually triggered even though the PR is a draft: The only downside of this is that the results of a manually triggered run do not show up on the PR timeline. |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
ew3361zh
left a comment
There was a problem hiding this comment.
I think this is close for me, I like the direction overall and agree with the premise behind the changes.
I think working on clarity for new (and existing) contributors about what's happening with GH actions on a draft branch would be my preference. And I think if possible that should happen through the GH actions (i.e. they shouldn't fail here but rather not run)
| branches: [ dev ] | ||
| pull_request: | ||
| branches: [ dev ] | ||
| types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] |
There was a problem hiding this comment.
Can you talk a little about how you put together this particular group of types (and maybe what synchronize is?)?
There was a problem hiding this comment.
Great question: the defaults (if you don't include the "types" key) that trigger an action on PR are opened, synchronize, and reopen. I wanted to also add triggers for converting the PR to and from drafts. Source
I believe synchronize is whenever there is a commit pushed to the HEAD reference of the PR's "from" branch.
| - name: Fails in order to indicate that PR needs to be marked as ready to review and other checks passed. | ||
| run: exit 1 # don't run other jobs |
There was a problem hiding this comment.
I realize the purpose of this is to declutter the conversation on a PR by not posting unnecessary messages but just wondering if you think it would be confusing for contributors (new/old) to see actions failed with no explanation rather than just not running them at all if it's a draft PR?
I think I'd probably prefer just not running the jobs without explicitly failing.
There was a problem hiding this comment.
I think I agree with you and was originally going to do exactly that (skip checks on draft) but came across a thread where people expressed interest in being alerted or otherwise indicated that the skips occurred in order to remind them that they need to flag it as ready for review. If we don't have that need, I'm happy that remove the failing check!
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
1 similar comment
|
Current Coverage: 99% Mypy errors on no-draft-actions branch: 1191 |
|
@ew3361zh, I removed the check that fails on a draft PR. I then converted back to a draft to test and, as you can see, the tests were successfully skipped:
and then fully ran when converted back to "ready for review":
I also replied to your question about the types above and will re-request your review. |
|
I also wonder if it is possible to reduce the frequency of redundant comments like these ones:
Perhaps by having the bot edit the comment if it already exists instead of creating a new one. It seems that option exists, but probably better suited for a different issue/PR. |







Prevents the full suite of github actions from running on draft PRs. This will reduce the clutter of PR timelines and notifications by preventing the automated bot actions from occurring on every push before the PR is ready.
The new job in "combined_format_lint_test_mypy.yml" runs and fails when the PR is a draft, andthe other jobs are skipped, indicating that the PR must be converted to "Ready for review" (which will trigger the other jobs) to proceed.This change does not affect standard "Ready for review" PRs, which will run the jobs each time a PR undergoes a status change .
What
A new job that fails andskips theotherjobs on draft PRsWhy
Test plan
Context
The inspiration comes from this thread.