Skip to content

Conversation

@lucperkins
Copy link
Member

@lucperkins lucperkins commented Oct 9, 2025

Currently this returns the bare minimum for a release:

{
  "Version": "1.2.3"
}

Now it's more robust but without including almost always duplicated fields like description, readme, and total.

{
  "simplified_version": "0.1.25",
  "version": "0.1.25",
  "revision": "e3b574c59803ee6b240b6a92b7ebb41a51d8cbcc",
  "published_at": "2025-08-06T01:15:25.753285Z",
  "updated_at": "2025-08-06T01:15:25.668616Z",
  "commit_count": 745
}

Summary by CodeRabbit

  • New Features

    • Release listing shows additional columns: simplified version, revision, published/updated timestamps, and commit count.
  • Improvements

    • Consistent table/JSON/CSV output for release listings.
    • Better handling and display of optional fields with dimmed formatting; improved table/color rendering.
  • Chores

    • Package bumped to 0.1.26.
    • Dependency feature refinements (time, CLI, error reporting, table rendering) and one unused dependency removed.
    • CI workflows: updated job permissions for token and repo read access.

@coderabbitai
Copy link

coderabbitai bot commented Oct 9, 2025

Walkthrough

Bumps crate version and updates multiple Cargo dependency signatures (features/default-features and one removal); replaces CLI list row types with a Tabled-backed Release including optional datetimes and commit count; and normalizes/adds permissions blocks in several GitHub Actions workflows.

Changes

Cohort / File(s) Summary
Version & dependencies
Cargo.toml
Bump package 0.1.25 → 0.1.26; add default-features = false to axum (in both [dependencies] and [dev-dependencies]); set chrono to default-features = false and add serde to features; add error-context into clap features and set default-features = false; add issue-url to color-eyre features; remove http-body-util; set tabled to default-features = false with features ["color","derive"].
CLI list display model
src/cli/cmd/list.rs
Replace ReleaseRow mapping with #[derive(Tabled, Deserialize, Serialize)] Release containing simplified_version, version, revision, published_at: Option<DateTime<Utc>>, updated_at: Option<DateTime<Utc>>, commit_count: Option<i64>; add tabled_opt_dim helper; import chrono::{DateTime, Utc}; render Vec<Release> directly for table/JSON/CSV.
GitHub Actions workflow permissions
.github/workflows/build.yml, .../nix.yml, .../rust.yml, .../update-flake-lock.yaml
Normalize quoted permission values to unquoted ("write"write, "read"read) and add/align permissions blocks on specified jobs (granting id-token: write and contents: read where added). No step/control-flow changes.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI as "cli::cmd::list"
  participant Tabled as "tabled renderer"
  participant Chrono as "chrono::DateTime<Utc>"

  User->>CLI: run list command
  CLI->>CLI: collect Release items (fields incl. optional datetimes)
  CLI->>Tabled: pass Vec<Release>
  Tabled->>Chrono: request formatting for Option<DateTime<Utc>>
  Chrono-->>Tabled: formatted date or empty
  Tabled-->>User: render table / JSON / CSV
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

I nibble logs and tidy rows,
Versions hop where bold text grows.
Serde threads the time and place,
Dates glow faint with gentle grace.
A rabbit cheers — the list finds pace. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Make fh list releases more granular" directly aligns with the stated PR objectives, which focus on expanding the fh list releases output from minimal information to include additional fields like simplified_version, revision, published_at, updated_at, and commit_count. The title is specific to the command being modified, uses clear terminology that accurately describes the change, and concisely captures the main intent of the changeset. The code changes in src/cli/cmd/list.rs confirm this objective by expanding the Release struct with new fields and adjusting the rendering logic, which constitutes the primary change in this PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fh-list-info

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b4ed35 and 1abf4b2.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • src/cli/cmd/list.rs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/cli/cmd/list.rs (1)
src/cli/cmd/mod.rs (2)
  • releases (145-153)
  • print_json (316-320)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-artifacts (aarch64-linux, namespace-profile-default-arm64, fh-X64-Linux)
  • GitHub Check: build-artifacts (x86_64-linux, ubuntu-22.04, fh-ARM64-linux)
  • GitHub Check: build-artifacts (aarch64-darwin, macos-latest-xlarge, fh-ARM64-macOS)
  • GitHub Check: build-artifacts (x86_64-darwin, macos-14-large, fh-X64-macOS)
  • GitHub Check: rust-fmt-and-clippy
🔇 Additional comments (4)
src/cli/cmd/list.rs (4)

1-1: LGTM!

The chrono import is necessary for the new DateTime<Utc> fields in the Release struct.


108-113: LGTM!

The helper function correctly renders Option<T> values with appropriate styling. The implementation is clean and follows the same pattern as the bold and dimmed helpers.


266-287: LGTM!

The refactored releases handling correctly uses the Release struct directly for all output formats (JSON, table, CSV). The logic is clean and follows the established pattern used by other subcommands in this file.


91-105: Verify the API response field names and format match the Release struct exactly.

The Release struct has no #[serde(rename = "...")] attributes, so serde uses field names as-is. The API response must use exact snake_case matching: simplified_version, version, revision, published_at, updated_at, commit_count. If the backend uses camelCase or different names, deserialization will fail at runtime.

Additionally, verify:

  • DateTime<Utc> deserializes correctly (chrono expects ISO 8601 format)
  • Optional fields (published_at, updated_at, commit_count) are nullable/omittable in the API response

No test fixtures or API documentation were found in the codebase to validate this contract. Manually confirm the API schema before merging.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lucperkins lucperkins enabled auto-merge October 9, 2025 18:33
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/cli/cmd/list.rs (3)

91-105: Ensure API field names match — otherwise deserialization will fail.

Release now (de)serializes directly. If the FlakeHub API uses different casing (e.g., camelCase), add appropriate serde renames or a struct-level #[serde(rename_all = "...")].

If you require RFC3339 for JSON, add per-field helpers, e.g., #[serde(with = "chrono::serde::ts_rfc3339::option")] for published_at/updated_at. Based on learnings


107-114: Optional: include timezone indicator in formatted timestamps.

Current table output omits ‘Z/UTC’. Consider appending “Z” or using RFC3339 for clarity.


251-267: Output routing is correct; verify default CSV headers align with Release fields

  • JSON prints raw Release via serde.
  • TTY → table; non-TTY → CSV matches other commands.
  • If header stability matters, confirm csv::Writer’s default header names/order.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3abaad4 and 883a0f7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (1 hunks)
  • src/cli/cmd/list.rs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/cli/cmd/list.rs (1)
src/cli/cmd/mod.rs (2)
  • releases (133-136)
  • print_json (295-299)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-artifacts (x86_64-darwin, macos-14-large, fh-X64-macOS)
  • GitHub Check: build-artifacts (x86_64-linux, ubuntu-22.04, fh-ARM64-linux)
  • GitHub Check: build-artifacts (aarch64-darwin, macos-latest-xlarge, fh-ARM64-macOS)
  • GitHub Check: build-artifacts (aarch64-linux, namespace-profile-default-arm64, fh-X64-Linux)
  • GitHub Check: rust-fmt-and-clippy
🔇 Additional comments (4)
Cargo.toml (2)

3-3: Patch version bump looks good.

No concerns.


11-14: Enabling chrono’s serde is the right move for DateTime fields.

Confirm downstream expects the chosen JSON date format (Chrono default). If a specific format is required (e.g., RFC3339), consider adding explicit serde helpers at the field sites.

Based on learnings

src/cli/cmd/list.rs (2)

1-1: Chrono import aligns with new DateTime fields.

Good addition.


115-120: Helper looks fine.

Returns dimmed text for Some and empty for None — OK.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/cli/cmd/list.rs (1)

108-112: Keep the timezone in release timestamps.

Formatting with %Y-%m-%d %H:%M drops the UTC suffix, so the table output looks like local time while the JSON still advertises Z. Keeping the zone avoids confusion.

-        Some(dt) => dt.format("%Y-%m-%d %H:%M").to_string(),
+        Some(dt) => dt.format("%Y-%m-%d %H:%M %Z").to_string(),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3abaad4 and cdc033a.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (1 hunks)
  • src/cli/cmd/list.rs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/cli/cmd/list.rs (1)
src/cli/cmd/mod.rs (2)
  • releases (133-136)
  • print_json (295-299)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-artifacts (x86_64-linux, ubuntu-22.04, fh-ARM64-linux)
  • GitHub Check: build-artifacts (x86_64-darwin, macos-14-large, fh-X64-macOS)
  • GitHub Check: build-artifacts (aarch64-linux, namespace-profile-default-arm64, fh-X64-Linux)
  • GitHub Check: rust-fmt-and-clippy
  • GitHub Check: build-artifacts (aarch64-darwin, macos-latest-xlarge, fh-ARM64-macOS)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/cli/cmd/list.rs (1)

108-113: Consider preserving timezone in formatted timestamps.
Line 110 formats timestamps as %Y-%m-%d %H:%M, dropping seconds and the UTC designator. For global release data, including the timezone (e.g., via dt.to_rfc3339() or %Z) would make it clearer that the values are UTC.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3abaad4 and 47b37ed.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (1 hunks)
  • src/cli/cmd/list.rs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/cli/cmd/list.rs (1)
src/cli/cmd/mod.rs (2)
  • releases (133-136)
  • print_json (295-299)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-artifacts (x86_64-darwin, macos-14-large, fh-X64-macOS)
  • GitHub Check: build-artifacts (aarch64-linux, namespace-profile-default-arm64, fh-X64-Linux)
  • GitHub Check: build-artifacts (x86_64-linux, ubuntu-22.04, fh-ARM64-linux)
  • GitHub Check: build-artifacts (aarch64-darwin, macos-latest-xlarge, fh-ARM64-macOS)
  • GitHub Check: rust-fmt-and-clippy

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.

1 participant