Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(picker): abbreviate a PR's commits with git, not a fixed 8 (#3677)

Maximilian Roosbfbc2e28998c
diff --git a/src/commands/config/state.rs b/src/commands/config/state.rs
index b1584c79e..eb37dc96d 100644
--- a/src/commands/config/state.rs
+++ b/src/commands/config/state.rs
@@ -1503,6 +1503,13 @@ fn render_ci_status_section(out: &mut String, repo: &Repository) -> anyhow::Resu
} else if entries.is_empty() {
writeln!(out, "{}", format_with_gutter("(no entries)", None))?;
} else {
+ // The Head column is here to be eyeballed against the branch's current
+ // head, so it abbreviates to the width git uses — `core.abbrev`, the
+ // same width `wt list`'s Commit cell and the statusline print. One
+ // probe covers every row: `short_sha` per entry would be a `git
+ // rev-parse` fork apiece, and a repo with a cache entry per branch
+ // turned this dump from 26 ms into 267 ms at 50 entries.
+ let abbrev = repo.abbrev_len();
let rows: Vec<Vec<String>> = entries
.iter()
.map(|cached| {
@@ -1514,7 +1521,7 @@ fn render_ci_status_section(out: &mut String, repo: &Repository) -> anyhow::Resu
None => "none".to_string(),
};
let age = format_relative_time_short(cached.checked_at as i64);
- let head: String = cached.head.chars().take(8).collect();
+ let head: String = cached.head.chars().take(abbrev).collect();
vec![cached.branch.clone(), status, age, head]
})
.collect();
diff --git a/src/commands/picker/prs.rs b/src/commands/picker/prs.rs
index 4f48fa862..bb06af377 100644
--- a/src/commands/picker/prs.rs
+++ b/src/commands/picker/prs.rs
@@ -934,9 +934,11 @@ fn fetch_forge_json(
/// view <n> --json commits` (GitHub) or `glab api
/// projects/:fullpath/merge_requests/<n>/commits` (GitLab). That path renders a
/// flat `git log --oneline`-style list — no graph or merge-base coloring, since
-/// the objects aren't present to compute them. `glab`'s `--paginate` follows
-/// every page so a long PR isn't capped at GitLab's default page size, matching
-/// `gh`'s complete `--json` result.
+/// the objects aren't present to compute them. Their SHAs still read at the
+/// local repo's own abbreviation width ([`Repository::abbrev_len`]), so fetching
+/// the PR doesn't change how wide its commits print. `glab`'s `--paginate`
+/// follows every page so a long PR isn't capped at GitLab's default page size,
+/// matching `gh`'s complete `--json` result.
fn compute_pr_log(
repo: &Repository,
kind: RefType,
@@ -960,10 +962,11 @@ fn compute_pr_log(
&["pr", "view", &number, "--json", "commits"],
&["api", "--paginate", &endpoint],
)?;
- match kind {
- RefType::Pr => render_github_commits(&stdout, width),
- RefType::Mr => render_gitlab_commits(&stdout, width),
- }
+ let commits = match kind {
+ RefType::Pr => parse_github_commits(&stdout)?,
+ RefType::Mr => parse_gitlab_commits(&stdout)?,
+ };
+ Some(render_commit_lines(&commits, repo.abbrev_len(), width))
}
/// Render the local `git log` for `oid` when it's present in the object store,
@@ -1009,39 +1012,39 @@ struct GhCommit {
message_headline: String,
}
-/// Map `gh pr view <n> --json commits` to the `log` pane. gh returns commits
-/// oldest-first; the log reads newest-first like `git log`, so reverse.
-fn render_github_commits(stdout: &[u8], width: usize) -> Option<String> {
+/// Parse `gh pr view <n> --json commits` into the `log` pane's `(full SHA,
+/// subject)` pairs. gh returns commits oldest-first; the log reads newest-first
+/// like `git log`, so reverse.
+fn parse_github_commits(stdout: &[u8]) -> Option<Vec<(String, String)>> {
let parsed: GhCommitsResponse = serde_json::from_slice(stdout).ok()?;
- let lines: Vec<(String, String)> = parsed
- .commits
- .into_iter()
- .rev()
- .map(|c| (short_hash(&c.oid), c.message_headline))
- .collect();
- Some(render_commit_lines(&lines, width))
+ Some(
+ parsed
+ .commits
+ .into_iter()
+ .rev()
+ .map(|c| (c.oid, c.message_headline))
+ .collect(),
+ )
}
#[derive(Deserialize)]
struct GlabCommit {
#[serde(default)]
- short_id: String,
+ id: String,
#[serde(default)]
title: String,
}
-/// Map `glab api …/merge_requests/<n>/commits` to the `log` pane. GitLab's
-/// commits endpoint returns newest-first already, so keep the order.
-fn render_gitlab_commits(stdout: &[u8], width: usize) -> Option<String> {
+/// Parse `glab api …/merge_requests/<n>/commits` into the `log` pane's `(full
+/// SHA, subject)` pairs. GitLab's commits endpoint returns newest-first already,
+/// so keep the order. Each entry also carries a ready-abbreviated `short_id`,
+/// which this deliberately ignores in favor of `id`: that field is the
+/// *server's* abbreviation, blind to the reader's `core.abbrev`, and taking it
+/// would print a GitLab MR's commits at a different width from a GitHub PR's
+/// and from every other SHA `wt` renders.
+fn parse_gitlab_commits(stdout: &[u8]) -> Option<Vec<(String, String)>> {
let commits: Vec<GlabCommit> = serde_json::from_slice(stdout).ok()?;
- let lines: Vec<(String, String)> = commits.into_iter().map(|c| (c.short_id, c.title)).collect();
- Some(render_commit_lines(&lines, width))
-}
-
-/// Abbreviate a full commit hash to the conventional short form. GitLab already
-/// supplies a `short_id`; GitHub's `oid` is the full SHA.
-fn short_hash(oid: &str) -> String {
- oid.chars().take(8).collect()
+ Some(commits.into_iter().map(|c| (c.id, c.title)).collect())
}
/// Render a `git log --oneline`-style list for the `log` pane: a dim short hash,
@@ -1050,13 +1053,22 @@ fn short_hash(oid: &str) -> String {
/// with no commits the API returned) renders an info line so `spawn_compute`
/// caches a terminal value rather than leaving the slot empty (an empty string
/// is skipped, which would keep the loading placeholder).
-fn render_commit_lines(commits: &[(String, String)], width: usize) -> String {
+///
+/// `commits` holds full SHAs — the forge's own — and `abbrev` is the local
+/// repo's abbreviation width from [`Repository::abbrev_len`], so the same commit
+/// reads at the same width here as in the rich local `log` tab this pane stands
+/// in for, in `wt list`, and in the statusline. Truncating is the whole of the
+/// abbreviation: this path runs precisely because the PR's head isn't in the
+/// local object store (see [`compute_pr_log`]), so there are no objects for git
+/// to abbreviate these commits against one by one.
+fn render_commit_lines(commits: &[(String, String)], abbrev: usize, width: usize) -> String {
let reset = Reset;
if commits.is_empty() {
return cformat!("{INFO_SYMBOL}{reset} No commits\n");
}
let mut out = String::new();
- for (short, headline) in commits {
+ for (oid, headline) in commits {
+ let short: String = oid.chars().take(abbrev).collect();
let budget = width.saturating_sub(short.width() + 2).max(8);
let headline = crate::display::truncate_to_width(headline, budget);
out.push_str(&cformat!("<dim>{short}</>{reset} {headline}\n"));
@@ -2012,51 +2024,82 @@ mod tests {
}
#[test]
- fn render_github_commits_oneline_newest_first() {
+ fn parse_github_commits_is_newest_first() {
// gh returns commits oldest-first; the `log` pane shows them
- // newest-first like `git log`, with a dim 8-char short hash.
+ // newest-first like `git log`.
let json = br#"{"commits":[
{"oid":"aaaaaaaa0000000000000000000000000000aaaa","messageHeadline":"older change"},
{"oid":"bbbbbbbb1111111111111111111111111111bbbb","messageHeadline":"newer change"}
]}"#;
- let out = plain(&render_github_commits(json, 80).unwrap());
- assert!(
- out.find("bbbbbbbb").unwrap() < out.find("aaaaaaaa").unwrap(),
- "newest-first: {out:?}"
+ let commits = parse_github_commits(json).unwrap();
+ assert_eq!(
+ commits,
+ vec![
+ (
+ "bbbbbbbb1111111111111111111111111111bbbb".to_string(),
+ "newer change".to_string()
+ ),
+ (
+ "aaaaaaaa0000000000000000000000000000aaaa".to_string(),
+ "older change".to_string()
+ ),
+ ]
);
- assert!(out.contains("newer change") && out.contains("older change"));
- // Hash abbreviated to 8 chars, not the full 40.
- assert!(!out.contains("bbbbbbbb1"), "short hash only: {out:?}");
}
#[test]
- fn render_gitlab_commits_keeps_order_and_uses_short_id() {
- // GitLab's commits endpoint returns newest-first already, and supplies a
- // ready `short_id`, so the order is preserved as-is.
+ fn parse_gitlab_commits_keeps_order_and_takes_the_full_id() {
+ // GitLab's commits endpoint returns newest-first already, so the order
+ // is preserved as-is. Its ready-abbreviated `short_id` is the server's
+ // width, not the reader's, so the parse takes `id` — the full SHA — and
+ // leaves abbreviating to `render_commit_lines`.
let json = br#"[
- {"short_id":"deadbeef","title":"newer change"},
- {"short_id":"cafef00d","title":"older change"}
+ {"id":"deadbeef2222222222222222222222222222dead","short_id":"deadbeef","title":"newer change"},
+ {"id":"cafef00d3333333333333333333333333333cafe","short_id":"cafef00d","title":"older change"}
]"#;
- let out = plain(&render_gitlab_commits(json, 80).unwrap());
- assert!(out.contains("deadbeef") && out.contains("newer change"));
- assert!(
- out.find("deadbeef").unwrap() < out.find("cafef00d").unwrap(),
- "order preserved: {out:?}"
+ let commits = parse_gitlab_commits(json).unwrap();
+ assert_eq!(
+ commits,
+ vec![
+ (
+ "deadbeef2222222222222222222222222222dead".to_string(),
+ "newer change".to_string()
+ ),
+ (
+ "cafef00d3333333333333333333333333333cafe".to_string(),
+ "older change".to_string()
+ ),
+ ]
);
}
+ #[test]
+ fn render_commits_abbreviates_to_the_given_width() {
+ // The pane prints the local repo's abbreviation width — whatever
+ // `Repository::abbrev_len` reported — not a width of its own choosing,
+ // so a fetched PR's commits don't change length under the user.
+ let commits = vec![(
+ "abc12345def67890000000000000000000000000".to_string(),
+ "Wrap the request in a retry".to_string(),
+ )];
+ for abbrev in [7, 12] {
+ let out = plain(&render_commit_lines(&commits, abbrev, 80));
+ let hash = out.split_whitespace().next().unwrap();
+ assert_eq!(hash.chars().count(), abbrev, "abbrev={abbrev}: {out:?}");
+ assert!(commits[0].0.starts_with(hash), "a prefix: {hash:?}");
+ }
+ }
+
#[test]
fn render_commits_empty_and_truncation() {
// A PR the API reports with no commits caches an info line (a terminal
// value) rather than leaving the slot empty.
- assert!(
- plain(&render_github_commits(br#"{"commits":[]}"#, 80).unwrap()).contains("No commits")
- );
+ assert!(plain(&render_commit_lines(&[], 7, 80)).contains("No commits"));
// The preview doesn't wrap, so a long subject truncates to the pane
// width (after the dim hash + two spaces) rather than clipping mid-escape.
let commits = vec![("abc12345".to_string(), "subject-".repeat(20))];
- let line = render_commit_lines(&commits, 40);
+ let line = render_commit_lines(&commits, 8, 40);
let first = plain(&line);
let first = first.lines().next().unwrap();
assert!(first.width() <= 40, "within pane: {first:?}");
@@ -2064,12 +2107,12 @@ mod tests {
}
#[test]
- fn render_commits_invalid_json_is_none() {
- // A forge that returns junk yields `None` from the renderer; the deferred
+ fn parse_commits_invalid_json_is_none() {
+ // A forge that returns junk yields `None` from the parse; the deferred
// closure maps that to a couldn't-load pane (`pr_unavailable_pane`) rather
// than caching garbage.
- assert!(render_github_commits(b"not json", 80).is_none());
- assert!(render_gitlab_commits(b"not json", 80).is_none());
+ assert!(parse_github_commits(b"not json").is_none());
+ assert!(parse_gitlab_commits(b"not json").is_none());
}
#[test]
diff --git a/src/git/repository/mod.rs b/src/git/repository/mod.rs
index 05ede0aeb..a985f3b69 100644
--- a/src/git/repository/mod.rs
+++ b/src/git/repository/mod.rs
@@ -263,6 +263,11 @@ pub(super) struct RepoCache {
pub(super) resolved_config: OnceCell<ResolvedConfig>,
/// Sparse checkout paths (empty if not a sparse checkout)
pub(super) sparse_checkout_paths: OnceCell<Vec<String>>,
+ /// Width git abbreviates a SHA to here, resolved once via
+ /// [`Repository::abbrev_len`]. Repo-wide and settled for the process:
+ /// `core.abbrev` doesn't change mid-run, and the auto-scaled default only
+ /// moves as the object count crosses a power of two.
+ pub(super) abbrev_len: OnceCell<usize>,
/// Merge-base cache: (sha1, sha2) -> merge_base_sha (None = no common ancestor).
/// Keys are commit SHAs by contract — callers must resolve refs through
/// a [`RefSnapshot`] before consulting. The key order is normalized
@@ -1648,6 +1653,8 @@ impl Repository {
/// For batches (e.g., abbreviating many worktree heads at once), prefer
/// folding `%h` into an existing `git log --format` call rather than
/// looping this helper. See [`commit_details_many`](Self::commit_details_many).
+ /// Where that batch doesn't fit — the objects aren't local, or one bad ref
+ /// mustn't cost the rest — abbreviate to [`abbrev_len`](Self::abbrev_len).
pub fn short_sha(&self, sha: &str) -> anyhow::Result<String> {
Ok(self
.run_command(&["rev-parse", "--short", sha])?
@@ -1655,6 +1662,39 @@ impl Repository {
.to_string())
}
+ /// How many characters git abbreviates a SHA to in this repo — `core.abbrev`,
+ /// or the width git auto-scales from the object count. Resolved once per
+ /// repo and shared by every clone, so a caller pays one `git rev-parse` no
+ /// matter how many SHAs it goes on to abbreviate.
+ ///
+ /// This is the width for **a list of SHAs**; [`short_sha`](Self::short_sha)
+ /// is the answer for one. `git rev-parse --short` takes a single revision,
+ /// so a list has no batched form, and looping it is a fork per SHA — the
+ /// trade this exists to avoid. `%h` folded into an existing `git log` is
+ /// better still where it fits ([`commit_details_many`](Self::commit_details_many)),
+ /// but it needs the objects present and refuses the whole batch on one bad
+ /// ref, so it can't serve a list of forge-named commits or a cache of
+ /// historical heads.
+ ///
+ /// What that costs against `short_sha` is disambiguation: git extends a
+ /// prefix that collides with another object, and a plain width can't. Absent
+ /// objects have nothing to collide with, and a live collision at this width
+ /// is rare enough that a display column can wear it.
+ ///
+ /// Probed with `HEAD` so the length matches the repo's object format (a
+ /// SHA-256 repo abbreviates from 64 hex digits, and a literal SHA-1-shaped
+ /// probe is not even a valid revision there) — a HEAD whose own prefix is
+ /// ambiguous therefore reports a character or two over the base width, which
+ /// costs a caller nothing but a slightly longer SHA. Falls back to 7 — git's
+ /// default auto-abbreviation length, and what it reports in an objectless
+ /// repo — for the one failure a working repo reaches, an unborn HEAD.
+ pub fn abbrev_len(&self) -> usize {
+ *self.cache.abbrev_len.get_or_init(|| {
+ self.short_sha("HEAD")
+ .map_or(7, |short| short.chars().count())
+ })
+ }
+
/// Delay before showing progress output for slow operations.
/// See .claude/rules/cli-output-formatting.md: "Progress messages apply only to slow operations (>400ms)"
pub const SLOW_OPERATION_DELAY_MS: i64 = 400;
diff --git a/src/git/repository/tests.rs b/src/git/repository/tests.rs
index bdeddf3c2..584879bf0 100644
--- a/src/git/repository/tests.rs
+++ b/src/git/repository/tests.rs
@@ -715,6 +715,37 @@ fn commit_details_many_returns_subject_with_spaces() {
assert!(sha2.starts_with(short2.as_str()));
}
+#[test]
+fn abbrev_len_follows_core_abbrev_and_covers_absent_objects() {
+ use crate::git::Repository;
+ use crate::testing::TestRepo;
+
+ let test = TestRepo::with_initial_commit();
+
+ // The width git actually uses here — the same one `%h` and `short_sha`
+ // produce, which is the whole point of asking git rather than picking a
+ // number.
+ let head_short = test.repo.short_sha("HEAD").unwrap();
+ assert_eq!(test.repo.abbrev_len(), head_short.chars().count());
+
+ // `core.abbrev` reaches it. A fresh `Repository` because the width is
+ // resolved once per repo handle and cached for the process.
+ test.repo
+ .run_command(&["config", "core.abbrev", "12"])
+ .unwrap();
+ let reread = Repository::at(test.path()).unwrap();
+ assert_eq!(reread.abbrev_len(), 12);
+
+ // The case `short_sha` can't serve per-SHA: an object that isn't in the
+ // store, as every commit the `--prs` log tab gets from a forge API is. git
+ // has nothing to disambiguate against, so this width is its whole answer.
+ let absent = "0".repeat(head_short.chars().count().max(40));
+ assert_eq!(
+ reread.short_sha(&absent).unwrap().chars().count(),
+ reread.abbrev_len(),
+ );
+}
+
#[test]
fn commit_details_many_empty_input_is_noop() {
use crate::testing::TestRepo;
diff --git a/tests/integration_tests/config_state.rs b/tests/integration_tests/config_state.rs
index 80792a01d..0b46c53e0 100644
--- a/tests/integration_tests/config_state.rs
+++ b/tests/integration_tests/config_state.rs
@@ -1798,12 +1798,15 @@ fn test_state_get_empty(repo: TestRepo) {
#[rstest]
fn test_state_get_with_ci_entries(repo: TestRepo) {
- // Add CI cache entries - use TEST_EPOCH for deterministic age=0s in snapshots
+ // Add CI cache entries - use TEST_EPOCH for deterministic age=0s in
+ // snapshots. The heads are placeholders, so what the snapshot pins is the
+ // table's shape; that the width is git's own is pinned separately by
+ // `test_state_get_ci_head_uses_git_abbreviation`.
write_ci_cache(
&repo,
"feature",
&format!(
- r#"{{"status":{{"ci_status":"passed","source":"pr","is_stale":false}},"checked_at":{TEST_EPOCH},"head":"abc12345def67890","branch":"feature"}}"#
+ r#"{{"status":{{"ci_status":"passed","source":"pr","is_stale":false}},"checked_at":{TEST_EPOCH},"head":"abc12345","branch":"feature"}}"#
),
);
@@ -1811,7 +1814,7 @@ fn test_state_get_with_ci_entries(repo: TestRepo) {
&repo,
"bugfix",
&format!(
- r#"{{"status":{{"ci_status":"failed","source":"branch","is_stale":true}},"checked_at":{TEST_EPOCH},"head":"111222333444555","branch":"bugfix"}}"#
+ r#"{{"status":{{"ci_status":"failed","source":"branch","is_stale":true}},"checked_at":{TEST_EPOCH},"head":"11122233","branch":"bugfix"}}"#
),
);
@@ -1819,7 +1822,7 @@ fn test_state_get_with_ci_entries(repo: TestRepo) {
&repo,
"main",
&format!(
- r#"{{"status":null,"checked_at":{TEST_EPOCH},"head":"deadbeef12345678","branch":"main"}}"#
+ r#"{{"status":null,"checked_at":{TEST_EPOCH},"head":"deadbeef","branch":"main"}}"#
),
);
@@ -1830,6 +1833,48 @@ fn test_state_get_with_ci_entries(repo: TestRepo) {
});
}
+/// The CI cache's Head column abbreviates through git, so a head reads at the
+/// same width in `wt config state` as it does in `wt list`'s Commit column and
+/// in the statusline — all of them `core.abbrev`, none of them a slice of their
+/// own. Snapshots can't pin this: the width git picks scales with the repo's
+/// object count, and the SHA a test repo commits to isn't fixed.
+#[rstest]
+fn test_state_get_ci_head_uses_git_abbreviation(repo: TestRepo) {
+ let head = repo.head_sha();
+ write_ci_cache(
+ &repo,
+ "main",
+ &format!(r#"{{"status":null,"checked_at":{TEST_EPOCH},"head":"{head}","branch":"main"}}"#),
+ );
+
+ let expected = String::from_utf8_lossy(
+ &repo
+ .git_command()
+ .args(["rev-parse", "--short", &head])
+ .run()
+ .unwrap()
+ .stdout,
+ )
+ .trim()
+ .to_string();
+
+ let output = wt_state_get_cmd(&repo).output().unwrap();
+ assert!(output.status.success());
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ let row = stdout
+ .lines()
+ .find(|l| l.contains("main") && l.contains("none"))
+ .unwrap_or_else(|| panic!("no CI cache row for main:\n{stdout}"));
+ assert!(
+ row.split_whitespace().any(|cell| cell == expected),
+ "expected the git-abbreviated head {expected:?} in the CI row: {row:?}"
+ );
+ assert!(
+ !stdout.contains(&head),
+ "the full SHA should not reach the table:\n{stdout}"
+ );
+}
+
#[rstest]
fn test_state_get_comprehensive(repo: TestRepo) {
// Populate the default-branch cache (the dump reads it, never detects)
@@ -1877,7 +1922,7 @@ fn test_state_get_comprehensive(repo: TestRepo) {
&repo,
"feature",
&format!(
- r#"{{"status":{{"ci_status":"passed","source":"pr","is_stale":false}},"checked_at":{TEST_EPOCH},"head":"abc12345def67890","branch":"feature"}}"#
+ r#"{{"status":{{"ci_status":"passed","source":"pr","is_stale":false}},"checked_at":{TEST_EPOCH},"head":"abc12345","branch":"feature"}}"#
),
);
diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rs
index 0dfe4b3af..78d033027 100644
--- a/tests/integration_tests/switch.rs
+++ b/tests/integration_tests/switch.rs
@@ -2446,7 +2446,7 @@ fn test_switch_prs_dry_run_github(repo: TestRepo) {
/// commits` on `COLLECT_POOL`, keyed by the row's `pr:{N}` token. The dry-run
/// path joins that work and dumps the preview cache, so a `{branch:"pr:42",
/// mode:2}` (Log) entry with non-empty bytes proves the whole mechanism end to
-/// end: `spawn_compute` → `compute_pr_log` → `render_github_commits` → cache.
+/// end: `spawn_compute` → `compute_pr_log` → `parse_github_commits` → cache.
///
/// `headRefOid` here is a SHA that isn't in the test repo's object store, so
/// `compute_pr_log`'s local-`git log` fast path misses and falls back to the
@@ -2713,19 +2713,19 @@ fn test_switch_prs_dry_run_gitlab(repo: TestRepo) {
/// --paginate projects/:fullpath/merge_requests/<n>/commits` / `…/notes?sort=asc`
/// calls keyed by the row's `mr:{N}` token. Both `mode:2` (Log) and `mode:7`
/// (Comments) cache entries with non-empty bytes prove `compute_pr_log` /
-/// `compute_pr_comments` → `render_gitlab_commits` / `render_gitlab_notes` →
+/// `compute_pr_comments` → `parse_gitlab_commits` / `render_gitlab_notes` →
/// cache for the GitLab forge — the half the unit tests (canned JSON straight
/// into the renderers) can't reach, pinning the endpoint/arg construction.
///
/// Both `glab api …/commits` and `…/notes` match the mock's `api --paginate`
/// compound key, so one canned response carries all fields each renderer reads
-/// (`short_id`/`title` for commits; `body`/`author`/`created_at`/`system` for
+/// (`id`/`title` for commits; `body`/`author`/`created_at`/`system` for
/// notes) — serde ignores the rest.
#[rstest]
fn test_switch_prs_dry_run_gitlab_deferred_tabs(repo: TestRepo) {
repo.write_project_config("[forge]\nplatform = \"gitlab\"\n");
let mr_json = r#"[{"iid":7,"title":"Cache the dependency graph","source_branch":"feat/cache","author":{"username":"alice"},"draft":false,"web_url":"https://gitlab.com/owner/test-repo/-/merge_requests/7"}]"#;
- let api_json = r#"[{"short_id":"abc12345","title":"Cache deps between jobs","body":"Looks good.","author":{"username":"reviewer"},"created_at":"2024-12-01T00:00:00Z","system":false}]"#;
+ let api_json = r#"[{"id":"abc12345def678900000000000000000000000a","short_id":"abc12345","title":"Cache deps between jobs","body":"Looks good.","author":{"username":"reviewer"},"created_at":"2024-12-01T00:00:00Z","system":false}]"#;
let mock_bin = repo.root_path().join("mock-bin");
fs::create_dir_all(&mock_bin).unwrap();
diff --git a/tests/snapshots/integration__integration_tests__config_state__state_get_comprehensive.snap b/tests/snapshots/integration__integration_tests__config_state__state_get_comprehensive.snap
index ba876b2cc..5b1f1839c 100644
--- a/tests/snapshots/integration__integration_tests__config_state__state_get_comprehensive.snap
+++ b/tests/snapshots/integration__integration_tests__config_state__state_get_comprehensive.snap
@@ -21,9 +21,9 @@ expression: "String::from_utf8_lossy(&output.stdout)"
main env staging
CI STATUS CACHE
- Branch Status Age Head
- ─────── ────── ─── ────────
- feature passed now abc12345
+ Branch Status Age Head
+ ─────── ────── ─── ───────
+ feature passed now abc1234
SUMMARY CACHE
Branch Summary Age
diff --git a/tests/snapshots/integration__integration_tests__config_state__state_get_with_ci_entries.snap b/tests/snapshots/integration__integration_tests__config_state__state_get_with_ci_entries.snap
index 1b4470187..a63a2464b 100644
--- a/tests/snapshots/integration__integration_tests__config_state__state_get_with_ci_entries.snap
+++ b/tests/snapshots/integration__integration_tests__config_state__state_get_with_ci_entries.snap
@@ -15,11 +15,11 @@ expression: "String::from_utf8_lossy(&output.stdout)"
  (none)
CI STATUS CACHE
- Branch Status Age Head
- ─────── ────── ─── ────────
- bugfix failed now 11122233
- feature passed now abc12345
- main none now deadbeef
+ Branch Status Age Head
+ ─────── ────── ─── ───────
+ bugfix failed now 1112223
+ feature passed now abc1234
+ main none now deadbee
SUMMARY CACHE
  (none)