fix(trigger): skip canonical-paired members when validating required fields on deploy#4100
fix(trigger): skip canonical-paired members when validating required fields on deploy#4100waleedlatif1 wants to merge 2 commits intostagingfrom
Conversation
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit c7ae3ef. Configure here. |
Greptile SummaryThis PR fixes a bug in Confidence Score: 5/5Safe to merge — targeted bug fix with correct two-pass canonical validation logic and no regressions introduced. The change is minimal and well-scoped: it adds No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[buildProviderConfig called] --> B[buildCanonicalIndex from triggerDef.subBlocks]
B --> C[Filter relevantSubBlocks\nmode: trigger or trigger-advanced]
C --> D["Pass 1: Collect values\n(iterate relevantSubBlocks)"]
D --> E{subBlock has\nnon-empty value?}
E -- Yes --> F[Add to providerConfig]
F --> G{Has canonicalParamId?}
G -- Yes --> H[Mark canonicalId\nas satisfied]
G -- No --> I[Continue]
H --> I
E -- No --> I
I --> J{More subBlocks?}
J -- Yes --> D
J -- No --> K["Pass 2: Validate required fields\n(iterate relevantSubBlocks)"]
K --> L{Value already\nin providerConfig?}
L -- Yes --> M[Skip - continue]
L -- No --> N{In a satisfied\ncanonical group?}
N -- Yes --> M
N -- No --> O{isFieldRequired?}
O -- Yes --> P[Add to missingFields]
O -- No --> Q[Continue]
P --> Q
Q --> R{More subBlocks?}
R -- Yes --> K
R -- No --> S[Return providerConfig\n+ missingFields]
Reviews (1): Last reviewed commit: "fix(trigger): skip canonical-paired memb..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c7ae3ef. Configure here.
| if (isFieldRequired(subBlock, subBlockValues)) { | ||
| missingFields.push(subBlock.title || subBlock.id) | ||
| } | ||
| } |
There was a problem hiding this comment.
Stale baseConfig values bypass required field validation
Medium Severity
The second-pass guard providerConfig[subBlock.id] !== undefined can be satisfied by stale values inherited from baseConfig (spread into providerConfig at initialization), not just values set during the first pass. If triggerConfig contains a leftover entry for a field the user has since cleared, the required-field check is silently skipped, allowing deployment with missing required fields. The old code always validated against getConfigValue results regardless of providerConfig contents. A separate Set tracking first-pass fills would be more reliable than checking providerConfig.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c7ae3ef. Configure here.
…sing required-field validation Use a dedicated `filledSubBlockIds` Set populated during the first pass so the second-pass skip guard is based solely on live `getConfigValue` results, not on stale entries spread from `baseConfig` (`triggerConfig`).
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Addressed the Cursor Bugbot comment (discussion_r3066873288): Bug confirmed. The second-pass guard Fix: Introduced a dedicated Pushed in commit 402462a. |
|
Closing in favour of #4101 which includes all of these changes plus the broader polling trigger fixes — combined into a single PR since they're tightly coupled. |


Summary
buildProviderConfignow usesbuildCanonicalIndexto group canonical pairs before validating required fieldsspreadsheetId) and advanced (manualSpreadsheetId) members of a canonical pair were validated independently — so selecting a spreadsheet via the file-selector still triggered a "Missing required fields" error because the advanced twin was emptyType of Change
Testing
Tested manually — Google Sheets trigger with Spreadsheet and Sheet Tab selected via file/sheet selectors now deploys without "Missing required fields" error
Checklist