Fix sync-tags handling of dependency tags #16
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
publishing-bot assumes that all staging repos are going to have the same tags. For example, if we cut v0.29.0 in
kcp-dev/kcp, it'll be propagated to all staging repositories likeapimachinery,client-go... That's not really case for us. What we do is that we modify the tag name to match the Go module major version of that staging repository. So v0.29.0 tag fromkcp-dev/kcpmight actually be v2.29.0 inkcp-dev/apimachinery.This is breaking the dependency update mechanism that's done by sync-tags. What this mechanism does is that before tagging a staging/published repository, it would update dependencies to other staging repositories to a tagged version. For that, it would just take the tag from
kcp-dev/kcpand use it because it expects that tag to exist in all staging repositories.The problem is that sync-tags is not aware of configuration for other repositories, it doesn't know if
apimachineryis at v0 or v2. But there's a helpful thing. sync-tags is also pushing a tag with format ofkcp-<kcp-tag>, so we'll have a tag such askcp-0.29.0. Using this, we can find the commit in the dependant staging repository with that tag, get all other tags for that commit, take the latest one if there are multiple tags, and then just use it for updating the dependency./assign @xrstf @embik