Repository navigation
feat(workflows-as-code): turn workflows as code on for everyone - #10564
waleedlatif1 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
[High impact] Workflow and workspace source becomes available across Sim to callers who already have access. The PR appears safe to merge, with a non-blocking first-open Code-tab freshness issue. Findings
SummaryMakes workflows and workspaces as code generally available by removing the rollout flag and its server, UI, CLI, and documentation gates.
Reviews (1) · Last reviewed commit: "feat(workflows-as-code): turn workflows ..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 99 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Remove the workflow-code feature flag and every gate behind it: the source operations' feature declarations and the operation-feature mechanism (its only user), FEATURE_NOT_ENABLED, the flag registry entry and WORKFLOW_CODE fallback, the Code tab gates and Preview badge, the CLI inventory entitlement fields, the flag-off tests and CI app, and the preview and 403 copy across OpenAPI, CLI, docs and rules. The Mothership workflow-code entitlement stays granted as constant true until the worker stops gating on it. computeEntitlements now settles each evaluator on its own, so one failing rollout check withholds only its entitlement. The Code tab mounts on first open, so sessions that never open it pay for none of its draft subscriptions. Also documents RESOURCE_ERRORS on the blob operations, names Stage Workspace Source Blobs instead of its path, and corrects the missing-blobs TSDoc.
…b opens, and bootstrap a persisted Code tab A Download as code read leaves a fresh-looking cache entry the lazily mounted Code tab never saw edits against, so the tab's draft subscription revalidates any idle cached copy when it starts. The blocking panel script no longer rewrites a persisted Code tab to the toolbar, and the pre-hydration CSS covers the Code tab like the others.
b013201 to
ad66ff6
Compare
Summary
Turns workflows as code (and workspace as code) on for everyone by removing the
workflow-codefeature flag and every gate behind it.Merge only after AppConfig
workflow-code: {enabled: true}has held globally on staging and then prod. This PR is the cleanup after that; it is not the rollout.Removed
feature: WORKFLOW_CODE_FEATUREdeclarations on every workflow and workspace source operation,lib/workflows/code/feature-flag.ts, andlib/workflows/application/code-availability.ts.workflow-codewas its only user:lib/core/application/feature-availability.ts, thefeature?field on workspace operations, the check in the shared use-case wrapper, the barrel export, and theFEATURE_NOT_ENABLEDforbidden code (the generated OpenAPI enums drop it).workflow-coderegistry entry and theWORKFLOW_CODEenv fallback.'workflow-code': falseliterals in the org, account and extension providers, and the Code tab's Preview badge.print-command-inventoryno longer emitsentitlementon theworkflows sourceandworkspaces sourcecommands. The worker reads that field as optional.source-feature-gate.integration.ts, the v2 sourcefeature-flag.test.ts,code/feature-flag.integration.ts), the flag-off cases, and theflag === 'workflow-code'mock in 24 integration files. The sandbox-session tests now usedashboards.WORKFLOW_CODE=trueinhttp-e2e.sh, the flag-off app andstart_extra_app. The Code tab UI e2e no longer has flag-off and flag-flip checks; the refresh-error check now refuses the read in the browser.403while workflows as code is not enabled" in the OpenAPI descriptions and route TSDoc, "(preview)" in the CLI, the docs' preview callouts and enablement prerequisites, the troubleshooting bullets, the env-vars "Preview features" section (and its docs baseline heading), the sim-cli README note, the DESIGN.md Rollout section, and the rules' Feature flag section (with.cursorregenerated).Also fixes three small API-doc issues on the blob operations: they document
RESOURCE_ERRORS(they can't return 409 or 423), descriptions name Stage Workspace Source Blobs instead of the HTTP path, and the missing-blobs TSDoc no longer claims that asking renews blobs.Kept, on purpose
workflow-codeMothership entitlement, granted as constanttruein both scopes. Today's worker hides the source commands and the workflow-source skill unless a turn holds it, so dropping it here would turn the feature off in chat. It goes away in Sim PR B, after the Mothership change below is on prod.computeEntitlementsusesPromise.allSettled, so a failing rollout check withholds only its own entitlement (logged) instead of failing the turn and losingworkflow-codewith it. This is a behavior change: an evaluator error used to fail the turn. The owner-shape check (workspace and organization both set) still throws.Rollout and rollback
workflow-codeto{enabled: true}on staging, soak, then prod. This is the zero-code rollback path: flip it back.contracts:syncand delete the constant evaluator, only after that worker is on prod.workflow-codeAppConfig key on staging and prod.Self-hosted upgrade note
On a self-hosted install with
WORKFLOW_CODEunset, workflows as code is off today. After this upgrade it is on: the Code tab shows, and the source API, MCP operations andsim workflows source/sim workspaces sourcecommands answer instead of returning403.WORKFLOW_CODEno longer has any effect.Companion Mothership change (needed before Sim PR B)
bun run generate:cli-inventory), which drops theentitlementfields. Until then the worker'ssim-synccheck (check:cli-inventory) reports drift against Sim staging. Pin this PR in.github/sim-sync-companions/to validate early.worker/scripts/source-primer.ts: dropentitlement: workflow-codeand update thegenerators.test.tsexpectation.build-workflowSKILL.md: make the entitled text thedescriptionand dropentitledDescriptions.ENTITLEMENTS.workflowCodein the same commit as those frontmatter edits. The skill loader'sKnownEntitlementrefine throws on an unknown key.entitlementGate/entitledDescriptionsmachinery only if nothing else uses it.Test plan
bun run generate,lint,type-check,check:audits,check:api-validation:strictlib/workflows,lib/workspace-source,lib/mothership,lib/copilot,lib/core, and the panel, composer, rollout, desktop, access-control and v2 workflow and workspace route suitesentitlementcontent:verify-compatibility(no lost routes, anchors or fences)