Sync public tree to 8a8f27c
This commit is contained in:
parent
65ccb17519
commit
4e04601794
4 changed files with 44 additions and 3 deletions
|
|
@ -2238,6 +2238,8 @@ fn quota_status_report(args: QuotaStatusArgs, cwd: PathBuf) -> Result<Value> {
|
|||
"attached_nodes": attached_nodes,
|
||||
"task_events": task_events,
|
||||
"next_blocked_action": quota_next_blocked_action(¤t_usage),
|
||||
"quota_tier": "community tier",
|
||||
"community_tier_label": "community tier",
|
||||
"community_tier_language": true,
|
||||
"private_abuse_heuristics_exposed": false,
|
||||
}))
|
||||
|
|
@ -2474,6 +2476,7 @@ fn human_report(value: &Value) -> String {
|
|||
push_string_field(&mut lines, value, "node", "node");
|
||||
push_string_field(&mut lines, value, "artifact", "artifact");
|
||||
push_string_field(&mut lines, value, "entry", "entry");
|
||||
push_string_field(&mut lines, value, "quota_tier", "quota tier");
|
||||
push_string_field(&mut lines, value, "config_file", "config");
|
||||
push_string_field(&mut lines, value, "adapter", "adapter");
|
||||
|
||||
|
|
@ -2861,6 +2864,12 @@ fn push_machine_error_line(lines: &mut Vec<String>, machine_error: Option<&Value
|
|||
.and_then(Value::as_i64)
|
||||
.unwrap_or(1);
|
||||
lines.push(format!("error category: {category} (exit {exit_code})"));
|
||||
if let Some(tier) = machine_error
|
||||
.get("community_tier_label")
|
||||
.and_then(Value::as_str)
|
||||
{
|
||||
lines.push(format!("quota tier: {tier}"));
|
||||
}
|
||||
if let Some(next_actions) = machine_error.get("next_actions").and_then(Value::as_array) {
|
||||
let actions = next_actions
|
||||
.iter()
|
||||
|
|
@ -2976,6 +2985,7 @@ fn cli_error_summary_for_category(category: &'static str, message: &str) -> Valu
|
|||
),
|
||||
);
|
||||
object.insert("community_tier_language".to_owned(), json!(true));
|
||||
object.insert("community_tier_label".to_owned(), json!("community tier"));
|
||||
object.insert("private_abuse_heuristics_exposed".to_owned(), json!(false));
|
||||
}
|
||||
}
|
||||
|
|
@ -6005,7 +6015,15 @@ mod tests {
|
|||
if category == "quota" {
|
||||
assert_eq!(summary["resource_category"], "api_calls");
|
||||
assert_eq!(summary["community_tier_language"], true);
|
||||
assert_eq!(summary["community_tier_label"], "community tier");
|
||||
assert_eq!(summary["private_abuse_heuristics_exposed"], false);
|
||||
let rendered = human_report(&json!({
|
||||
"command": "run",
|
||||
"machine_error": summary,
|
||||
}));
|
||||
assert!(rendered.contains("quota tier: community tier"));
|
||||
let forbidden_tier = ["free", "tier"].join(" ");
|
||||
assert!(!rendered.to_ascii_lowercase().contains(&forbidden_tier));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8103,6 +8121,12 @@ mod tests {
|
|||
assert_eq!(status["current_usage"]["attached_nodes"], 0);
|
||||
assert_eq!(status["limits"]["artifact_download_bytes"], 268_435_456);
|
||||
assert_eq!(status["community_tier_language"], true);
|
||||
assert_eq!(status["quota_tier"], "community tier");
|
||||
assert_eq!(status["community_tier_label"], "community tier");
|
||||
let rendered = human_report(&status);
|
||||
assert!(rendered.contains("quota tier: community tier"));
|
||||
let forbidden_tier = ["free", "tier"].join(" ");
|
||||
assert!(!rendered.to_ascii_lowercase().contains(&forbidden_tier));
|
||||
assert_eq!(
|
||||
status["next_blocked_action"]["action"],
|
||||
"node_work_requires_online_attached_node"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue