-
Notifications
You must be signed in to change notification settings - Fork 135
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
Different multibranch pipelines use the same key #175
Comments
Hi, @Wilfred Can you try override |
Yep, setting the However, this requires every user with multiple jobs that are multibranch pipelines to do the same thing. Ideally stashnotifier-plugin wouldn't require every user to set |
Initially, prepend parent job key option was introduced in #60 by me for solving your initial problem - create unique keys for multibranch projects operating the same repo. I'm not sure that configuring single option is a really big problem to make this plugin hardly tied to multibranch plugin. If you have a decision without declaring a dependency - PR is always welcome |
@scaytrase OK, how about this? If |
How do you resolve false positives, i.e classic non-multibranch job, named I think it's ok to introduce some optional global-configured project key guesser, but it should be off by default anyway for BC reasons to not get any key renamed unintentionally |
If there's a classic non-multibranch job named If the classic non-multibranch job is in a folder, then the the parent job key will be non-null, but that seems harmless to me. |
Suppose I have two separate multibranch pipeline jobs,
foo-unit
andfoo-integration
. When I push a branch to master, the following notifications are sent to Stash:These both have the same
key
. As a result, Stash uses the last build and ignores the first.I can't use
includeBuildNumberInKey
because if build 1 of foo-integration is red, but build 2 of foo-integration is green, Stash thinks they are distinct jobs. This gives a key of the form"master-2-http:\\/\\/ci.dev.example\\/"
.If I use
step([$class: 'StashNotifier', prependParentProjectKey: true])
I get a key that's unique to the current build:However, this is subtle gotcha. It would be nice if this plugin used the build name, not the branch name, for multibranch pipelines.
I think the correct solution would be to change
StashNotifier#getDefaultBuildKey
to use something likeif build instanceOf MultiBranchProject
, but this would introduce a dependency on that plugin.What do you think is a good solution here?
The text was updated successfully, but these errors were encountered: