Closed danieljurek closed 1 month ago
This could be Build.SourceBranchName
which now is just the branch name. https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
This issue is primarily about releases for the C repo which has a different release and docs architecture from other language repositories.
The link replacement regex (https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/pipelines/templates/steps/publish-blobs.yml#L27) is hadcoded to look for
$(DefaultBranch)
This means that links like...
... will be properly replaced with the tag because
main
is the value for$(DefaultBranch)
However, links which target files that are NOT in the default branch will not match the link substitution regex and will not be replaced. For example:
The regex which finds these links for substitution today looks like:
Which, in the case of the C repo, expands to:
We should consider potentially adding the "current branch" against which a build is being run to this list, something like:
This will require some additional work to find the branch name as the predefined variables like
$(Build.SourceBranch)
prefixes which are not useful to the link substitution (e.g.refs/heads/<branch name>
).However, when integrating back into the default branch, the links will contain the name of a branch which could be deleted and those links may fail at a future time. It may be necessary to, when merging to a default branch, look for instances of links which contain the current branch name and ensure that they are properly evaluated and updated.