-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add scanned_manifests_path metadata to snapshots #14406
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,9 +108,17 @@ def payload | |
| url: SNAPSHOT_DETECTOR_URL | ||
| }, | ||
| manifests: manifests, | ||
| # TODO: Move use of metadata to a Dependabot-specific object | ||
| # | ||
| # We are using the existing job metadata as a bag-of-values for error handling | ||
| # and job tracking that is specific to Dependabot-created submissions. | ||
| # | ||
| # In future, we should extend the public API schema with a validated object to | ||
| # harden this contract. | ||
| metadata: { | ||
| status: status.serialize, | ||
| reason: reason | ||
| reason: reason, | ||
| scanned_manifest_path: scanned_manifest_path | ||
| }.compact | ||
| } | ||
| end | ||
|
|
@@ -179,5 +187,16 @@ def manifests | |
| } | ||
| } | ||
| end | ||
|
|
||
| # Returns a synopsis of the scan performed in the format `ecosystem::manifest_path`, e.g. | ||
| # - `golang::/` | ||
| # - `rubygems::rails_app/` | ||
| # | ||
| sig do | ||
| returns(String) | ||
| end | ||
| def scanned_manifest_path | ||
| "#{GithubApi::EcosystemMapper.ecosystem_for(package_manager)}::#{File.dirname(manifest_file.path)}" | ||
| end | ||
|
Comment on lines
+191
to
+200
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💭 We could use the Rather than overload the responsibility of this value, which is firmly in the snapshot domain, with the requirement to track the job 'receipt' of a snapshot, let's keep these isolated. |
||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are tracking this internally, I'm just adding a note here to make sure we keep line of sight that using
metadataas a bag of values is something we will need to migrate off of in future.The values we store here are all of short-term relevant, e.g. they only matter to the actual POST request that submits the snapshot or for state reporting when this snapshot is on the tip of a branch so we don't need to worry about backfilling or handling historical values.