Repository navigation
Point the remote-connection contract test at the current call sites - #8429
danielhanchen wants to merge 1 commit into
Conversation
#8299 replaced the inline Promise.allSettled(backfillTasks) with settleTasksIfCurrent and moved startup provider hydration off the chat page into the credential bootstrap the app root runs, so the two static assertions grepping for the old literals have been failing on main for every PR since. Retarget them without weakening the contract: the backfill still has to be settled, and the bootstrap still has to sync providers from the backend and be invoked at the root.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c5610b250
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert "syncExternalProvidersFromBackend" in source | ||
| assert "await hydratePersistedSettings()" in source | ||
| assert "runCredentialBootstrap" in source | ||
| assert "bootstrapPersistedCredentials" in APP_ROOT.read_text(encoding = "utf-8") |
There was a problem hiding this comment.
Assert bootstrap completion before releasing app content
When the root starts the bootstrap but releases content immediately—for example, by setting ready without waiting for the returned promise—this test still passes because it only checks that the identifier occurs somewhere in each file. That misses the startup-ordering behavior this contract is meant to preserve; verify that the root gate waits for bootstrapPersistedCredentials() to settle before rendering its children, or cover the gate with a behavioral test.
Useful? React with 👍 / 👎.
| assert "Promise.allSettled(backfillTasks)" in source | ||
| # settleTasksIfCurrent is the Promise.allSettled this used to inline (#8299); it | ||
| # additionally drops the writes when the auth session has moved on. | ||
| assert "settleTasksIfCurrent(backfillTasks" in source |
There was a problem hiding this comment.
Preserve all-settled coverage for backfill failures
When one updateProviderConfig task rejects, replacing the helper's Promise.allSettled with Promise.all would make syncExternalProvidersFromBackend reject and cause runCredentialBootstrap to discard the otherwise valid provider hydration, yet this assertion would remain green because it checks only the helper call's name. The helper's existing test covers whether tasks launch for a current session but not rejection handling, so retain a check for Promise.allSettled in the helper or add a behavioral test proving that a rejected backfill does not reject the sync.
Useful? React with 👍 / 👎.
|
Closing this as superseded: main already carries the same change, in a strictly broader form.
The only line unique to this branch is Checked rather than assumed: resolving the conflict by taking main's side (the only correct resolution, since main's is the superset) and diffing the result against Nothing pushed to this branch. Reopenable if I have misread which side won. |
tests/studio/test_remote_connection_models_contract.pyhas two static assertions that grep the frontend for literals #8299 refactored away, soRepo tests (CPU)has been red onmainfor every PR since:Both behaviours are intact, only their call sites moved:
sync-external-providers.tsnow callssettleTasksIfCurrent(backfillTasks, isCurrent), which is the samePromise.allSettledplus a check that the auth session has not moved on.chat-page.tsxforfeatures/credentials/bootstrap.ts, whichapp/routes/__root.tsxruns before releasing content.This retargets the assertions without weakening them: the backfill still has to be settled, the bootstrap still has to sync providers from the backend, and the root still has to invoke it. Deleting the
settleTasksIfCurrent(backfillTasks, isCurrent)line still turns the first test red, so it keeps its teeth.Test only, no product code touched.
python -m pytest tests/studio/test_remote_connection_models_contract.py -qgives 7 passed.