-
Notifications
You must be signed in to change notification settings - Fork 15
Set run name to use source branch's commit message #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…g for resource variables.
…nment variables for debugging.
…ld.BuildNumber to a separate variable for the build.
…commit message it should be showing. Trying compile-time syntax for the OfficialBuildId.
| sourceBranchAlias: self | ||
| engBranchAlias: eng |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated these parameter names to be more accurate as it was confusing since they aren't actually the branch names, but aliases to the repository for those branches.
…this branch's PR build.
…arameter display name casing to be consistent.
| parameters: | ||
| - name: sourceBranch | ||
| displayName: 🚩 Source Branch 🚩 | ||
| displayName: 🚩 Source branch 🚩 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted pipeline parameter display names to have consistent casing.
|
Arcade PRs merged. Awaiting VMR flow... |
|
Changes from Arcade are merged in for 9. |
|
|
Summary
When running the official build, the run name will always show the last commit message from the
engbranch, which is not desired. What is ideal is showing the last commit message from the provided 'source branch' when the pipeline is ran. I figured this would be pretty simple and straightforward to set, but it was not. 😭Details
When running a build, Azure Pipelines will, by default, use this format for the run name:
We actually want the
$(Build.SourceVersionMessage)to be from the 'source branch' and not theengbranch. But, this value is not configurable. Updating the run name would be simple if there was just a "display name" value for this. However, there is not. Instead, it works as such:#as the first character no matter the settings.$(Date:yyyyMMdd).$(Rev:r)portion is actually the$(Build.BuildNumber)value.• $(Build.SourceVersionMessage)portion is actually shown via a boolean appendCommitMessageToRunName, which is set totrueby default.The only way to change this run name is by doing the following:
falsefor the pipeline so the default commit message is no longer appended to the run name.$(Build.BuildNumber)via the logging command,build.updatebuildnumber.This allows you to "fully customize" the run name as long as
Build.BuildNumberdoes not:Characters which are not allowed include '"', '/', ':', '<', '>', '\', '|', '?', '@', and '*'.So, I've been forced to clean the commit message from the source branch when I gather it to adhere to these requirements. This normally doesn't require this level of scrutiny when the default
appendCommitMessageToRunNameis used.Another problem arose. Apparently, Arcade uses
$(Build.BuildNumber)in various places. Generally, it is set to theOfficialBuildIdproperty. We send that value here when we build, so I simply save the original value to aOfficialBuildIdvariable, and then use that when we build. That resolved the build issue.The other Arcade issue is that the 'Publish Assets' stage has the use of
$(Build.BuildNumber)hard-coded to be theOfficialBuildIdproperty. To solve that, I've created a PR for Arcade to allow setting theOfficialBuildIdproperty in 'Publish Assets' stage via the jobs.yml parameters. This change is required prior to merging this PR.