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

Pipeline Moved to new Certification #5017

Merged
merged 65 commits into from
Nov 10, 2023
Merged

Conversation

ugras-ergun-sonarsource
Copy link
Contributor

@ugras-ergun-sonarsource ugras-ergun-sonarsource commented Nov 10, 2023

There are too many commits so I will squash them

@ugras-ergun-sonarsource ugras-ergun-sonarsource changed the title Ue/new cert Pipeline Moved to new Certification Nov 10, 2023
@ugras-ergun-sonarsource ugras-ergun-sonarsource marked this pull request as ready for review November 10, 2023 13:23
@@ -154,12 +170,25 @@ jobs:
inputs:
solution: $(BuildParameters.solution)
vsVersion: 17.0
msbuildArgs: /p:VsTargetVersion=$(vsTargetVersion) /p:DeployExtension=false /p:SignArtifacts=$(SHOULD_SIGN) /p:AssemblyOriginatorKeyFile="$(snk.secureFilePath)" /p:pfxCertificatePath="$(pfx.secureFilePath)" /p:pfxPassword="$(pfxPassword2021-2023)" /p:pfxSha1=$(pfxSha1-2021-2023) /p:Sha1=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildId) $(AdditionalMSBuildArgs)
msbuildArgs: /p:VsTargetVersion=$(vsTargetVersion) /p:DeployExtension=false /p:SignArtifacts=false /p:AssemblyOriginatorKeyFile="$(snk.secureFilePath)" /p:Sha1=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildId) $(AdditionalMSBuildArgs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now instead of signing the artifact on build we sign them after the build.

SM_CLIENT_CERT_FILE: $(SM_CLIENT_CERT.secureFilePath)
inputs:
targetType: 'inline'
script: nuget sign "$env:PACKAGES_PATH" -Overwrite -HashAlgorithm SHA256 -CertificateFingerprint $(SM_CERT_FP) -Timestamper http://timestamp.digicert.com -TimestampHashAlgorithm SHA256
Copy link
Contributor Author

Choose a reason for hiding this comment

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

By trials done by Tom nuget sign is the only command that works for vsix signing.

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.

Some questions to look at

pipeline/azure-pipelines.yml Outdated Show resolved Hide resolved
pipeline/azure-pipelines.yml Outdated Show resolved Hide resolved
pipeline/azure-pipelines.yml Outdated Show resolved Hide resolved
SM_CLIENT_CERT_FILE: $(SM_CLIENT_CERT.secureFilePath)
inputs:
targetType: 'inline'
script: nuget sign "$env:PACKAGES_PATH" -Overwrite -HashAlgorithm SHA256 -CertificateFingerprint $(SM_CERT_FP) -Timestamper http://timestamp.digicert.com -TimestampHashAlgorithm SHA256
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you try to remove the -Override? The docs says this, and I don't see a way how the package could already have a signature in CI

Switch to indicate if the current signature should be overwritten. By default the command will fail if the package already has a signature.

Copy link

sonarcloud bot commented Nov 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

LGTM
What's the -Override result? Did you try another branch?

@ugras-ergun-sonarsource ugras-ergun-sonarsource merged commit af16f6b into master Nov 10, 2023
7 checks passed
@ugras-ergun-sonarsource
Copy link
Contributor Author

ugras-ergun-sonarsource commented Nov 10, 2023

LGTM What's the -Override result? Did you try another branch?

I ran on the branch with force sign parameter

https://dev.azure.com/sonarsource/DotNetTeam%20Project/_build/results?buildId=80535&view=results


- task: SSMClientToolsSetup@1
displayName: Client Tools Setup
condition: eq(variables['SHOULD_SIGN'], 'true')

Choose a reason for hiding this comment

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

I'm not sure I understand who sets SHOULD_SIGN to true and when this happens. Could give me a hint? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Ok, now I got it. Thanks!

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