Skip to content
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

Add flags to update cpe & purl #112

Merged
merged 1 commit into from Dec 2, 2021
Merged

Add flags to update cpe & purl #112

merged 1 commit into from Dec 2, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Dec 1, 2021

Summary

  • adds flags for updating cpes, --cpe and --cpe-pattern. The command will do a replace-all on each CPE with the given pattern, inserting the cpe value if found.
  • adds flags for updating purl, --purl and --purl-pattern. The command will do a relpace-all on the PURL with the given pattern, inserting the purl value if found.
  • if flags are not set, they will default to --version and --version-pattern. This is generally the behavior that is required, so most of the time the additonal flags won't be needed.
  • adds test to validate that version, cpe and purl can be updated independently.

Use Cases

With the introduction of CPEs and PURL to dependency metadata, we need a way to update this metadata since it almost always includes the version number in it.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

- adds flags for updating cpes, `--cpe` and `--cpe-pattern`. The command will do a replace-all on each CPE with the given pattern, inserting the cpe value if found.
- adds flags for updating purl, `--purl` and `--purl-pattern`. The command will do a relpace-all on the PURL with the given pattern, inserting the purl value if found.
- if flags are not set, they will default to `--version` and `--version-pattern`. This is generally the behavior that is required, so most of the time the additonal flags won't be needed.
- adds test to validate that version, cpe and purl can be updated independently.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@dmikusa dmikusa added type:enhancement A general enhancement semver:minor A change requiring a minor version bump labels Dec 1, 2021
@dmikusa dmikusa requested a review from a team December 1, 2021 21:01
dmikusa pushed a commit to paketo-buildpacks/pipeline-builder that referenced this pull request Dec 2, 2021
- Prior to this PR, CPE & PURL metadata would not be updated in PRs that are generated to bump a dependency version
- This PR allows the update job to bump the CPE & PURL as well as the version. This requires paketo-buildpacks/libpak#112.
- For this to work, actions don't need to be updated. The default values will use the same pattern for version, CPE & PURL. This works for the majority of actions.
- It doesn't work for JVM related actions. This is because Java 8 has a one-off CPE format. This is being supported by modifying the actions for JVMs such that they also output a CPE. This needs to be paired with a CPE Pattern, which would be specified in the pipeline-descriptor.yml file.
- This PR also modifies the descriptor such that you can set the cpe and purl pattern.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@dmikusa dmikusa merged commit 0d83883 into main Dec 2, 2021
@dmikusa dmikusa deleted the update-cpe-purl branch December 2, 2021 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant