ci: stage employee-app deploy to satisfy prompt-template dependencies - #206
Conversation
The employee-app CI deploy started failing with two component errors: - FlexiPage Experience_Record_Page: 'Generate_Guest_Reviews_Summary isn't a valid value for Generative Prompt Template' - Flow PersonalizedSchedule: invalid reference to 'Generate_Personalized_Schedule.promptResponse' Both are GenAiPromptTemplate resolution failures: the FlexiPage and Flow reference prompt templates that deploy in the same transaction, and a platform change now requires the templates to exist before their consumers are validated. Deploy the genAiPromptTemplates directory first, then the full cc-employee-app, so the references resolve. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.
The same GenAiPromptTemplate ordering fix is needed in ci-pr.yml (the workflow that validates pull requests), not just ci.yml (push to main). Without this, the PR's own scratch-org-test doesn't exercise the fix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.
Correcting the earlier approach. The real failure is that the Generate_Personalized_Schedule prompt template has an Apex data provider (apex://PersonalizedGuestExperiences), and the platform now validates that reference at deploy time: GenAiPromptTemplate Generate_Personalized_Schedule: We can't find the related records for the prompt template [apex://PersonalizedGuestExperiences] So the template must deploy AFTER its Apex class, not before. Deploy the employee Apex classes first, then the full cc-employee-app, so the template resolves its data provider. Applied to both ci.yml (push) and ci-pr.yml (pull request) so the PR actually validates the fix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.
The prompt templates and the components that reference them (FlexiPage Experience_Record_Page, Flow PersonalizedSchedule) can't all deploy in one transaction anymore. CI evidence established the dependency chain: - Apex classes deploy cleanly on their own - templates alone: 3/4 deploy, Generate_Personalized_Schedule needs its Apex data provider (apex://PersonalizedGuestExperiences) - classes-first then full app: templates deploy but the FlexiPage/Flow can't resolve templates committed in the same transaction So deploy in three stages — Apex classes, then prompt templates, then the full employee app — so each dependency is committed before its consumer is validated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.
There was a problem hiding this comment.
Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.
Problem
scratch-org-testbegan failing at the Push employee source to scratch org step (sf project deploy start -d cc-employee-app) with two component failures:Experience_Record_PageGenerate_Guest_Reviews_Summaryisn't a valid value for Generative Prompt TemplatePersonalizedScheduleGenerate_Personalized_Schedule.promptResponseWhy now?
Not caused by any repo change.
scratch-org-testis skipped on Dependabot PRs and only runs on push tomain; the employee-app metadata was unchanged since the v65 upgrade. This is platform drift — the platform now validates GenAiPromptTemplate dependencies at deploy time, and the wholecc-employee-appused to deploy in a single transaction.Root cause (established via CI)
The employee app can no longer deploy as one transaction because of a dependency chain the deploy can't self-order:
Generate_Personalized_Scheduleprompt template has an Apex data provider (apex://PersonalizedGuestExperiences) that must exist first — deploying templates alone fails with "We can't find the related records for the prompt template [apex://PersonalizedGuestExperiences]".Fix
Stage the deploy so each dependency is committed before its consumer:
cc-employee-app.Applied to both
ci.yml(push to main) andci-pr.yml(pull requests).Verification
This PR's
scratch-org-testrun passes end-to-end (full scratch-org deploy + Apex tests). The staged ordering was arrived at empirically from the failures each intermediate attempt surfaced.Note for maintainers
Real users deploying
cc-employee-appin one shot will hit the same ordering issue — the staged deploy likely belongs in the setup instructions / install script too. Flagging for your call; out of scope for this CI fix.🤖 Generated with Claude Code