Skip to content
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

chore(build): Use pull request triggers #9771

Merged
merged 3 commits into from
Mar 24, 2022
Merged

Conversation

sfoster1
Copy link
Member

Use pull request triggers as the primary mechanism for testing pull
requests, rather than push triggers.

Github workflows have a characteristically very low limit on the number
of concurrent MacOS jobs, no matter the subscription level, and has a
limit of 50 non-macOS jobs. Combined with the number of jobs that we
run, this greatly limits the velocity of merging and checking code.

However, the number of jobs that we run often represents duplicate work

  • our test/lint workflows run on both pull_request (targeting the
    predicted merge branch that github automatically creates) and on
    push (targeting whatever obj/ref was just pushed). By using pull_request
    triggers and limiting push to release, we can greatly cut down on the
    amount of work we do, while still testing the same code.

The hole that's left is running tests on branches that developers have
pushed but do not want to open a pull request for, or that has a merge
conflict that prevents pull request checks from automatically running.
In this case, we have workflow_dispatch triggers so that the checks can
be run through the web UI, and we should probably add magic-comment
triggers for a similar thing.

Use pull request triggers as the primary mechanism for testing pull
requests, rather than push triggers.

Github workflows have a characteristically very low limit on the number
of concurrent MacOS jobs, no matter the subscription level, and has a
limit of 50 non-macOS jobs. Combined with the number of jobs that we
run, this greatly limits the velocity of merging and checking code.

However, the number of jobs that we run often represents duplicate work
- our test/lint workflows run on both pull_request (targeting the
predicted merge branch that github automatically creates) and on
push (targeting whatever obj/ref was just pushed). By using pull_request
triggers and limiting push to release, we can greatly cut down on the
amount of work we do, while still testing the same code.

The hole that's left is running tests on branches that developers have
pushed but do not want to open a pull request for, or that has a merge
conflict that prevents pull request checks from automatically running.
In this case, we have workflow_dispatch triggers so that the checks can
be run through the web UI, and we should probably add magic-comment
triggers for a similar thing.
@sfoster1 sfoster1 requested a review from y3rsh March 24, 2022 14:06
@sfoster1 sfoster1 requested a review from a team as a code owner March 24, 2022 14:06
@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #9771 (4b4c312) into edge (e600fdf) will not change coverage.
The diff coverage is n/a.

❗ Current head 4b4c312 differs from pull request most recent head 46a8acf. Consider uploading reports for the commit 46a8acf to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             edge    #9771   +/-   ##
=======================================
  Coverage   75.10%   75.10%           
=======================================
  Files        1980     1980           
  Lines       52282    52282           
  Branches     5044     5044           
=======================================
  Hits        39265    39265           
  Misses      12051    12051           
  Partials      966      966           
Flag Coverage Δ
api 85.11% <ø> (ø)
hardware 67.63% <ø> (ø)
shared-data 84.98% <ø> (ø)
update-server 73.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@@ -6,12 +6,16 @@ name: 'API test/lint/deploy'
on:
# Most of the time, we run on pull requests, which lets us handle external PRs
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
Copy link
Contributor

@SyntaxColoring SyntaxColoring Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading the docs correctly, this is equal to the default types, plus the addition of ready_for_review. What does adding ready_for_review do / why do we want to do that? Why is the default insufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what i'd hope is that it adds a trigger when you take a pr from draft to ready, but it might not really add much you're right

Comment on lines 78 to 79
- os: 'macos-latest'
python: '3.7'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we excluding this? Since this is what many of us are running locally, isn't this one of the important ones to have in CI so we don't break each other's dev environments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to exclude one of them at least - macos runners are the harsher limit. i figured 3.10 was more likely to be what users would be on, but if we want to prioritize dev envs we can exclude 3.10 again (or, sigh, keep both)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, that's a good point.

🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nightly runs of all versions might be a good solution for this issue

@sfoster1
Copy link
Member Author

Note on this PR - for pull_request targets I'm pretty sure it's using the workflows that are in edge currently, so we're not seeing the changes to the pull_request targets and changes like 46a8acf that didn't change content that triggers pull_request builds in edge won't run.

@SyntaxColoring SyntaxColoring self-requested a review March 24, 2022 14:47
@sfoster1 sfoster1 merged commit 9ea6aec into edge Mar 24, 2022
@sfoster1 sfoster1 deleted the chore_no-push-triggers branch March 24, 2022 15:43
b-cooper pushed a commit that referenced this pull request Mar 25, 2022
Use pull request triggers as the primary mechanism for testing pull
requests, rather than push triggers.

Github workflows have a characteristically very low limit on the number
of concurrent MacOS jobs, no matter the subscription level, and has a
limit of 50 non-macOS jobs. Combined with the number of jobs that we
run, this greatly limits the velocity of merging and checking code.

However, the number of jobs that we run often represents duplicate work
- our test/lint workflows run on both pull_request (targeting the
predicted merge branch that github automatically creates) and on
push (targeting whatever obj/ref was just pushed). By using pull_request
triggers and limiting push to release, we can greatly cut down on the
amount of work we do, while still testing the same code.

The hole that's left is running tests on branches that developers have
pushed but do not want to open a pull request for, or that has a merge
conflict that prevents pull request checks from automatically running.
In this case, we have workflow_dispatch triggers so that the checks can
be run through the web UI, and we should probably add magic-comment
triggers for a similar thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants