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
Multiple drafts created due to GH workflow concurency #1146
Comments
@dduportal I am not following your explanation or pictures. Would be nice with link to workflow makes everything a lot easier. Why do you need 3 actions to trigger when you could use parallel jobs and have release drafter as a job run before all of these 3 jobs? cc @lemeurherve |
Hello @jetersen ! No problem, please find some materials below:
=> You can reproduce this behavior with a simple case: enable "release-drafter" on a repo, only on the main branch + workflow dispatch.While the release drafter run is executed, trigger 1 or 2 others manually: you'll have multiple drafts (wether they are named or no not). |
Hmm, hopefully once #1173 lands it should solve your issue. I have work locally, I will push tonight which mostly finishes the module and typescript transition. |
@dduportal I am getting closer with v6 to actually write the action and cli implementation. Would you be interested in testing out the release-drafter cli in your Jenkins infra once I have something that should function similar to running it as a GitHub action? |
Absolutely! Many thanks |
I am thinking of four modes draft CLI part of it.
Mode three: - not yet implemented
Mode four: We could potentially allow for the increment types that All of it can have |
@jetersen impressive. It looks like that it would solve most of our issues (but we'll only be sure once we'll try to use it of course). |
Thinking about mode one for local, I may want to detect repo. Attempt to download config and .github config and than merge with local config. To provide the best experience. Of course you could disable the repo lookup via CLI flag I think that would be valuable but disabling the repo lookup means you have to duplicate the entire config locally but I guess it depends on use cases. Thinking about mode one for ci. I looked at npmjs to see if anybody had done ci detection but it seems they have only done the detection not detecting the actual repository. Which is usually present in most CIs. So I may have to write my own module, that fits my needs. The module should detect CI, detect the ref and detect repository. If none of this is possible complain and ask for |
Okay most CI are crap at giving ref and repository via envs. Maybe the best way forward is asking the user to provide via CLI flags. They can of course you environment variables if the CI provides it! |
https://www.npmjs.com/package/commander Seems like a good fit for CLI it relatively small with zero dependencies, I don't need something fancy like chalk.js (coloring cli output) imho. |
Managed to create an initial CLI that function similar to GitHub Action. I simply need to package up the CLI and publish to |
Decided against trying to being fancy 😅 |
@dduportal I have published a beta version Available here: https://www.npmjs.com/package/@release-drafter/cli You can run it like this
So if you release from default branch it will continue to work as always. We allow to override commitish but it will also default to reference. |
On the Jenkins infrastructure project, we've hit a reproductible case where we have multiple times the same draft created by release-drafter, while we have fixed the tag and release name to the static value
next
.There are multiple causes that make it an "edge" case:
release:
trigger event for release-drafter's workflow (we have a new "next release draft" published right after Jenkins publishing a given release)In our case, since we "patch" the release, there are 3 events triggering 3 concurent builds of the GH workflow: it results in 3 different "next release draft":
We are thinking, in the short term, to enable the "concurency" feature of GH action (https://docs.github.com/en/actions/using-jobs/using-concurrency) so only 1 release-drafter job would be executed at once, streamlining the executions. The 2nd and 3rd builds in our case should pick the previous
next
release because executed AFTER.Our use case is edgy, however you can reproduce it with any release-drafter process executed both manually (
workflow_dispatch:
event) and automatically: WDYT if we send a PR to the documentation suggesting to use the concurency keyword as a sane default?The text was updated successfully, but these errors were encountered: