-
Notifications
You must be signed in to change notification settings - Fork 258
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
feat: add state reconciliation admin cmds #1965
base: main
Are you sure you want to change the base?
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.
PR Summary
Added new admin CLI commands for managing deployed projects and reconciling project states with ECS.
- Added
DeployedProjects
command inadmin/src/args.rs
to fetch all deployed projects - Added
ReconcileState
command inadmin/src/args.rs
to reconcile project state with ECS state - Potential code duplication between
get_all_deployed_projects()
andget_projects()
inclient.rs
as they hit same endpoint with different return types
3 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
pub async fn reconcile_state(&self, project_id: &str) -> Result<serde_json::Value> { | ||
let path = format!("/admin/projects/reconcile/{project_id}"); | ||
self.inner.post_json(&path, Option::<()>::None).await | ||
} |
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.
style: Consider using a more specific return type than serde_json::Value to ensure type safety at compile time
@@ -121,6 +130,10 @@ pub async fn run(args: Args) { | |||
.unwrap(); | |||
println!("{res:?}"); | |||
} | |||
Command::ReconcileState { project_id } => { | |||
let res = client.reconcile_state(&project_id).await.unwrap(); |
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.
logic: Using unwrap() here could cause panic if API call fails. Consider adding error context like other commands do with expect()
let path = format!("/admin/projects"); | ||
self.inner.get_json(&path).await | ||
} |
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.
style: format! is unnecessary here since no string interpolation is being done
Description of change
Add commands to admin CLI for new admin endpoints.
How has this been tested? (if applicable)
Tested in dev environment.