clearPluginLapse cleared an account's "sign in again" mark only through
plugin.Cached(): it looked for the plugin's provider in the list and
cleared nothing when it wasn't there. The list is empty while
checkList reads another magpie's change to plugins.json again
(provCache = nil, before the providers file is written), so a sign-in
finished then left the account lapsed until a request or usage read
went through. TestPluginLoginTakesTheLapseOff (internal/cli) went red
that way on ubuntu CI twice (runs 39216129687 and 39234604936: "signed
in again, but still lapsed").
The mark now goes by the account's agent and key alone
(notePluginLapseOf), with the same sign-in count ordering as before;
only the stale usage reading still needs the provider, and is still
dropped when it is listed.
TestPluginSignInClearsLapseWithoutTheList saves two lapsed plugin
accounts with no plugin listed, signs one in again, and checks its mark
went and the other's stayed. On the old plugin_accounts.go it fails:
plugin_fetch_lapse_test.go:83: signed in again, but still lapsed:
"gone@fake's FakeCo sign-in has expired — sign in again"
and passes with the change.
Whether CI's two reds were this empty list and not another path is
inferred from the code, not captured; #2748 stays open until CI has
gone a while without it.
Run on origin/main 9fd80b212 + this change, macOS, load ~170-230:
- gofmt -l internal/provider: clean; go vet ./internal/provider/;
GOOS=linux and GOOS=windows go vet -tags nogui on internal/provider and
internal/cli: ok
- go test -timeout 45m -count=1 ./internal/provider/ ./internal/cli/:
ok provider 552.7s, ok cli 324.7s
- -run 'TestPluginLogin|TestPluginSignIn|Lapse' on both packages, 5
times: ok every time
- not the full ./... suite: the change is internal/provider's lapse
clearing, and the two packages that sign plugins in were run whole.