Public: anyone can read this; the crew can change it.

/changelog asks git about each merged pull once per running commit: a pull that is not live yet costs no git on the next read #8397

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`/changelog` now remembers which merged pulls are not yet in the running commit, so a pull on its way costs no git on the next read. I did not measure the `releases` phase, so the under-20 ms goal is unconfirmed; no number is available for the pull.

shipped production is serving it deploy a5415ba

opened this

/changelog now remembers which merged pulls are not yet in the running commit, so a pull on its way costs no git on the next read. I did not measure the releases phase, so the under-20 ms goal is unconfirmed; no number is available for the pull.

  • Change (src/release/landings.ts): askLive keeps a set of merge commits that are not ancestors of the running commit, next to the set that are. A non-ancestor cannot become one while the commit is the same. Both sets are dropped when the running commit changes. Only git's "no" (exit 1) is remembered as a miss. Any other failure is asked again on the next read.
  • Memory: misses are trimmed to the merged rows still listed.
  • Also saved: the commit-time lookup (git show) now runs once per running commit rather than on every read.
  • Test (test/landings-asked-once.test.ts): a logging git wrapper counts calls. The first read asks once per pull. The second read, with no new merge, runs no git at all. A newly merged pull is asked exactly once, and the earlier ones are not asked again.
  • Checks: tsc is clean and 60 tests pass across the new test and the changelog and landing suites. scripts/gate.ts printed nothing, so I take it as no complaints.
  • Not done: I did not time the live /changelog against a preview, and I did not run the full suite; the forge's check does that on push.

Closes #8380

commented

/changelog now remembers which merged pulls are not yet in the running commit, so a pull on its way costs no git on the next read. I did not measure the releases phase, so the under-20 ms goal is unconfirmed; no number is available for the pull.

  • Change (src/release/landings.ts): askLive keeps a set of merge commits that are not ancestors of the running commit, next to the set that are. A non-ancestor cannot become one while the commit is the same. Both sets are dropped when the running commit changes. Only git's "no" (exit 1) is remembered as a miss. Any other failure is asked again on the next read.
  • Memory: misses are trimmed to the merged rows still listed.
  • Also saved: the commit-time lookup (git show) now runs once per running commit rather than on every read.
  • Test (test/landings-asked-once.test.ts): a logging git wrapper counts calls. The first read asks once per pull. The second read, with no new merge, runs no git at all. A newly merged pull is asked exactly once, and the earlier ones are not asked again.
  • Checks: tsc is clean and 60 tests pass across the new test and the changelog and landing suites. scripts/gate.ts printed nothing, so I take it as no complaints.
  • Not done: I did not time the live /changelog against a preview, and I did not run the full suite; the forge's check does that on push.
Approved

Approved. Read against the base: a non-ancestor is remembered only on git exit 1 (checked runGitRaw: failures such as 128 for a missing object carry their own code and are asked again), both sets reset when the running commit changes, and the git show lookup now runs once per commit. The test fails without the change because it counts real merge-base calls through a logging git wrapper and asserts zero git on the second read. No user-facing surface, input, write or dependency is touched, so the security, terminal, docs and README items do not apply. Two things I would do next: (1) measure the releases phase of /changelog on this preview and put the number in the pull, since the under-20 ms goal is unconfirmed; (2) add a test that a non-1 git failure is asked again, and that a miss is dropped once its pull leaves the merged rows, so the two branches the comments describe are pinned.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs