-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Last step of publish is selecting the wrong merge target #327
Comments
There is a CLI option. Can we use that for Lines 75 to 80 in 95677da
|
Hrm, not easily. 🤔 |
@chadwhitacre you can probably make "Uses the default branch from GitHub as a fallback" case the default and move the current logic into |
@BYK That sounds more reasonable to me. What was the use-case for the |
There are some projects that release from custom branches for RC, beta, and hotfix releases and this was to address those use cases. An alternative would be to add this as an option to the config file instead of a CLI argument. This way projects can easily control the behavior? |
That's more along the lines of what I was thinking. Basically any option that craft accepts on the command line should be available through the config file. |
I dare you to make that happen 🤣 Remember how #235 went? |
Thinking of this again, since the issue is master moving too quickly, I think another |
We just hit this same bug with The culprit here is the following:
I haven't had the chance to look into this much further. We would basically need to find the branching point rather than searching for refs in the log. Same when the base branch moves on in the meanwhile, which is what happened for the Sentry release. |
I might have a solution to this. Depending on whether I can get to it, I will try to push up a PR and test this locally. For background: The current approach searches the current branches history for branch annotations. This assumes that the base branch has not moved in the meanwhile, e.g. My idea is based on https://stackoverflow.com/a/17843908. Instead, use
|
@BYK is that something you remember considering initially, or any gotchas on your end before i go down the rabbit hole? |
@jan-auer I chose the current method in https://stackoverflow.com/a/55238339/90297 due to the reasons they listed under "Why did not show-branch work for me". I did not encounter them but the last case kind of looked possible (develop vs master for hotfixes). I think we can try the other approach and see if it actually gives us any headaches. |
Spent a little bit of time playing with this and I believe the best overall solution would be to remove this feature from craft and instead always merge into the default branch when no merge base is given via CLI. We can make this a "branch to merge into (leave empty for default branch)" argument on the release action, which should be bullet proof. Next, let's address all the points from the stackoverflow answer explaining why
By definition, we always have a release branch that we need to track to its parent branch. Detached head does not make sense for our problem statement. That said, given we can write procedural code, it would be rather straight forward to use the extended ref (e.g.
That is precisely what we want. And here again, we would never run this on
I believe that this was a bug in parsing the output through grep / awk. If we want to keep this functionality around, then I think the There's only a single case that I was able to find where
In that case, show-branch would choose |
I think we can easily detect this case and prefer
I think this is not very intuitive. We may at least want to require an explicit flag to be passed when/if we detect a "non-standard" branch. |
I thought @jan-auer's suggestion is that we no longer do any branch detection. We either merge to the default branch or to an explicitly specified branch. Basically #327 (comment) but
👎
👍 |
This happened again, unfortunately, and I didn't even notice it until I accidentally stumbled across the changelog entry missing. Craft selects the wrong target and there's not even a big warning or anything. Given that we merge into the main branch in almost every case, this is another +1 for me to back this feature out and make it manual. At least then it's intentional. |
We hit this on |
Bummer. I'll probably hit this today with self-hosted 22.2.0. :-/ This is an action item on INC-95. @jan-auer Once I get through getsentry/publish#666 I would be happy to look into this as well if need be. |
After a release we merge the release branch back to the base branch:
craft/src/commands/publish.ts
Lines 331 to 363 in 78d2ca9
Unfortunately it looks like our algorithm for determining which branch to merge into if not explicitly provided is wrong. The past two
sentry
releases have merged back into the wrong branch:https://github.com/getsentry/publish/runs/4218472116?check_suite_focus=true#step:8:123 → getsentry/sentry@9ae170c
https://github.com/getsentry/publish/runs/3909141316?check_suite_focus=true#step:8:666 →
getsentry/sentry@b15920f
The result is that (at least) the CHANGES file in the sentry repo has not been updated since 21.9.0 ... we're missing all of the new changelog-y goodness!
https://github.com/getsentry/sentry/blob/master/CHANGES
The text was updated successfully, but these errors were encountered: