-
Notifications
You must be signed in to change notification settings - Fork 143
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
Run on our infrastructure #1933
Conversation
72e50ae
to
7b666ac
Compare
7b666ac
to
850be32
Compare
c64f4c9
to
845aae5
Compare
azure-pipelines.yml
Outdated
- powershell: | | ||
nuget help | Select-String "NuGet Version" | ||
nuget pack 'nuspec\netcoreglobaltool\dotnet-sonarscanner.nuspec' -NonInteractive -OutputDirectory build -Verbosity Detailed |
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.
NuGetCommand@2
uses an older version of nuget.exe
845aae5
to
71fb1b3
Compare
f86d098
to
004e31f
Compare
004e31f
to
f280c0f
Compare
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 need to understand the PR more to review it properly. I mainly submitted questions.
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.
LGTM!
1146afa
to
a78561c
Compare
Quality Gate passedIssues Measures |
- task: NuGetToolInstaller@1 | ||
displayName: "Install NuGet" | ||
inputs: | ||
versionSpec: $(NUGET_VERSION) |
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.
If it runs on our infrastructure, we don't need to install NuGet.
Why is this needed?
I remembered, I removed it.
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 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.
It seems the Nuget installed on the CI image doesn't work, the Package dotnet global tool
task fails:
NuGet Version: 4.9.6.8
Attempting to build package from 'dotnet-sonarscanner.nuspec'.
System.InvalidOperationException: The element 'metadata' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd' has invalid child element 'readme' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd'. List of possible elements expected: 'serviceable, dependencies, repository, licenseUrl, copyright, references, packageTypes, contentFiles, releaseNotes, tags, language, developmentDependency, frameworkAssemblies, owners' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd'. This validation error occurred in a 'readme' element.
at NuGet.Packaging.Manifest.<>c.<ValidateManifestSchema>b__20_0(Object sender, ValidationEventArgs e)
at System.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedName elementName, Boolean& invalidElementInContext)
at System.Xml.Schema.XmlSchemaValidator.ValidateElement(String localName, String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, String xsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation)
at System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)
at System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e)
at System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)
at System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e)
at System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)
at System.Xml.Schema.XNodeValidator.Validate(XObject source, XmlSchemaObject partialValidationType, Boolean addSchemaInfo)
at NuGet.Packaging.Manifest.ValidateManifestSchema(XDocument document, String schemaNamespace)
at NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func`2 propertyProvider, Boolean validateSchema)
at NuGet.Packaging.PackageBuilder.ReadManifest(Stream stream, String basePath, Func`2 propertyProvider)
at NuGet.Packaging.PackageBuilder..ctor(String path, String basePath, Func`2 propertyProvider, Boolean includeEmptyDirectories)
at NuGet.Commands.PackCommandRunner.CreatePackageBuilderFromNuspec(String path)
at NuGet.Commands.PackCommandRunner.BuildFromNuspec(String path)
at NuGet.Commands.PackCommandRunner.BuildPackage()
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
##[error]The nuget command failed with exit code(1) and error(The element 'metadata' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd' has invalid child element 'readme' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd'. List of possible elements expected: 'serviceable, dependencies, repository, licenseUrl, copyright, references, packageTypes, contentFiles, releaseNotes, tags, language, developmentDependency, frameworkAssemblies, owners' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd'. This validation error occurred in a 'readme' element.)
##[error]An error occurred while trying to pack the files.
We'll have to update the Nuget version on the image first before we can remove the Nuget installer task.
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.
That's why I made this change: 71fb1b3
The NuGetCommand@2
task does not seem to use the NuGet we installed.
I didn't check if there is a way to tell to use the one we use.
@@ -430,6 +455,10 @@ stages: | |||
targetPath: '$(Build.SourcesDirectory)\build' | |||
artifactName: build | |||
|
|||
- task: NuGetToolInstaller@1 |
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.
Why this has been added?
It was not required.
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.
Fixes #1934
I have done some tests and was able to have a green CI for the Build stage.
To do so, I had to disable/comment on any task related to the SBOM file:
Dotnet generate SBOM
taskGenerate packages
task: I commented two lines in the scriptStage to repox
task which needs the file to continueOnce the build of the dotnet-ci AMI is working, I do not expect to see any other issues, except maybe in the
Stage to repox
.Update (from Zsolt): I re-enabled the tasks and modified the SBOM generation to make it work with the new image.