refactor: remove hyperhive.role option — there is only one role: agent

This commit is contained in:
damocles 2026-06-04 12:40:24 +02:00 committed by mara
commit 41eb3f806c
23 changed files with 105 additions and 229 deletions

View file

@ -54,21 +54,13 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
/// Submit a review event (APPROVED / REQUEST_CHANGES / COMMENT) and print
/// a compact summary of the created review.
fn submit_review(
client: &Client,
number: u64,
event: &str,
body: Option<String>,
) -> Result<()> {
fn submit_review(client: &Client, number: u64, event: &str, body: Option<String>) -> Result<()> {
let repo = client.repo();
let payload = json!({
"event": event,
"body": body.unwrap_or_default(),
});
let v = client.post_json(
&format!("/repos/{repo}/pulls/{number}/reviews"),
&payload,
)?;
let v = client.post_json(&format!("/repos/{repo}/pulls/{number}/reviews"), &payload)?;
print_json(&json!({
"id": v.get("id"),
"state": v.get("state"),
@ -81,7 +73,9 @@ fn submit_review(
/// gracefully.
fn fetch_inline_comments(client: &Client, repo: &str, pr: u64, review_id: u64) -> Vec<Value> {
client
.get_json(&format!("/repos/{repo}/pulls/{pr}/reviews/{review_id}/comments"))
.get_json(&format!(
"/repos/{repo}/pulls/{pr}/reviews/{review_id}/comments"
))
.ok()
.and_then(|v| v.as_array().cloned())
.unwrap_or_default()
@ -100,12 +94,7 @@ fn list_reviews(client: &Client, number: u64) -> Result<()> {
}
/// JSON output: one object per review, with an inline `comments` array.
fn list_reviews_json(
client: &Client,
repo: &str,
number: u64,
reviews: &[Value],
) -> Result<()> {
fn list_reviews_json(client: &Client, repo: &str, number: u64, reviews: &[Value]) -> Result<()> {
let trimmed: Vec<Value> = reviews
.iter()
.map(|r| {
@ -140,12 +129,7 @@ fn list_reviews_json(
/// Human-readable output: Markdown-style heading per review, inline
/// comments as `[path:line] body` (line omitted for PR-level comments).
fn list_reviews_text(
client: &Client,
repo: &str,
number: u64,
reviews: &[Value],
) -> Result<()> {
fn list_reviews_text(client: &Client, repo: &str, number: u64, reviews: &[Value]) -> Result<()> {
if reviews.is_empty() {
println!("(no reviews)");
return Ok(());