Skip to content

Conversation

caarlos0
Copy link
Member

closes #5786

@caarlos0 caarlos0 requested a review from Copilot May 23, 2025 17:06
@caarlos0 caarlos0 self-assigned this May 23, 2025
@caarlos0 caarlos0 added the enhancement New feature or request label May 23, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 23, 2025
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

This PR adds support for an "enabled" flag in the SBOM configuration, allowing users to toggle whether SBOM generation is performed.

  • Documentation added to introduce the new "enabled" field with a default of true.
  • A new Enabled field is added to the SBOM configuration and integrated into the processing logic.
  • Tests are extended to cover different scenarios for the Enabled setting, and the catalogTask function is refactored for clarity.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
www/docs/customization/sbom.md Updates documentation to include the new "enabled" flag in SBOM docs.
pkg/config/config.go Introduces the Enabled field with support for template and boolean values.
internal/pipe/sbom/sbom_test.go Adds unit tests to verify the behavior of the Enabled flag.
internal/pipe/sbom/sbom.go Implements defaulting for the Enabled flag and refactors catalogTask.
Comments suppressed due to low confidence (1)

pkg/config/config.go:788

  • The 'Enabled' field is defined as a string to support both literal booleans and template expressions. Consider adding an inline comment to clarify this design decision for future maintainers.
Enabled string   `yaml:"enabled,omitempty" json:"enabled,omitempty" jsonschema:"oneof_type=string;boolean"`

Copy link

cloudflare-workers-and-pages bot commented May 23, 2025

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: 936b187
Status: ✅  Deploy successful!
Preview URL: https://05a7533b.goreleaser.pages.dev
Branch Preview URL: https://sbom.goreleaser.pages.dev

View logs

@caarlos0 caarlos0 changed the title feat: sbom.enabled feat: sbom.disable May 23, 2025
Copy link

codecov bot commented May 24, 2025

Codecov Report

Attention: Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.93%. Comparing base (86126ab) to head (936b187).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/pipe/sbom/sbom.go 97.36% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5787   +/-   ##
=======================================
  Coverage   82.93%   82.93%           
=======================================
  Files         163      163           
  Lines       16292    16297    +5     
=======================================
+ Hits        13511    13516    +5     
  Misses       2190     2190           
  Partials      591      591           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caarlos0 caarlos0 merged commit 47f178c into main May 25, 2025
19 checks passed
@caarlos0 caarlos0 deleted the sbom branch May 25, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add sboms.enable
1 participant