Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mary-georgiou-sonarsource
Copy link
Contributor

No description provided.

@mary-georgiou-sonarsource mary-georgiou-sonarsource marked this pull request as draft April 19, 2024 13:38
@github-actions github-actions bot added this to In progress in Best Kanban Apr 19, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource force-pushed the mary/doc-versioning branch 6 times, most recently from b63a7cb to e0e675e Compare April 19, 2024 14:06
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title document versioning Documentation: Add README file describing how artifacts version is set in the pipeline Apr 19, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Documentation: Add README file describing how artifacts version is set in the pipeline Documentation: Add README file about how artifacts version is set in the pipeline Apr 19, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource marked this pull request as ready for review April 19, 2024 14:09
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 19, 2024
Copy link

sonarcloud bot commented Apr 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a 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.

@@ -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
Copy link
Contributor

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?

Suggested change
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

Copy link
Contributor Author

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


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`
Copy link
Contributor

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


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`
Copy link
Contributor

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

Suggested change
1. `SonarAnalyzer.CSharp-x.y.z.nupkg`
1. `SonarAnalyzer.CSharp.x.y.z.nupkg`


### 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).


### 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).
Copy link
Contributor

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

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).
Copy link
Contributor

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.


### 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).
Copy link
Contributor

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

Copy link
Contributor Author

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.


### 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

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
Copy link
Contributor

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

- [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).
Copy link
Contributor

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.

@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Apr 23, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource force-pushed the mary/doc-versioning branch 6 times, most recently from 9098cc5 to 24d38af Compare April 29, 2024 08:12
@mary-georgiou-sonarsource mary-georgiou-sonarsource force-pushed the mary/doc-versioning branch 5 times, most recently from 502af83 to 6a1a3c0 Compare April 29, 2024 13:05
Copy link

sonarcloud bot commented Apr 29, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 29, 2024

Quality Gate Passed Quality Gate passed for 'SonarAnalyzer for .NET'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Best Kanban
  
Review in progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants