Skip to content

build: avoid conflicts when publishing snapshot builds #19737

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

Merged

Conversation

devversion
Copy link
Member

@devversion devversion commented Jun 23, 2020

For the past year, we've had CI failures when multiple PRs
have been merged. Since we run CI for all landed commits, the
snapshot publish job runs multiple times concurrently and could
end up pushing to the snapshot repositories out of order.

This can result in conflicts when multiple jobs push artifacts
at the same time. e.g. https://circleci.com/gh/angular/components/155407.

We intend to fix this by queuing snapshot publishing across CircleCI
builds. This is done using the CircleCI API. We constantly check the
API to check that there are no previous snapshot jobs running.

Instead of implementing this logic our own, we leverage a CircleCI
orb that provides this functionality.

@devversion devversion requested a review from a team as a code owner June 23, 2020 22:25
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 23, 2020
For the past year, we've had CI failures when multiple PRs
have been merged. Since we run CI for all landed commits, the
snapshot publish job runs multiple times concurrently and could
end up pushing to the snapshot repositories out of order.

This can result in conflicts when multiple jobs push artifacts
at the same time. e.g.
https://circleci.com/gh/angular/components/155407.

We intend to fix this by queuing snapshot publishing across CircleCI
builds. This is done using the CircleCI API. We constantly check the
API to check that there are no previous snapshot jobs running.

Instead of implementing this logic our own, we leverage a CircleCI
orb that provides this functionality.
@devversion devversion force-pushed the build/avoid-snapshot-publish-conflicts branch from d3aec84 to 7121fbe Compare June 23, 2020 22:26
@devversion
Copy link
Member Author

Note: There is no easy way to test this on my end. The orb does not run on forked builds, so I cannot test this on my fork.

@jelbourn @josephperrott If we think this is worth trying, I think we should just merge it, and if it doesn't work, revert it immediately?

@devversion devversion added merge safe target: patch This PR is targeted for the next patch release labels Jun 23, 2020
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, great solution

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker labels Jun 23, 2020
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@devversion for testing, you should be able to push a branch on upstream. Since we build on all upstream branches, you should be able to test there?

@josephperrott josephperrott removed the action: merge The PR is ready for merge by the caretaker label Jun 24, 2020
@josephperrott
Copy link
Member

Removed merge ready label for @devversion to do testing, if it doesn't work, or you would prefer to just test it live, feel free to mark merge ready again.

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Jun 24, 2020
@jelbourn
Copy link
Member

I say just go for it

@devversion
Copy link
Member Author

Yeah, I was thinking about testing this upstream, but snapshot builds do not run for arbitrary upstream branches, and CircleCI auto-cancels redundant builds on branches (except for the default one. i.e. master). I gave it a shot upstream to just see if there is any configuration issue, but looks like we should be good.

@jelbourn jelbourn merged commit b68ae0d into angular:master Jun 26, 2020
jelbourn pushed a commit that referenced this pull request Jun 26, 2020
For the past year, we've had CI failures when multiple PRs
have been merged. Since we run CI for all landed commits, the
snapshot publish job runs multiple times concurrently and could
end up pushing to the snapshot repositories out of order.

This can result in conflicts when multiple jobs push artifacts
at the same time. e.g.
https://circleci.com/gh/angular/components/155407.

We intend to fix this by queuing snapshot publishing across CircleCI
builds. This is done using the CircleCI API. We constantly check the
API to check that there are no previous snapshot jobs running.

Instead of implementing this logic our own, we leverage a CircleCI
orb that provides this functionality.

(cherry picked from commit b68ae0d)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants