Skip to content

Make OfficialBuildId settable on publish assets#16122

Merged
mmitche merged 3 commits intodotnet:mainfrom
MiYanni:SetOfficialBuildIdOnPublishAssets
Sep 12, 2025
Merged

Make OfficialBuildId settable on publish assets#16122
mmitche merged 3 commits intodotnet:mainfrom
MiYanni:SetOfficialBuildIdOnPublishAssets

Conversation

@MiYanni
Copy link
Copy Markdown
Member

@MiYanni MiYanni commented Sep 9, 2025

Summary

The Build.BuildNumber is a settable value in Azure Pipelines. When changed, it updates the run name for your pipeline (what you see as the name of a particular run of your pipeline).

Currently, Build.BuildNumber is used in part of Arcade's build processes, as it parses information out of this value. However, this doesn't work for publishing build assets if you change the value at any point in your pipeline via the name value or using the updatebuildnumber logging command. The solution was to allow the OfficialBuildId to be settable, but default to Build.BuildNumber if not provided. I've done this defaulting logic for both jobs.yml and publish-build-assets.yml as to not break any existing uses of these templates.

Note: I will need to backport these changes to Arcade 8 and 9 for my situation to work properly.

@akoeplinger
Copy link
Copy Markdown
Member

hmm we're using that variable in lots of other places: https://github.com/search?q=repo%3Adotnet%2Farcade%20%22Build_BuildNumber%22&type=code

with this change those would diverge

@MiYanni
Copy link
Copy Markdown
Member Author

MiYanni commented Sep 10, 2025

hmm we're using that variable in lots of other places: github.com/search?q=repo%3Adotnet%2Farcade%20%22Build_BuildNumber%22&type=code

with this change those would diverge

So, this change won't 'diverge' as it only allows overriding OfficialBuildId. The purpose here isn't about changing the use of Build.BuildNumber in Arcade. In my situation, I'm overriding Build.BuildNumber and the PublishAssets stage won't work (it fails).

If you had a pipeline that would exercise all pipeline templates and build uses of Build.BuildNumber in Arcade, I could make a PR to update its value and systematically fix where it fails. Otherwise, there's no way to do this wholistically. This is just a "spot fix" as I need this fix or else I can't update Build.BuildNumber in my pipeline, and continue to use PublishAssets.

mmitche
mmitche previously approved these changes Sep 11, 2025
@mmitche mmitche merged commit 0590f94 into dotnet:main Sep 12, 2025
10 checks passed
@MiYanni
Copy link
Copy Markdown
Member Author

MiYanni commented Sep 12, 2025

/backport to release/8.0

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/8.0: https://github.com/dotnet/arcade/actions/runs/17678924062

@MiYanni
Copy link
Copy Markdown
Member Author

MiYanni commented Sep 12, 2025

/backport to release/9.0

@github-actions
Copy link
Copy Markdown
Contributor

@MiYanni backporting to "release/8.0" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Allows you to set the OfficialBuildId for the publish build assets job.
Using index info to reconstruct a base tree...
A	eng/common/core-templates/job/publish-build-assets.yml
A	eng/common/core-templates/jobs/jobs.yml
Falling back to patching base and 3-way merge...
Auto-merging eng/common/templates-official/job/publish-build-assets.yml
CONFLICT (content): Merge conflict in eng/common/templates-official/job/publish-build-assets.yml
Auto-merging eng/common/templates-official/jobs/jobs.yml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Allows you to set the OfficialBuildId for the publish build assets job.
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/9.0: https://github.com/dotnet/arcade/actions/runs/17678928122

@github-actions
Copy link
Copy Markdown
Contributor

@MiYanni backporting to "release/9.0" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Allows you to set the OfficialBuildId for the publish build assets job.
Using index info to reconstruct a base tree...
M	eng/common/core-templates/job/publish-build-assets.yml
M	eng/common/core-templates/jobs/jobs.yml
Falling back to patching base and 3-way merge...
Auto-merging eng/common/core-templates/job/publish-build-assets.yml
CONFLICT (content): Merge conflict in eng/common/core-templates/job/publish-build-assets.yml
Auto-merging eng/common/core-templates/jobs/jobs.yml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Allows you to set the OfficialBuildId for the publish build assets job.
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@MiYanni
Copy link
Copy Markdown
Member Author

MiYanni commented Sep 12, 2025

/backport to release/10.0

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/10.0: https://github.com/dotnet/arcade/actions/runs/17678940547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants