-
Notifications
You must be signed in to change notification settings - Fork 16
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
5863 Add overwrite flag to upsert json cli #6377
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.
This is great ! Thanks @EthanMcQ-TMF
I just noticed that we don't error on UpsertReports and ReloadEmbeddedReports, I think we should. I know it's not really part of this PR scope, but can you please add.
Is there any extra docs needed considering this is a dev tool?
There is this issue, can you please add comment: #5037
@andreievg I'm sorry, error in what scenario exactly? This makes it sound like you want this feature to just always throw an error... |
server/cli/src/cli.rs
Outdated
let connection_manager = get_storage_connection_manager(&settings.database); | ||
let con = connection_manager.connection()?; | ||
|
||
let _ = StandardReports::load_reports(&con, 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.
let _
basically discards the result.
Should be something like StandardReports::load_reports(&con, true)?
or StandardReports::load_reports(&con, true).expect("Failed to load reports")
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.
Thank you @EthanMcQ-TMF, looks great now
Fixes #5863
π©π»βπ» What does this PR do?
--overwrite / -o
flag toupsert-json
command. If used, overwrite any pre-existing reports.reload-embedded-reports
command. Reloads the embedded reports and overwrites them in the databaseπ Any notes for the reviewer?
π§ͺ Testing
upsert-reports
without-o
flag, observe 0 reports updatedupsert-reports
with-o
flag, observe reports being updatedreload-embedded-reports
, observe reports being updatedπ Documentation