Skip to content

Add compliance pipeline #896

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

Merged
merged 2 commits into from
May 21, 2025
Merged

Add compliance pipeline #896

merged 2 commits into from
May 21, 2025

Conversation

jakebailey
Copy link
Member

To aid in NOTICE generation.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a dedicated Azure Pipelines configuration to generate compliance artifacts (e.g., NOTICE file) as part of CI.

  • Introduces a new _build/azure-pipelines.compliance.yml that triggers on main.
  • Extends the shared 1ES pipeline template and enables production SDL checks.
  • Installs Node package manager, Go toolchain, and runs the hereby build step.
Comments suppressed due to low confidence (1)

_build/azure-pipelines.compliance.yml:54

  • To guard against a malicious or corrupted download, consider verifying the Go archive's checksum or signature before extracting it.
curl -SL -o '$(Agent.BuildDirectory)/golang.tar.gz' https://aka.ms/golang/release/latest/go${version}.linux-amd64.tar.gz

submodules: false

- bash: |
npm install -g `node -e 'console.log(JSON.parse(fs.readFileSync("package.json", "utf8")).packageManager)'`
Copy link
Preview

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Use the POSIX-standard $(...) syntax instead of backticks for command substitution to improve readability and avoid nesting issues, e.g., npm install -g $(node -e 'console.log(JSON.parse(fs.readFileSync("package.json", "utf8")).packageManager)').

Suggested change
npm install -g `node -e 'console.log(JSON.parse(fs.readFileSync("package.json", "utf8")).packageManager)'`
npm install -g $(node -e 'console.log(JSON.parse(fs.readFileSync("package.json", "utf8")).packageManager)')

Copilot uses AI. Check for mistakes.


- bash: |
set -euo pipefail
version=$(grep -oP '^go \K[0-9]+\.[0-9]+' go.mod)
Copy link
Preview

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

The grep -P (Perl-compatible regex) option is not guaranteed on all images; consider using grep -E or a sed/awk command to reliably extract the Go version from go.mod.

Suggested change
version=$(grep -oP '^go \K[0-9]+\.[0-9]+' go.mod)
version=$(grep -Eo '^go [0-9]+\.[0-9]+' go.mod | awk '{print $2}')

Copilot uses AI. Check for mistakes.

go version
displayName: 'Check Go version'

- bash: npx hereby build
Copy link
Preview

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Wrap this step in a multi-line shell block with set -euo pipefail to ensure any errors in the build command cause the pipeline to fail.

Suggested change
- bash: npx hereby build
- bash: |
set -euo pipefail
npx hereby build

Copilot uses AI. Check for mistakes.

go version
displayName: 'Check Go version'

- bash: npx hereby build
Copy link
Member Author

Choose a reason for hiding this comment

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

What this pipeline does doesn't really matter; it's the extra result of it running and getting CG that does.

@jakebailey jakebailey enabled auto-merge May 21, 2025 16:53
@jakebailey jakebailey added this pull request to the merge queue May 21, 2025
Merged via the queue into main with commit c97fa04 May 21, 2025
23 checks passed
@jakebailey jakebailey deleted the jabaile/compliance branch May 21, 2025 18:49
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.

None yet

2 participants