You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finish the strip: sweep every remaining org_id test fixture/assertion across the integration suite, update the goals-API integration tests, optionally add a negative OpenAPI guard locking the removal in, and add the owner-only behavioural regressions (no-503 on GET /api/v1/goals, owner-only trigger/submit Forbidden). After this PR a repo-wide grep -rn org_id backend/ returns only GitHub-org_login hits and the org-admin role-string fixtures.
Depends on #272 and #273 (the model/DTO/param removals). If #272 folded the struct-seed updates of these integration test files in, this PR reduces to the assertion edits + new regression tests + the OpenAPI guard.
Problem / Motivation
org_id: None struct-seed initializers and org_id-null assertions remain across the integration suite; they must be removed mechanically (field-removal side effects, not behaviour changes) so cargo test compiles.
The milestone needs explicit regressions: the 503 must stay dead, and owner-only denial must be proven without any org lookup.
The bson serde test (~L402-424): drop the org_id: None seed (L411) and assert_eq!(raw.get("org_id"), Some(&Bson::Null)) (L420).
list_scopes_to_own_plus_org_and_filters_by_status (L201-243): the body never actually seeds an org goal — rename to drop plus_org and keep the owner/status coverage.
seed_goal_with_status() (L143): drop org_id: None.
Struct-seed-only sweeps (drop org_id: None, no assertion change)
No edit required — it names no org_id/org symbol and pins no schema property list, so it stays green automatically. OPTIONAL (recommended): add a negative guard in components_include_key_schemas_from_all_crates (L142-175) asserting no component schema exposes an org_id property, mirroring the existing internal_worker_protocol_is_never_in_the_spec guard (L204-215). Confirm org_login on the repo-create schema is still present (KEEP boundary) and no /internal/* path leaks.
New owner-only regression tests
GET /api/v1/goals no-503: an integration test that listing goals for an authenticated owner returns 200 with only owned goals and makes no NyxID org call (regression for the removed visible_org_ids 503).
✅ In scope: every org_id test fixture/assertion in the integration suite; the optional OpenAPI negative guard; the new owner-only regressions.
❌ Out of scope / KEEP — do NOT touch (match an org grep but are not NyxID orgs): goals/repo_create.rs/orgs/{org}/repos + org_login tests; repo_create_classify.rs SSO-org URL tests; the "org-admin" role-string fixtures in auth/identity.rs + auth/middleware.rs.
Acceptance Criteria / Definition of Done
grep -rn org_id backend/ returns only org_login/repo-placement hits and the org-admin role-string fixtures.
cargo test -p fkst-control-plane -p fkst-shared green; tests/openapi.rs green (with the optional negative org_id guard if added); cargo build -p fkst-worker green.
The GET /api/v1/goals no-503 regression and the owner-only trigger/submit Forbidden tests pass.
Coverage stays ≥ 80% (org-only tests were deleted because their scenario no longer exists; owner-scoped coverage is preserved/tightened — verify the suite did not silently drop coverage).
Summary
Finish the strip: sweep every remaining
org_idtest fixture/assertion across the integration suite, update the goals-API integration tests, optionally add a negative OpenAPI guard locking the removal in, and add the owner-only behavioural regressions (no-503 onGET /api/v1/goals, owner-only trigger/submit Forbidden). After this PR a repo-widegrep -rn org_id backend/returns only GitHub-org_loginhits and theorg-adminrole-string fixtures.Depends on #272 and #273 (the model/DTO/param removals). If #272 folded the struct-seed updates of these integration test files in, this PR reduces to the assertion edits + new regression tests + the OpenAPI guard.
Problem / Motivation
org_id: Nonestruct-seed initializers andorg_id-null assertions remain across the integration suite; they must be removed mechanically (field-removal side effects, not behaviour changes) socargo testcompiles.Proposed Solution — Implementation Spec
backend/fkst-control-plane/tests/goals_api.rspost_goal_creates_201_with_location_and_not_started(L154-192): removeassert!(goal["org_id"].is_null())(L180).org_id: Noneseed (L411) andassert_eq!(raw.get("org_id"), Some(&Bson::Null))(L420).list_scopes_to_own_plus_org_and_filters_by_status(L201-243): the body never actually seeds an org goal — rename to dropplus_organd keep the owner/status coverage.seed_goal_with_status()(L143): droporg_id: None.Struct-seed-only sweeps (drop
org_id: None, no assertion change)tests/sessions_api.rsL194 (mkorphan-sweep builder);tests/admin_metrics.rsL74 (seed_doc);tests/goal_session_token.rsL182 (seed_goalGoalDoc) + L239 (GoalTriggerInfo);tests/github_app_installations.rsL207;tests/activation_dispatch.rsL99/L115;tests/claim_placement.rsL42/L58;tests/reassign_redispatch.rsL96/L112. (If Remove org_id from goal/session models, DTOs (OpenAPI), and the goal-issue marker #272 already removed these, verify and skip.)backend/fkst-control-plane/tests/openapi.rsorg_id/org symbol and pins no schema property list, so it stays green automatically. OPTIONAL (recommended): add a negative guard incomponents_include_key_schemas_from_all_crates(L142-175) asserting no component schema exposes anorg_idproperty, mirroring the existinginternal_worker_protocol_is_never_in_the_specguard (L204-215). Confirmorg_loginon the repo-create schema is still present (KEEP boundary) and no/internal/*path leaks.New owner-only regression tests
visible_org_ids503).Forbiddenon goaltriggerANDsubmit(therequire_org_writerarms are gone — prove the owner-only gate still denies). These may live alongside Strip NyxID-org authz: remove visible_org_ids/require_org_writer/OrgRole branches (owner-only) #270's authz tests; place wherever the existing handler tests are.Scope Check
org_idtest fixture/assertion in the integration suite; the optional OpenAPI negative guard; the new owner-only regressions.orggrep but are not NyxID orgs):goals/repo_create.rs/orgs/{org}/repos+org_logintests;repo_create_classify.rsSSO-org URL tests; the"org-admin"role-string fixtures inauth/identity.rs+auth/middleware.rs.Acceptance Criteria / Definition of Done
grep -rn org_id backend/returns onlyorg_login/repo-placement hits and theorg-adminrole-string fixtures.cargo test -p fkst-control-plane -p fkst-sharedgreen;tests/openapi.rsgreen (with the optional negativeorg_idguard if added);cargo build -p fkst-workergreen.