-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(cli): Add available version checking #8553
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
Conversation
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.
@owenrumney left comments.
Take a look, please.
Also I think update
is not a very good name for this logic.
Maybe something like notification
?
UPD:
and I would also think about how we can inform users about the ---no-notises flag
4a269dd
to
be383c3
Compare
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.
LGTM. I left small comments.
9c714fb
to
f21196a
Compare
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.
I think we also need to create a new page for privacy. @itaysk should know some examples from other OSS projects.
if !v.skipUpdateCheck && !v.quiet { | ||
v.responseReceived = true | ||
} | ||
v.done = true |
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.
Where is this used?
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.
It's actually only used in the test at the moment to know when the process is completed
67acb5e
to
5152ff5
Compare
yes I already have a draft for a dedicated doc, wasn't sure if we want it in the same PR or not. actually I'll try to add it to this one. (ps i don't think the doc should include referenences from other products) |
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.
LGTM!
I'm fine with updating the documentation either in this PR or in a separate one, as long as it gets updated before the next release—so I'll approve this PR.
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.
LGTM. Left a small comment
I may have some more comment after writing the doc, so don't merge it yet please |
929742f
to
bd1feb4
Compare
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.
LGTM
left small comments
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.
LGTM
left small comments
- Update the preRun and postRun to check and print the latest version - Run in a go routine so as not to interfere or slow the normal flow - Provide new `--no-notices` flag to prevent notice checking, same if they `-q/--quiet` flag is used - Add tests for the identifier and the check logic
- change no-notices flag to `skip-version-check` and add `disable-metrics` flag - create VersionChecker type and add to runner - if the flag conditions are met, create a new checker and trigger check - handle logic of flags for disabling metrics - update the tests
Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
Remove the -x prefix as per RFC6648. While headers are case-insensitve, making custom headers title case as per general convention. Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
- update the URL to check.trivy.cloud/updates - change the flag to disable-telemetry - update tests Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
offline scan isn't to be included at the moment, this will be tackled as a different piece of work. tidied up the notices option to be more consistent with the flag it reflects Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
…ents Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
- add support for different formats of date time from the service Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
52162e0
to
c6f5d66
Compare
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.
lgtm, left a small comment.
Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com>
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.
LGTM
@itaysk Can we merge this PR? |
Description
Adds a background check to
https://api.trivy.cloud/check
to see if there is new version or any relevant notices available.The check will be suppressed if the user uses the
--no-notices
or--quiet
envvars or flags. The docs have been updated with the new notices flagExample output
Although the image shows dummy versions, the api has been updated to reflect the correct information and has no announcements at this time... just the latest version (0.60.0)
Related issues
Checklist