Skip to content
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

Merged
merged 6 commits into from
Feb 3, 2025

Conversation

EthanMcQ-TMF
Copy link
Contributor

Fixes #5863

πŸ‘©πŸ»β€πŸ’» What does this PR do?

  • Add --overwrite / -o flag to upsert-json command. If used, overwrite any pre-existing reports.
  • Add new reload-embedded-reports command. Reloads the embedded reports and overwrites them in the database

πŸ’Œ Any notes for the reviewer?

πŸ§ͺ Testing

  • Run upsert-reports without -o flag, observe 0 reports updated
  • Run upsert-reports with -o flag, observe reports being updated
  • Run reload-embedded-reports, observe reports being updated

πŸ“ƒ Documentation

  • Additional command and flag are added to the usage/help text. Is there any extra docs needed considering this is a dev tool?

@github-actions github-actions bot added enhancement New feature or request Team Ruru πŸ¦‰ Roxy, Ferg, Noel feature: reports labels Jan 31, 2025
Copy link
Collaborator

@andreievg andreievg left a 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

@EthanMcQ-TMF
Copy link
Contributor Author

I just noticed that we don't error on UpsertReports and ReloadEmbeddedReports, I think we should.

@andreievg I'm sorry, error in what scenario exactly? This makes it sound like you want this feature to just always throw an error...

let connection_manager = get_storage_connection_manager(&settings.database);
let con = connection_manager.connection()?;

let _ = StandardReports::load_reports(&con, true);
Copy link
Collaborator

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")

Copy link
Collaborator

@andreievg andreievg left a 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

@EthanMcQ-TMF EthanMcQ-TMF merged commit 5e22ffe into develop Feb 3, 2025
2 checks passed
@EthanMcQ-TMF EthanMcQ-TMF deleted the 5863-overwrite-reports-flag branch February 3, 2025 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: reports Team Ruru πŸ¦‰ Roxy, Ferg, Noel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add overwrite flag to upsert json cli
2 participants