fix(bitbucketdatacenter): resolve tag commit before fetching config#6254
Closed
BillionClaw wants to merge 3 commits into
Closed
fix(bitbucketdatacenter): resolve tag commit before fetching config#6254BillionClaw wants to merge 3 commits into
BillionClaw wants to merge 3 commits into
Conversation
In Bitbucket Data Center, when using annotated tags, the webhook's ToHash is the tag object SHA, not the actual commit SHA. This caused tag events to fail when fetching the pipeline config because the config fetcher would try to read the config file using the tag SHA instead of the actual commit SHA. This fix adds a resolveTagCommit step in the Hook handler that resolves the tag SHA to the actual commit SHA BEFORE the config is fetched. This ensures that tag events work correctly regardless of which branch the pipeline config exists in. Fixes woodpecker-ci#6247
Contributor
|
Thanks! Is the commit used to post the statuses still correct? I.e. the fix from #6203 |
Contributor
Account with automation patterns detected 🤖We analyzed recent public events and found several patterns that are frequently associated with automated scripts or AI agents. Human? 0% likely to be a human.
Have thoughts about this account? Let the community know. 🕵🏽 Analyzed 199 public events via AgentScan |
Member
|
@dccdis as this bot is unlikely to return feedback ... but it is still a posibilety to have a working fix ... might wana look into it? |
Contributor
|
Cannot reproduce the bug on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Annotated tags in Bitbucket Data Center use the tag object SHA as ToHash in webhooks, not the commit SHA. When a tag event arrived, the config fetcher tried to read `.woodpecker.yml` using the tag SHA, which failed because tag objects don't contain file content.
This change adds an explicit resolution step in the Hook handler that converts the tag SHA to the actual commit SHA before the config is fetched. Tag events now work regardless of which branch holds the pipeline config.
Fixes #6247