Closed mydea closed 1 year ago
Craft already knows about the "default" branch so it feels more appropriate to make this the default behavior?
For backwards compatibility, you can internally enable this only for config files setting a minVersion above the change date.
Sounds good to me too!
So basically you mean:
Actually, we just thought about this and this will not necessarily work - as the default branch is not necessarily the branch where you run releases from.
Concretely, in sentry-javascript the default branch is develop, but we release from/to the master branch (we use gitflow and still merge into develop while a release is pending etc). So for cases like these you'd still need to configure this.
We can still do both I guess, do this by default for the default branch, but allow to configure/overwrite this if needed?
Concretely, in sentry-javascript the default branch is develop, but we release from/to the master branch (we use gitflow and still merge into develop while a release is pending etc). So for cases like these you'd still need to configure this.
Ah, that's quite unfortunate (and unexpected for me) π
We can still do both I guess, do this by default for the default branch, but allow to configure/overwrite this if needed?
I'd say yes but I feel like it may complicate things unnecessarily if you were looking to get this out of the door quickly. Use your own judgement then :) For the given scenario, your initial proposal makes sense to me and easy and harmless enough to start with.
At the end, we ended up implementing this different, per-target. Some targets already do this (e.g. registry, aws lambda layer, ...). So I added this to the github target as well (https://github.com/getsentry/craft/pull/503), and added a new config for the npm target to also be able to do this (https://github.com/getsentry/craft/pull/504).
Problem
When publishing backported versions, they are auto-set as latest in various targets (npm, github, possibly others). This means that you either need to take manual steps or have to follow up with a release of the "actual" latest, which is far from ideal.
For npm, you can circumenvent this by putting something like this on the backported branchs package.json:
For github, there is no way to do that (and e.g. Homebrew depends on this)
Proposed solution
We propose to add a new top level config to allow to opt-in to define a list of target branches that should get the latest tag:
If this is configured, craft targets should only add the
latest
tag (or similar behavior, depending on the target) when merging into one of the defined branches.With this, projects can opt-in to only release as
latest
when merging into e.g. master/main branch, and when merging into e.g. a1.x
branch we can ensure to not mark this release as latest.