Skip to content

feat: detect features in CLI and pass to /deploy endpoint #5653

Merged
TBonnin merged 5 commits into
masterfrom
tbonnin/nan-4970/cli-features-detection-2
Mar 18, 2026
Merged

feat: detect features in CLI and pass to /deploy endpoint #5653
TBonnin merged 5 commits into
masterfrom
tbonnin/nan-4970/cli-features-detection-2

Conversation

@TBonnin
Copy link
Copy Markdown
Collaborator

@TBonnin TBonnin commented Mar 16, 2026

For now we only detect the use of checkpoints in function code.

This information will then be used to dynamically dispatch checkpointed syncs to Lambda

Notes:

  • built-in templates are supported yet (aka: no features detected for them)
  • nango YAML is not supported

Add CLI feature detection and persist features through deploy pipeline

This PR introduces feature detection in the CLI build pipeline (currently tracking checkpoint usage) and propagates a new features array through parsed definitions, deploy payloads, and persisted sync configs. It adds database support for storing features, updates shared types and validation to include the field, and ensures templates and YAML parsing default to empty feature lists where detection is not supported.

Tests and fixtures are updated to cover feature detection and to include features in expected configs, sync configs, and webhook/job contexts, ensuring the new field is consistently handled across services.


This summary was automatically generated by @propel-code-bot

@TBonnin TBonnin requested a review from a team March 16, 2026 21:02
@linear
Copy link
Copy Markdown

linear Bot commented Mar 16, 2026

} catch (err) {
return Err(new Error('failed_to_detect_features', { cause: err }));
}
}
Copy link
Copy Markdown
Collaborator Author

@TBonnin TBonnin Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went for traversing the code again instead of piggy backing on the compilation step because it would have required to entirely refactor how compilation outcome is handled and returned.
Since this is pure ast traversing, the performance impact is low.

Copy link
Copy Markdown
Contributor

@propel-code-bot propel-code-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review suggests a reliability fix to fail fast when feature detection fails to prevent misrouted syncs.

Status: Changes Suggested | Risk: Medium

Issues Identified & Suggestions
  • Fail fast when feature detection fails to avoid silent misrouting: packages/cli/lib/zeroYaml/deploy.ts
Review Details

📁 18 files reviewed | 💬 1 comments

Instruction Files
├── .claude/
│   ├── agents/
│   │   └── nango-docs-migrator.md
│   └── skills/
│       ├── agent-builder-skill/
│       │   ├── EXAMPLES.md
│       │   └── SKILL.md
│       ├── creating-integration-docs/
│       │   └── SKILL.md
│       └── creating-skills-skill/
│           └── SKILL.md
├── AGENTS.md
└── GEMINI.md

👍 / 👎 individual comments to help improve reviews for you

Comment thread packages/cli/lib/zeroYaml/deploy.ts Outdated
@@ -203,6 +204,15 @@ async function createPackage({
return Err(new Error(`No script files found for "${sync.name}"`));
}

const entryPoint = path.join(fullPath, providerConfigKey, 'syncs', `${sync.name}.ts`);
const features = await detectFeatures({ entryPoint });
if (features.isErr()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

[Reliability] When feature detection fails, the deploy continues and silently sends features: []. That will misclassify checkpointed syncs and route them incorrectly. Please return an error here (and in the action block below) so the deploy fails fast, or explicitly surface this as a hard error to the caller.

Context for Agents
When feature detection fails, the deploy continues and silently sends `features: []`. That will misclassify checkpointed syncs and route them incorrectly. Please return an error here (and in the action block below) so the deploy fails fast, or explicitly surface this as a hard error to the caller.

File: packages/cli/lib/zeroYaml/deploy.ts
Line: 209

Copy link
Copy Markdown
Collaborator Author

@TBonnin TBonnin Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on purpose for now. features will only be used internally and false negative are acceptable for now. It will result in syncs not being candidate for lambdas which would is already the fallback option

@TBonnin TBonnin force-pushed the tbonnin/nan-4970/cli-features-detection-2 branch from 3f06509 to f46a53e Compare March 16, 2026 21:41
propel-code-bot[bot]

This comment was marked as outdated.

Comment thread packages/cli/lib/zeroYaml/deploy.ts Outdated
Comment on lines +259 to +266
const entryPoint = path.join(fullPath, providerConfigKey, 'actions', `${action.name}.ts`);
const features = await detectFeatures({ entryPoint });
if (features.isErr()) {
console.error(
chalk.red(`Error detecting features for "${action.name}"`),
features.error instanceof Error ? features.error.message : features.error
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also potentially be done in parseSync/parseAction in packages/cli/lib/zeroYaml/definitions.ts. "Features" would have to be added to the ParseNangoSync and ParseNangoAction types, and you would access them here with action.features.
However, it would also make it into nango.json, which might not be intentional. So no strong opinion tbh, just pointing it out

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, having it in nango.json also means having it in flows.zero.yaml which we use to deploy preBuilt templates. So this might be a requirement.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. let me look into it

Copy link
Copy Markdown
Collaborator Author

@TBonnin TBonnin Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the features detection to parsing 7bf3cbf
For now not, built-in templates aren't supported

TBonnin added 2 commits March 17, 2026 16:52
To be used in next PR to store features used by a given function.
At first we'll only track use of checkpoints in function.
For now we only detect the use of checkpoints in function code.
This information will then be used to dynamically dispatch checkpointed
syncs to Lambda
@TBonnin TBonnin force-pushed the tbonnin/nan-4970/cli-features-detection-2 branch from f46a53e to 877442a Compare March 18, 2026 14:46
@TBonnin TBonnin changed the title feat: detect features in CLI and pass to /deploy endpoint feat: detect features in CLI and pass to /deploy endpoint Mar 18, 2026
propel-code-bot[bot]

This comment was marked as outdated.

@TBonnin TBonnin force-pushed the tbonnin/nan-4970/cli-features-detection-2 branch from 877442a to 7bf3cbf Compare March 18, 2026 14:55
propel-code-bot[bot]

This comment was marked as outdated.

@NangoHQ NangoHQ deleted a comment from propel-code-bot Bot Mar 18, 2026
@NangoHQ NangoHQ deleted a comment from propel-code-bot Bot Mar 18, 2026
propel-code-bot[bot]

This comment was marked as outdated.

@TBonnin TBonnin force-pushed the tbonnin/nan-4970/cli-features-detection-2 branch from 9d22cc6 to b3d2c6c Compare March 18, 2026 15:22
Copy link
Copy Markdown
Contributor

@propel-code-bot propel-code-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review found no issues; changes appear correct and complete.

Status: No Issues Found | Risk: Low

Review Details

📁 30 files reviewed | 💬 0 comments

Instruction Files
└── .claude/
    ├── agents/
    │   └── nango-docs-migrator.md
    └── skills/
        ├── agent-builder-skill/
        │   ├── EXAMPLES.md
        │   └── SKILL.md
        ├── creating-integration-docs/
        │   └── SKILL.md
        └── creating-skills-skill/
            └── SKILL.md

@TBonnin TBonnin added this pull request to the merge queue Mar 18, 2026
Merged via the queue into master with commit 395e0b2 Mar 18, 2026
25 checks passed
@TBonnin TBonnin deleted the tbonnin/nan-4970/cli-features-detection-2 branch March 18, 2026 19:59
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.

2 participants