test(e2e): anchor the inference authority pair on Add a provider (#2270) - #2301
Conversation
|
Warning Review limit reached
On-demand reviews are free for the next 6 days. After that, they cost $0.25 per reviewed file. Or wait 14 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Comment |
How this change flows0 changed behaviours across 3 relationships. 5 surrounding behaviours are shown (17 graph nodes walked). 12 further behaviours left out to keep the diagram readable. flowchart LR
n0["signInAsMember"]:::impacted
n1["openConnectionsPage"]:::impacted
n2["openSettingsPage"]:::impacted
n3["MEMBER_EMAIL"]:::impacted
n4["Page"]:::impacted
n0 -->|uses| n3
n1 -->|uses| n4
n2 -->|uses| n4
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge. |
Summary
Fixes the inference half of
connections-authority.spec.ts, which is what keepsConsole E2EandConsole E2E (live brain)red onmainand, throughPR CI Gate, blocks every open PR. Part of #2270.What failed
On
main@892d3d64c(CI run 34818294967) both E2E lanes failed exactly one test,connections-authority.spec.ts:183› "an admin is still offered every control across the four pages":Console E2E (live brain): timed out ongetByTestId('inference-save')(spec line 224 at that commit).Console E2E: timed out on#composio-api-key. feat(composio): rework the credential page into single-select rows #2278 (b038b0202, merged as282d90c05) has since gated that half onCOMPOSIOand reworked it for the dialog, so it is not touched here.Why
inference-savewas removed, not renamed. #2262 retired the single-provider form ("feat(console): retire the single-provider form; the Routing tab lands") and nothing infrontend/srccarries the id now. The admin assertion could never pass, and the member assertion (expect(memberPage.getByTestId("inference-save")).toHaveCount(0)) had been passing vacuously for both roles.What it asserts now, and why that is the real contract
The post-#2262 LLM page expresses authority by disabling controls, not by hiding them. So:
inference-read-onlyis visible, andinference-add-open("Add a provider") is visible and disabled.inference-read-onlyhas count 0, andinference-add-openis enabled. Because the admin half requires the button to be enabled, the member half can't pass just because the button is disabled for every viewer.Justification:
frontend/src/inference/ProvidersTab.tsx:284-288: the button renders unconditionally in the tab's body withdisabled={!canManage}.frontend/src/views/InferenceView.tsx:40-43:connect(the Providers tab) is the default tab, so#/settings/inferencelands on it.frontend/src/views/InferenceView.tsx:66-74:inference-read-onlyrenders exactly when!canManage.frontend/src/hooks/use-can-manage.ts:31-35:useCanManagefails closed until the role read answers.toBeEnabledon the admin side therefore waits for the resolved role rather than reading the first render.ScopedCompany(src/server/ops/inference.rs:979-981), souse-inference.ts:111setsready. The admin-only routes read (AdminScopedCompany,src/server/ops/inference/providers.rs:1903) refuses a member with 403, anduse-inference.ts:130handles that as an authority answer rather than an error.ProvidersTab.tsx:192-195therefore does not return early.Why not the Routing tab's Save (
inference-own-save): it lives inside{mode === "own" && (…)}(frontend/src/inference/RoutingTab.tsx:216, testid at:266). It exists only when the company's routing mode isown, so the test would pass or fail depending on the harness company's boot mode instead of on authority. "Add a provider" is on the default tab in every routing mode.inference.spec.tsalready clicks it as the harness admin, ungated, and all nine of its tests passed in both lanes on run 34818294967.API Or Behavior Changes
None. Test-only; no console or host code is touched.
Tests
target/debug/opencompany, and the E2E lanes on this PR are the verification. They exercise both the default-feature host (Console E2E) and the--features composiolive-brain host (Console E2E (live brain)).npm run typecheck:e2e(the gate covering this spec) runs in theConsolelane on this PR. The change adds no new imports or types, onlytoBeVisible/toBeDisabled/toBeEnabled/toHaveCounton existing locators.Not fixed here:
Rust (openhuman, tinymemory)is also red onmainIt also feeds
PR CI Gate, so a PR can stay red for this reason alone. It is unrelated to this change.policy::judgement::tests::an_uncatalogued_composio_call_logs_the_catalogue_miss_once_not_twice(src/policy/judgement.rs:872,left: 0, right: 1: zero WARN events counted, not two). It failed in the stepcargo test --locked -p opencompany-core --features openhuman,chargebee,paypal,composio --lib composio.892d3d64cchanges no Rust (git diff --stat 7c2d39844 892d3d64ctouches only.github/workflows/*andscripts/ci/assert-merge-group-workflow.sh). The same test passed in the same composio-scoped step on the previous main run (31daea47f, run 34808415119). It also passed earlier in the failing job itself, in the--features openhumanstep.tracing::subscriber::with_default. tracing caches callsite interest and the max level globally, so a sibling test hitting the samecatalogue_misscallsite on another thread can leave the event filtered out before this test's subscriber sees it. A count of 0 fits that; the regression the test guards against would show 2.