Skip to content

Add task suite management endpoints and client#234

Open
un-lock-able wants to merge 5 commits into
devfrom
suite-manage
Open

Add task suite management endpoints and client#234
un-lock-able wants to merge 5 commits into
devfrom
suite-manage

Conversation

@un-lock-able

@un-lock-able un-lock-able commented Jul 22, 2026

Copy link
Copy Markdown

No description provided.

@un-lock-able
un-lock-able requested a review from BobAnkh July 22, 2026 08:54

@BobAnkh BobAnkh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the internal handling of requests in the coordinator side (code under service), I haven't reviewed them all. I think we shall discuss and decide on other things first and then we review the service code (because they are likely correct and we only need to check if we have better, more efficient and more human-readable way to write our code).

#[arg(short = 'g', long = "group")]
pub group_name: Option<String>,
/// The UUID of the task suite to submit this task to. When set, the task is executed
/// by the suite's agents instead of traditional workers, and inherits the suite's tags.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not talking about tags here. It is much more complicated than this simple expressions.

Comment thread netmito/src/api/suites.rs
.route("/{uuid}/close", post(close_suite))
.route("/{uuid}/agents/include", post(include_suite_agents))
.route("/{uuid}/agents/exclude", post(exclude_suite_agents))
.route("/{uuid}/agents/reset", post(reset_suite_agent))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shall not use reset, maybe refresh? Also make all service function names more understandable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using clear?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, what is this api doing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This api removes the user's manual exclusion/includsion of the agent to suite so that the agent's eligibility of executing the suite will be determined by the tagmatching mechanism again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, our API has some gaps. We let user to include/exlclude agent to a suite's execution list, but user can only remove them all. We should also have a remove api for that operation and that api plays a roll of removing all the relations. So you can name the two APIs from that perspective.

Comment thread netmito/src/client/interactive.rs
Comment thread netmito/src/schema/suite.rs
Comment thread netmito/src/schema/suite.rs
Comment on lines +221 to +226
/// Response for the reset-override endpoint.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ResetSuiteAgentResp {
/// Whether a manual override existed and was cleared (false = nothing to reset).
pub reset: bool,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this response mean?

Comment thread netmito/src/client/mod.rs
if verbose {
output_suite_list_info(&suite);
} else {
tracing::info!("{} ({})", suite.uuid, suite.state);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More summary information should be given in this one-line non-verbose output.

Comment on lines +165 to +166
return Err(Error::Custom("send register worker failed".to_string()));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we make these big changes? it seems only add one where clause.


// Suite-bound submission: assign the task to the suite, bump its counters and reopen
// it if needed.
if let Some(suite_uuid) = suite_uuid {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just do a match here to separate two kinds of tasks? Also, is there anything in common so that we can have some code reused?

let labels = Vec::from_iter(labels);
let task = pool
.db
.transaction::<_, ActiveTasks::Model, crate::error::Error>(|txn| {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transaction should be further optimized to make it more understandable and efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants