Removes `Worker.RefreshChat` and the four `TestRefreshChat_*` tests that
only exercised it. `RefreshChat` has had no production caller since
#23901 stopped resolving diff statuses inline on `GetChat`. The worker's
periodic tick is the only refresh path.
`TestWorker_RefreshDoesNotReorderPrimary` used `RefreshChat` to refresh
one of two refs. It now keeps the newer ref fresh (`StaleAt` one hour
ahead) and runs one worker tick, so it checks the same ordering rule
through the production path.
**Why removal is safe:** `git grep '\.RefreshChat('` finds no caller.
Each removed assertion either checked `RefreshChat` itself or is still
caught by a remaining test. I mutated the production line behind each
shared assertion with `go test -overlay`:
| Removed test and assertion | Mutant | Remaining tests that fail |
|---|---|---|
| `TestRefreshChat_Success`: the upsert uses the chat's ID |
`Refresher.refreshOne` upserts a random chat ID |
`TestRefresher_WithPRURL`, `TestWorker`,
`TestWorker_UpsertError_ContinuesNextRow`,
`TestWorker_RefreshDoesNotReorderPrimary` |
| `TestRefreshChat_NoPR`: a branch without a PR is not an error |
`refreshOne` returns an error when there is no PR |
`TestRefresher_BranchNoPRYet` and the three `TestWorker_NoPR_*` tests |
| `TestRefreshChat_RefreshError`: the "no provider" error |
`Refresher.Refresh` changes the "no provider" message |
`TestRefresher_NoProviderForOrigin` |
The other assertions (the returned row, the `upsert chat diff status`
error wrap, and the publish call inside `RefreshChat`) checked only the
deleted method. For the rewritten test, a mutant that sets `updated_at`
in `UpsertChatDiffStatus` fails both the old and the new version. A
mutant that sets `updated_at` in `AcquireStaleChatDiffStatuses` fails
only the new version, because the old version never ran a tick.
**Review focus:** the fixture change in
`TestWorker_RefreshDoesNotReorderPrimary`. #29997 changes one line in
`TestRefreshChat_RefreshError`, so whichever PR lands second drops that
test.
Validation:
- `go test ./coderd/x/gitsync/ -count=1` passes, and `-race -count=5`
passes.
- `golangci-lint run ./coderd/x/gitsync/...` reports 0 issues, and the
pre-commit hook passed.
> Xum, an AI agent, opened this PR for @ibetitsmike and wrote this
description.