Skip to content

Add "fail" compliance action, fixes #4388 - #4560

Closed
zilosz wants to merge 12 commits into
anchore:mainfrom
zilosz:compliance-fail
Closed

Add "fail" compliance action, fixes #4388#4560
zilosz wants to merge 12 commits into
anchore:mainfrom
zilosz:compliance-fail

Conversation

@zilosz

@zilosz zilosz commented Jan 19, 2026

Copy link
Copy Markdown

Description

Fixes #4388

Adds a fail compliance action for missing package names and versions. When configured, Syft will throw an error and abort the SBOM generation process instead of continuing.

In addition to existing actions, the missing-name and missing-version config options under compliance now accept fail (with alias error).

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Signed-off-by: zilosz <mfecko@purdue.edu>
@kzantow

kzantow commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Based on the discussions we've had about this one, I think we should update the python cataloger to fix the bug where it's not returning packages without versions, so these can be later handled by the compliance rules. If we update this PR with that one known issue, I think it solves the problem raised in the issue #4388, and we can have follow-on issues for any other catalogers we might find that didn't properly get updated for compliance handling.

There was further discussion about packages without names, but I think this is still an "it depends on the cataloger" decision: if we can give the user enough information to determine where this completely blank package came from where we were actually expecting a package name, we should probably return it, which for JSON might require a future go version with stdlib's JSON v2 to return file and line numbers. Other things like a blank line in requrements.txt probably shouldn't qualify for this as an example. For these other changes, they should probably be follow-ons also, not part of this PR.

Let me know if any of that is unclear; I think the python change mostly solves your use case, as I understood it.

@zilosz

zilosz commented Feb 4, 2026

Copy link
Copy Markdown
Author

For now, I've just modified the requirements.txt parser to emit packages with missing versions, since that's what the original issue focused on. I did notice that other Python parsers such as parse_setup.go also explicitly handle missing versions instead of emitting full packages, so perhaps I could fix that in another PR. I also think it would be a good idea to fix other catalogers through separate issues.

@oss-housekeeper oss-housekeeper Bot added the needs-manual-review automated action that should be reviewed by a human label Aug 26, 2026

@oss-housekeeper oss-housekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Changes github configuration or dependencies — this requires manual review from @anchore/tools

No action from the PR author is needed.

Guarded files touched in this PR:

  • .github/actions/bootstrap/action.yaml (sha: 6e8aa90ef8af3e0af7d5cbca143566ad486fe601)

This review disposition can be dismissed after manual review.

zilosz and others added 11 commits August 26, 2026 15:00
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: spiffcs <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: spiffcs <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: willmurphyscode <12529630+willmurphyscode@users.noreply.github.com>
Signed-off-by: zilosz <mfecko@purdue.edu>
* chore: new slack action

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>

* TEMP: exit 1 to test slack notify

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>

* new slack integration everywhere

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>

---------

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
Signed-off-by: zilosz <mfecko@purdue.edu>
* ci: enable zizmor to fail PRs

Enable zizmor (gh actions yaml linter) to fail builds in PRs. Fix any
outstanding linting errors found by this tool.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>

* fix outdated version comments

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>

---------

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
Signed-off-by: zilosz <mfecko@purdue.edu>
Bumps the go-minor-patch group with 1 update in the / directory: [github.com/spdx/tools-golang](https://github.com/spdx/tools-golang).

Updates `github.com/spdx/tools-golang` from 0.5.6 to 0.5.7
- [Release notes](https://github.com/spdx/tools-golang/releases)
- [Changelog](https://github.com/spdx/tools-golang/blob/main/RELEASE-NOTES.md)
- [Commits](spdx/tools-golang@v0.5.6...v0.5.7)

---
updated-dependencies:
- dependency-name: github.com/spdx/tools-golang
  dependency-version: 0.5.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: zilosz <mfecko@purdue.edu>
Signed-off-by: zilosz <mfecko@purdue.edu>
@oss-housekeeper oss-housekeeper Bot added binny dealing with management of binary tools via binny dependencies dealing with project dependencies labels Aug 26, 2026
@zilosz

zilosz commented Aug 26, 2026

Copy link
Copy Markdown
Author

I worked on this PR for the first time in a while and ended up polluting the commit history. Cleaner PR is now #5231

@zilosz

zilosz commented Aug 26, 2026

Copy link
Copy Markdown
Author

Closing now.

@zilosz zilosz closed this Aug 26, 2026
@zilosz
zilosz deleted the compliance-fail branch August 26, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

binny dealing with management of binary tools via binny dependencies dealing with project dependencies needs-manual-review automated action that should be reviewed by a human

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report an error result when packages found without version

3 participants