Skip to content

fix(onboarding-complete): use /profile/ endpoint; drop workspace_join#61

Merged
awais786 merged 1 commit into
mainfrom
fix-onboarding-test-plane-profile-endpoint
Jun 5, 2026
Merged

fix(onboarding-complete): use /profile/ endpoint; drop workspace_join#61
awais786 merged 1 commit into
mainfrom
fix-onboarding-test-plane-profile-endpoint

Conversation

@awais786

@awais786 awais786 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

What was wrong

PR #59 added tests/auth/onboarding-complete-flag.spec.ts probing Plane's /api/users/me/ for is_onboarded + onboarding_step — fields that don't exist on that endpoint. Live verification was blocked at PR-time by the bundle's IDP loop; the test failed on the first green-bundle CI run with is_onboarded: undefined.

What we found probing the live API

Plane splits user data across three endpoints:

/api/users/me/ basic identity (email, name, etc.)
/api/users/me/profile/ onboarding state — is_onboarded,
onboarding_step, last_workspace_id
/api/users/me/settings/ workspace settings (used elsewhere)

All three contract observables live on /profile/. Verified against the live sandbox 2026-06-05 for FOSS_USER:

  • is_onboarded: true
  • last_workspace_id:
  • onboarding_step.profile_complete: true
  • onboarding_step.workspace_create: true
  • onboarding_step.workspace_invite: true
  • onboarding_step.workspace_join: false ← intentional

The fourth sub-step (workspace_join) tracks Plane's invite-link join flow. SSO-auto-joined users (FOSS_USER, NORMAL_USER) are added by the bundle's system-bot directly, NOT through Plane's invite UI, so this flag legitimately stays false. The load-bearing contract observable — is_onboarded: true — is correctly set; Plane treats the user as fully onboarded for UX purposes.

Fixes

  1. tests/auth/onboarding-complete-flag.spec.ts - Consolidate to a single endpoint: /api/users/me/profile/ (carries is_onboarded + onboarding_step + last_workspace_id) - Drop workspace_join from the expected sub-step list — it's auto-join-vacuous (set only through the invite flow) - File-head comment documents the empirical probe + the workspace_join rationale

  2. vendor/openspec/specs/workspace-auto-join/spec.md

    • Requirement body now spells out the three deterministic sub-step flags plus is_onboarded + last_workspace_id
    • Explicit note that workspace_join legitimately stays False for SSO-auto-joined users (the openspec was previously claiming True for all four — wrong for the SSO path) - Scenario lists the three deterministic AND flags plus a deliberate AND-False on workspace_join, so a future implementation that flips workspace_join to True under auto-join would surface as a contract drift (catchable by the shape-review checklist)

Audit

88 total / 65 covered / 23 deferred / 0 missing — unchanged (this PR fixes an existing test, doesn't add or remove requirements).

NOT live-verified yet — bundle IDP was looping during commit; will be validated on the next green-bundle CI pass. Test now matches Plane's actual API shape so it should pass cleanly.

Motivation / Background

This Pull Request has been created because:

  • Resolves #issue-id

Detail

This Pull Request changes:

Additional information

TIP: Provide additional information such as screenshots, benchmarks, reference to other repositories or alternative solutions

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature
  • CHANGELOG files are updated for the behavior change or additional feature (minor bug fixes and documentation changes should not be included)
  • This PR contains API changes and API documentation is updated accordingly (for critical or behavior change, please inform related parties about them).

# What was wrong

PR #59 added tests/auth/onboarding-complete-flag.spec.ts probing
Plane's `/api/users/me/` for `is_onboarded` + `onboarding_step` —
fields that don't exist on that endpoint. Live verification was
blocked at PR-time by the bundle's IDP loop; the test failed on
the first green-bundle CI run with `is_onboarded: undefined`.

# What we found probing the live API

Plane splits user data across three endpoints:

  /api/users/me/           basic identity (email, name, etc.)
  /api/users/me/profile/   onboarding state — is_onboarded,
                           onboarding_step, last_workspace_id
  /api/users/me/settings/  workspace settings (used elsewhere)

All three contract observables live on `/profile/`. Verified
against the live sandbox 2026-06-05 for FOSS_USER:

  - is_onboarded:                       true
  - last_workspace_id:                  <matches PLANE_WORKSPACE_ID>
  - onboarding_step.profile_complete:   true
  - onboarding_step.workspace_create:   true
  - onboarding_step.workspace_invite:   true
  - onboarding_step.workspace_join:    false   ← intentional

The fourth sub-step (`workspace_join`) tracks Plane's invite-link
join flow. SSO-auto-joined users (FOSS_USER, NORMAL_USER) are
added by the bundle's system-bot directly, NOT through Plane's
invite UI, so this flag legitimately stays false. The load-bearing
contract observable — `is_onboarded: true` — is correctly set;
Plane treats the user as fully onboarded for UX purposes.

# Fixes

  1. tests/auth/onboarding-complete-flag.spec.ts
     - Consolidate to a single endpoint: /api/users/me/profile/
       (carries is_onboarded + onboarding_step + last_workspace_id)
     - Drop workspace_join from the expected sub-step list — it's
       auto-join-vacuous (set only through the invite flow)
     - File-head comment documents the empirical probe + the
       workspace_join rationale

  2. vendor/openspec/specs/workspace-auto-join/spec.md
     - Requirement body now spells out the three deterministic
       sub-step flags plus is_onboarded + last_workspace_id
     - Explicit note that workspace_join legitimately stays False
       for SSO-auto-joined users (the openspec was previously
       claiming True for all four — wrong for the SSO path)
     - Scenario lists the three deterministic AND flags plus a
       deliberate AND-False on workspace_join, so a future
       implementation that flips workspace_join to True under
       auto-join would surface as a contract drift (catchable
       by the shape-review checklist)

# Audit

88 total / 65 covered / 23 deferred / 0 missing — unchanged
(this PR fixes an existing test, doesn't add or remove
requirements).

NOT live-verified yet — bundle IDP was looping during commit;
will be validated on the next green-bundle CI pass. Test now
matches Plane's actual API shape so it should pass cleanly.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

SSO Spec Coverage Audit

Contract source: vendor/openspec/specs/ (snapshot vendored in this repo)

Status Count
✅ Covered (test tag found) 65
⚠️ Deferred (in deferred doc) 23
❌ Missing (no tag, no defer) 0
Total requirements 88

All 88 spec requirements are accounted for.

@awais786 awais786 merged commit 0daaca3 into main Jun 5, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant