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

.github: set [no-test] prefix for dependabot PR's #1429

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

jelly
Copy link
Member

@jelly jelly commented Sep 28, 2023

Dependabot sets labels after PR creation so our pull requests tests would run regardless which is a waste of resources.

@jelly jelly added the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Sep 28, 2023
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Hmm, that clears the no-test flag from the PR title, but it also needs to be removed from the actual commit when force-pushing. I assume that commit-message: will literally put it into the commit, not just the PR title/description?

@jelly
Copy link
Member Author

jelly commented Sep 28, 2023

Hmm, that clears the no-test flag from the PR title, but it also needs to be removed from the actual commit when force-pushing. I assume that commit-message: will literally put it into the commit, not just the PR title/description?

Yup, should we put in some effort to drop it there too. Re-pushed with a fix for that:

See: jelly#31

Dependabot sets labels after PR creation so our pull requests tests
would run regardless which is a waste of resources.
@github-actions github-actions bot removed the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Sep 28, 2023
@jelly jelly added the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Sep 28, 2023
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! Let's clean up the title handling a bit.

But I must say, this is super ugly. Originally I thought that our API sets the labels right in the "create PR" call -- but that's not actually supported (unlike with creating a PR interactively), and our bots API doesn't do this , it POSTs the new /pull and then labels it. In theory that should cause a race condition with our bots, as tests-scan takes the webhook event into account, not the current state. So 🤔 how does that work for us? In other words, what could dependabot do differently to work for us?

.github/workflows/dependabot.yml Show resolved Hide resolved
@jelly
Copy link
Member Author

jelly commented Sep 28, 2023

Thanks! Let's clean up the title handling a bit.

But I must say, this is super ugly. Originally I thought that our API sets the labels right in the "create PR" call -- but that's not actually supported (unlike with creating a PR interactively), and our bots API doesn't do this , it POSTs the new /pull and then labels it. In theory that should cause a race condition with our bots, as tests-scan takes the webhook event into account, not the current state. So 🤔 how does that work for us? In other words, what could dependabot do differently to work for us?

No no, when you manually create a PR you can set no-test as a label in the creation screen. But it looks the same indeed cockpit-project/cockpit#19409

For bot workflows we set [no-test].

@martinpitt
Copy link
Member

For bot workflows we set [no-test].

Ah, thanks! that clears it up.

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Ack, thanks!

@martinpitt martinpitt merged commit c3a1a71 into cockpit-project:main Sep 29, 2023
19 of 20 checks passed
@jelly jelly deleted the dependabot branch September 29, 2023 08:14
@jelly
Copy link
Member Author

jelly commented Sep 29, 2023

Also FYI, I had a discussion with @allisonkarlitskaya in Matrix, maybe we should try to improve this a bit by rewriting it into a bots/node-modules-update and tools/node-modules rebase so we can remove the [no-test] title in Python and more easily handle multiple commits.

But eh, that's a lot of work. Let's wait for things to settle first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants