🐛 do not include asName when creating digest of FROM name as asName #4683
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.
What kind of change does this PR introduce?
(Is it a bug fix, feature, docs update, something else?)
bug fix
What is the current behavior?
When calculating the digest in remediation, Scorecard would do that from
python:3.7:build
when the line wasFROM python:3.7 as build
. This would lead to issues such as #2906.We are creating the digest on the following lines:
scorecard/remediation/remediations.go
Lines 105 to 113 in f96f4f4
From the PR, it should be clear that
d.PinnedAt
is assigned the wrong value; it gets assignedasPointer(asName)
which is the root cause of the bug.digester.Digest(name)
throws an error like:parsing reference "python:3.7:build": could not parse reference: python:3.7:build
because of this.What is the new behavior (if this is a feature change)?**
With this change, we create the digest from
python:3.7
in the same line as above.Which issue(s) this PR fixes
Fixes #2906
Special notes for your reviewer
Does this PR introduce a user-facing change?
NONE