-
Notifications
You must be signed in to change notification settings - Fork 593
🌱 Set OSV User-Agent for scorecard cli and cron workers. #4883
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: kash2104 <kparikh1104@gmail.com>
|
|
||
| "github.com/google/osv-scanner/pkg/osv" |
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.
this should be "github.com/google/osv-scanner/v2/pkg/osv"
| github.com/google/osv-scanner v1.9.2 | ||
| github.com/google/osv-scanner/v2 v2.2.4 |
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.
when you fix this import this accidental import of v1 should go away
| "fmt" | ||
| "log" | ||
|
|
||
| "github.com/google/osv-scanner/pkg/osv" |
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.
same comment about v2 import
|
|
||
| func main() { | ||
| info := version.GetVersionInfo() | ||
| osv.RequestUserAgent = fmt.Sprintf("scorecard-cron/%s", info.GitVersion) |
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.
you have scorecard-cron/ here too, which is a copy/paste error
What kind of change does this PR introduce?
This PR introduces improvement to OSV API request by configuring versioned User-Agent for Scorecard.
What is the current behavior?
Currently API requests to
osv.devare made without specifying a unique user-agent.What is the new behavior (if this is a feature change)?**
Now a distinct, versioned user agent is set for the OSV API request:
scorecard/{version}for CLIscorecard-cron/{version}for cron workersTests for the changes have been added (for bug fixes/features)
Which issue(s) this PR fixes
Fixes #4029
Special notes for your reviewer
osv-scanner/1.9.2has been installed.Does this PR introduce a user-facing change?
No
For user-facing changes, please add a concise, human-readable release note to
the
release-note(In particular, describe what changes users might need to make in their
application as a result of this pull request.)