fix(flows): ask Shortcut users for their Team, not a Project - #87
Merged
Merged
Conversation
The Shortcut onboarding field asked for a project NAME ("Web app"), and the
Cloud launcher compared it against the story's numeric `project_id` — a test
that cannot ever be true, so every story was silently dropped.
Shortcut scopes work by Group, branded "Team" in its UI. Projects are legacy:
`/api/v3/projects` returns an empty list in a modern workspace and a story's
`project_id` is null there, so no spelling of a project filter could match one.
A story names its team by `group_id`, which Cloud now resolves to a team name
(or matches against the group id directly).
So ask for the thing a story actually carries. `ISSUE_OPTIONAL_FIELDS` already
declares `team`, so the generated Issue type and filter need no other change.
Pairs the generated-filter test's positive with a same-workspace,
different-team negative, so a change that widened the filter into "always
match" cannot pass.
REQUIRES AgentWorkforce/cloud#3690 TO MERGE FIRST. That PR is what teaches the
launcher to accept a `team` setting and to stop mis-comparing `project`; until
it ships, a flow deployed from this field would send a setting Cloud ignores.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
Preview deployed!
This is a Cloudflare Workers preview version of this PR's build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Shortcut onboarding field asked for a project name (placeholder
"Web app"), and the Cloud launcher compared that against the story's numericproject_id."Web app"vs"55"cannot ever be true, so a Shortcut flow silently dropped every story — dispatch matched, then the launcher skipped withfilteredand no reason recorded anywhere.Shortcut scopes work by Group, branded "Team" in its UI. Projects are legacy:
/api/v3/projectsreturns[]in a modern workspace (seenango-integrations/shortcut-relay/tests/list-projects.test.jsonin the cloud repo).project_idisnullthere, and it names its team only bygroup_id.So no spelling of a project filter could ever match such a workspace. This asks for the thing a story actually carries.
What changed
web/lib/flow-sources.ts— Shortcut's field is now{ key: 'team', label: 'Team (group)', placeholder: 'Platform' }.ISSUE_OPTIONAL_FIELDSalready declaresteam(Linear uses it), so the generatedIssuetype and the generated filter need no other change.web/lib/test/flow-sources.test.ts— updated, and its positive is now paired with a same-workspace, different-team negative, so a change that widened the filter into "always match" cannot pass.Merge order
AgentWorkforce/cloud#3690must merge first. That PR is what teaches the launcher to accept ateamsetting and to stop mis-comparingproject. Until it ships, a flow deployed from this field would send a setting Cloud ignores.Note that Shortcut is blocked upstream of both PRs regardless:
nango-integrations/shortcut-relay/has noon-events/directory and no register-webhook action, so nothing registers Shortcut's outgoing webhook and no event arrives until a human creates one in Shortcut's UI. That is a separate defect, tracked outside this change.Verification
npm --workspace web run test— full suite green (numbers in the PR thread).🤖 Generated with Claude Code
Note
Medium Risk
Changes how Shortcut flow settings are stored and filtered; behavior depends on the paired Cloud PR merging first, or Shortcut flows may still not match correctly in production.
Overview
Shortcut flow onboarding no longer asks for a Project name; it asks for Team (group) so saved preferences align with how Shortcut stories are scoped (group/team, not legacy projects).
The UI field in
flow-sources.tsswitches from{ key: 'project', ... }to{ key: 'team', label: 'Team (group)', ... }, with comments explaining why project filtering could never match modern workspaces. Generated filters and validation reuse the existingteamkey (already used for Linear), so no separate type plumbing is required in this repo.Tests in
flow-sources.test.tsnow configure and assert Shortcut matching onteam, including a same workspace, wrong team negative so the filter cannot regress to always passing.Merge note: Cloud launcher support for Shortcut
team(vs the old brokenprojectcompare) must ship first (AgentWorkforce/cloud#3690); until then, flows would send a setting Cloud ignores.Reviewed by Cursor Bugbot for commit 6d94213. Bugbot is set up for automated code reviews on this repo. Configure here.