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
Documentation: Add README file about how artifacts version is set in the pipeline #9148
base: master
Are you sure you want to change the base?
Conversation
b63a7cb
to
e0e675e
Compare
Quality Gate passedIssues Measures |
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.
We probably need to pair to build a basic outline first.
The story describes individual details, but I don't explain the overal picture, like what are the entrypoints.
scripts/version/set-version.ps1
Outdated
@@ -3,6 +3,8 @@ | |||
.SYNOPSIS | |||
This script allows to set the specified version in all required files. | |||
|
|||
See in .\scripts\version\README how version is set during the pipeline run |
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.
DOES IT NEED TO YELL IN ALL CAPS?
See in .\scripts\version\README how version is set during the pipeline run | |
See in .\scripts\version\ReadMe.md how version is set during the pipeline run |
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.
the file is in capital README.md
, I followed the pattern of other README.md
.
Read-me files are usually overlooked, so they have to scream to get your attention 😱 .
PS: I added the md
scripts/version/README.md
Outdated
|
||
1. `sonar-csharp-plugin-x.y.z.buildNumber.jar` | ||
1. `sonar-vbnet-plugin-x.y.z.buildNumber.jar` | ||
1. `SonarAnalyzer.CSharp-x.y.z.nupkg` |
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.
SonarAnalyzer.CSharp.Styling
is missing
scripts/version/README.md
Outdated
|
||
1. `sonar-csharp-plugin-x.y.z.buildNumber.jar` | ||
1. `sonar-vbnet-plugin-x.y.z.buildNumber.jar` | ||
1. `SonarAnalyzer.CSharp-x.y.z.nupkg` |
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.
There's no dash in nugets
1. `SonarAnalyzer.CSharp-x.y.z.nupkg` | |
1. `SonarAnalyzer.CSharp.x.y.z.nupkg` |
scripts/version/README.md
Outdated
|
||
### How is the version set for the *.jar artifacts | ||
|
||
The Java artifacts' major, minor and, patch parts of the version, are set in the [sonar-dotnet pom.xml](https://github.com/SonarSource/sonar-dotnet/blob/master/pom.xml#L14). |
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.
The Java artifacts' major, minor and, patch parts of the version, are set in the [sonar-dotnet pom.xml](https://github.com/SonarSource/sonar-dotnet/blob/master/pom.xml#L14). | |
The Java artifacts' major, minor, and patch parts of the version, are set in the [sonar-dotnet pom.xml](https://github.com/SonarSource/sonar-dotnet/blob/master/pom.xml#L14). |
scripts/version/README.md
Outdated
|
||
### How is the version set for the *.jar artifacts | ||
|
||
The Java artifacts' major, minor and, patch parts of the version, are set in the [sonar-dotnet pom.xml](https://github.com/SonarSource/sonar-dotnet/blob/master/pom.xml#L14). |
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.
The #L14 link will get easily out of date, as we won't backtrack this reference if we do any changes to the pom.xml. Permanent link would be better IMO
scripts/version/README.md
Outdated
The Java artifacts' major, minor and, patch parts of the version, are set in the [sonar-dotnet pom.xml](https://github.com/SonarSource/sonar-dotnet/blob/master/pom.xml#L14). | ||
The `buildNumber` is set in the Azure pipeline [here](https://github.com/SonarSource/sonar-dotnet/blob/master/azure-pipelines.yml#L538) with the use of the `update-maven-version-steps.yml` and it's equal to the pipeline [`buildId`](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml#tokens). | ||
|
||
You can find the `update-maven-version-steps.yml` [here](https://dev.azure.com/sonarsource/DotNetTeam%20Project/_git/pipelines-yaml-templates?path=/update-maven-version-steps.yml). |
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.
This paragraph should mention that maven set-version plugin is used to update all pom.xml files.
scripts/version/README.md
Outdated
|
||
### How is the version set for the *.jar artifacts | ||
|
||
The Java artifacts' major, minor and, patch parts of the version, are set in the [sonar-dotnet pom.xml](https://github.com/SonarSource/sonar-dotnet/blob/master/pom.xml#L14). |
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.
This is not entirely true. The actual version for JAR is inside sonar-csharp-plugin
and sonar-vbnet-plugin
pom.xml. It should mention that version is updated in all pom.xml files in the repo. See https://github.com/SonarSource/sonar-dotnet/pull/9076/files
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.
Isn't the jar versions set from the parent pom that is in the root?
That's my understanding of the parent
tag here.
We set this manually, as the version
tag in the parent
has to agree with the parent pom to be able to build. But the version is inherited from the parent. Do I get something wrong here?
I also just tested this in the pipeline.
scripts/version/README.md
Outdated
|
||
### How is the version set for the for the NuGet and the *.dll artifacts | ||
|
||
The major, minor and, patch parts of the version for these files is taken from the [`MainVersion` field in the Version.props](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/Version.props#L3) file. |
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.
The major, minor and, patch parts of the version for these files is taken from the [`MainVersion` field in the Version.props](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/Version.props#L3) file. | |
The major, minor, and patch parts of the version for these files is taken from the [`MainVersion` field in the Version.props](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/Version.props#L3) file. |
scripts/version/README.md
Outdated
You can find the `update-maven-version-steps.yml` [here](https://dev.azure.com/sonarsource/DotNetTeam%20Project/_git/pipelines-yaml-templates?path=/update-maven-version-steps.yml). | ||
The `buildNumber` is set on line 16 where the `compute-build-version-step.yml` is called, which you can find [here](https://dev.azure.com/sonarsource/DotNetTeam%20Project/_git/pipelines-yaml-templates?path=/compute-build-version-step.yml). | ||
|
||
### How is the version set for the for the NuGet and the *.dll artifacts |
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.
The whole story should start with set-version.ps1
as the entry point and then evolve into details. Now it's not clear that the main version comes from an argument there, and the rest of the story just randomly tasks other variables from Azure
scripts/version/README.md
Outdated
- [NuGet package metadata for `SonarAnalyzer.VisualBasic-x.y.z.nupkg`](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/packaging/SonarAnalyzer.VisualBasic.nuspec) | ||
- [NuGet package metadata for `SonarAnalyzer.CFG-x.y.z.nupkg`](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/src/SonarAnalyzer.CFG/SonarAnalyzer.CFG.cs.nuspec) | ||
|
||
is automatically updated through the [`ChangeVersion.proj`](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/ChangeVersion.proj) that is executed [here](https://github.com/SonarSource/sonar-dotnet/blob/master/azure-pipelines.yml#L91). |
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.
This story reads out of order. It doesn't follow the logical flow of operations.
9098cc5
to
24d38af
Compare
609eafe
to
93279c9
Compare
502af83
to
6a1a3c0
Compare
Quality Gate passed for 'Sonar .NET Java Plugin'Issues Measures |
Quality Gate passed for 'SonarAnalyzer for .NET'Issues Measures |
No description provided.