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

Cancel queued/running builds on second push to PR #9050

Merged
merged 1 commit into from May 28, 2020

Conversation

ashb
Copy link
Member

@ashb ashb commented May 28, 2020

This uses an action from the marketplace to cancel any running builds
for our main "CI" workflow (the only one we have at the moment)


Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

This uses an action from the marketplace to cancel any running builds
for our main "CI" workflow (the only one we have at the moment)
@ashb
Copy link
Member Author

ashb commented May 28, 2020

/cc @jhtimmins

@ashb ashb added area:CI Airflow's tests and continious integration and removed area:dev-tools labels May 28, 2020
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

❤️ !

@ashb
Copy link
Member Author

ashb commented May 28, 2020

I have no idea if this works, but it looks like it should, and was the accepted answer on the Github community, so lets give it a shot, eh?

@ashb ashb merged commit dd1bfcc into apache:master May 28, 2020
@ashb ashb deleted the cancel-old-builds-on-pr-push branch May 28, 2020 12:05
@ashb
Copy link
Member Author

ashb commented May 28, 2020

{
  eventName: 'push',
  sha: 'dd1bfccf3c09fb1f6cd23dd3fab822d72d339652',
  headSha: 'dd1bfccf3c09fb1f6cd23dd3fab822d72d339652',
  branch: 'master',
  owner: 'apache',
  repo: 'airflow'
}
Found input: 1029499
Found token: yes
Found 492 runs total.
Found 3 runs in progress.
Cancelling another run:  {
  id: 117878496,
  head_sha: '14e241f05c19208090a96744ed5d7d0b5abff365',
  status: 'queued'
}
Status 202
Cancelling another run:  {
  id: 117878144,
  head_sha: '902703da607140c876d4782c01761f3aa21b2956',
  status: 'in_progress'
}

Looks like it's cancelled some (queued/pending) builds for master, leaving only the latest one.

@potiuk
Copy link
Member

potiuk commented May 28, 2020

Which is great :).

kaxil added a commit to astronomer/airflow that referenced this pull request Jun 25, 2020
We need to Cancel builds to PR too.

apache#9050 only cancels on push to Master branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CI Airflow's tests and continious integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants