Repository navigation
Conversation
Maps the OSV 'GitHub Actions' ecosystem to the 'github' PURL type, so packages such as 'actions/checkout' are rendered as 'pkg:github/actions/checkout' and parse back to the original name. Adds the mapping to both the Python helper (osv/purl_helpers.py) and the Go PURL registry (go/purl), plus unit tests for both directions. Refs google#2402
Collaborator
|
Please read our contributing guide before opening pull requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds the missing PURL conversion for the
GitHub ActionsOSV ecosystem.The checklist in #2402 still has
GitHub Actions(github?) unticked, and noPURL entry existed for it, so GitHub Actions advisories had no PURL
representation in the API output.
This change maps the ecosystem to the
githubPURL type, so a package such asactions/checkoutis rendered aspkg:github/actions/checkoutand parses backto the original
actions/checkoutname (with an optional version).Refs #2402
Details
osv/purl_helpers.py: add'GitHub Actions': EcosystemPURL('github', None)to
ECOSYSTEM_PURL_DATA, and allow thegithubPURL type to re-join thenamespace and name when parsing (
pkg:github/<owner>/<repo>).go/purl/ecosystems_simple.go: register the same mapping withregisterSlash(osvconstants.EcosystemGitHubActions, "github"), whichsplits the
owner/repopackage name into the PURL namespace and name andjoins them again when parsing.
osv/purl_helpers_test.pyandgo/purl/purl_test.go: unit tests forpackage-to-PURL and PURL-to-package in both directions.
Both implementations are covered so the Python library
(
osv/models.pyusespurl_helpers.package_to_purl) and the Go workerpipeline (
go/internal/worker/pipeline/purl) stay consistent.Testing
python3 -m unittest osv.purl_helpers_test(3 tests, OK)go test ./purl/ingo/(ok)gofmtapplied to the modified Go filesNote
This contribution is AI-assisted: the change was drafted by an AI agent and
reviewed by the human submitter.