-
Notifications
You must be signed in to change notification settings - Fork 0
fix(sdk): widen --on trigger grammar; write Linear closing reference #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
77373a3
efa8bed
d62e9f6
3d53d12
4f71ab5
d7214ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,18 +23,20 @@ import { assertNoUseDependencies, collectExtensionSubmissions } from './flow-ext | |
| * inside a fresh branch of the deployment's repository. | ||
| */ | ||
|
|
||
| export const FLOW_TRIGGER_PROVIDERS = ['github', 'linear', 'jira', 'shortcut', 'slack'] as const; | ||
| export const FLOW_TRIGGER_PROVIDERS = ['github', 'gitlab', 'linear', 'jira', 'shortcut', 'slack'] as const; | ||
| export type FlowTriggerProvider = (typeof FLOW_TRIGGER_PROVIDERS)[number]; | ||
|
|
||
| /** Settings Cloud's launcher prefilter reads per provider (`flow-trigger-sources.ts`). */ | ||
| const PROVIDER_SETTINGS: Record<FlowTriggerProvider, readonly string[]> = { | ||
| // `events`: `issues` (default) or `pull_request` — which GitHub records | ||
| // wake the listener (AgentWorkforce/cloud#3772). | ||
| github: ['repository', 'labels', 'contains', 'events'], | ||
| // wake the listener (AgentWorkforce/cloud#3772). `reviews`, `checks` and | ||
| // `comments` opt a pull_request source out of its extra subscriptions. | ||
| github: ['repository', 'labels', 'contains', 'events', 'reviews', 'checks', 'comments'], | ||
| gitlab: ['project', 'labels', 'contains', 'events'], | ||
| slack: ['channel', 'contains'], | ||
| linear: ['team', 'contains'], | ||
| jira: ['project', 'contains'], | ||
| shortcut: ['workspace', 'contains'], | ||
| linear: ['team', 'project', 'labels', 'contains'], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: This allowlist adds valid Prompt for AI agents |
||
| jira: ['project', 'labels', 'contains'], | ||
| shortcut: ['workspace', 'team', 'labels', 'contains'], | ||
|
Comment on lines
+37
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Cloud's deploy-link parser or onboarding emits a Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Add GitLab to the trigger grammar. The new allowlist covers Linear, Jira, and Shortcut, but 🤖 Prompt for AI Agents
cubic-dev-ai[bot] marked this conversation as resolved.
|
||
| }; | ||
| const MAX_SOURCE_BYTES = 256_000; | ||
| const MAX_SETTING_LENGTH = 500; | ||
|
|
@@ -135,12 +137,23 @@ export function parseTriggerSource(value: string): FlowTriggerSource { | |
| if (key === 'events') { | ||
| // Cloud's enum is lowercase; send it that way whatever the shell typed. | ||
| const events = setting.toLowerCase(); | ||
| if (!['issues', 'pull_request'].includes(events)) { | ||
| throw new CloudFlowError('invalid_input', `github events must be "issues" or "pull_request", got "${setting}".`); | ||
| const valid = provider === 'gitlab' ? ['issues', 'merge_request'] : ['issues', 'pull_request']; | ||
| if (!valid.includes(events)) { | ||
| throw new CloudFlowError('invalid_input', | ||
| `${provider} events must be ${valid.map(v => `"${v}"`).join(' or ')}, got "${setting}".`); | ||
| } | ||
| settings[key] = events; | ||
| continue; | ||
| } | ||
| if (provider === 'github' && (key === 'reviews' || key === 'checks' || key === 'comments')) { | ||
| // Subscription opt-outs are boolean; Cloud refuses any other value. | ||
| const toggle = setting.toLowerCase(); | ||
| if (!['true', 'false'].includes(toggle)) { | ||
| throw new CloudFlowError('invalid_input', `github ${key} must be "true" or "false", got "${setting}".`); | ||
| } | ||
| settings[key] = toggle; | ||
| continue; | ||
| } | ||
| settings[key] = setting; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.