Skip to content

ci: stage employee-app deploy to satisfy prompt-template dependencies - #206

Merged
muenzpraeger merged 4 commits into
mainfrom
fix/employee-app-prompt-template-deploy-order
Jul 8, 2026
Merged

ci: stage employee-app deploy to satisfy prompt-template dependencies#206
muenzpraeger merged 4 commits into
mainfrom
fix/employee-app-prompt-template-deploy-order

Conversation

@muenzpraeger

@muenzpraeger muenzpraeger commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

scratch-org-test began failing at the Push employee source to scratch org step (sf project deploy start -d cc-employee-app) with two component failures:

Type Name Problem
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

Why now?

Not caused by any repo change. scratch-org-test is skipped on Dependabot PRs and only runs on push to main; 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 whole cc-employee-app used 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:

  1. The Generate_Personalized_Schedule prompt 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]".
  2. The FlexiPage and Flow reference the prompt templates, which must be committed before those consumers validate.

Fix

Stage the deploy so each dependency is committed before its consumer:

  1. Apex classes → 2. prompt templates → 3. full cc-employee-app.

Applied to both ci.yml (push to main) and ci-pr.yml (pull requests).

Verification

This PR's scratch-org-test run 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-app in 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

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>
@muenzpraeger
muenzpraeger requested a review from a team as a code owner July 8, 2026 12:58

@github-actions github-actions Bot left a comment

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.

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>

@github-actions github-actions Bot left a comment

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.

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>

@github-actions github-actions Bot left a comment

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.

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>

@github-actions github-actions Bot left a comment

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.

Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.

@muenzpraeger muenzpraeger changed the title ci: deploy prompt templates before referencing components ci: stage employee-app deploy to satisfy prompt-template dependencies Jul 8, 2026
@muenzpraeger
muenzpraeger merged commit b8d5bd0 into main Jul 8, 2026
8 checks passed
@muenzpraeger
muenzpraeger deleted the fix/employee-app-prompt-template-deploy-order branch July 8, 2026 20:45

@github-actions github-actions Bot left a comment

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.

Salesforce Code Analyzer found 15033 violations, including 0 in files changed by this pull request. See job summary page.

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.

1 participant