Devops center pipeline

From PranavNagrecha/AwesomeSalesforceSkills · View interactive version

Devops center pipeline is an AI agent skill from the GitHub repository PranavNagrecha/AwesomeSalesforceSkills. Use when setting up, managing, or troubleshooting a Salesforce DevOps Center pipeline — including pipeline stages, work items, bundles, promotions, conflict resolution, and GitHub connectivity. Trigger keywords: DevOps Center, work item, pipeline stage, promote changes, bundle. NOT for CLI-based dep

How to use this skill

Skill file

DevOps Center Pipeline

This skill activates when a practitioner needs to set up, operate, or troubleshoot a Salesforce DevOps Center pipeline — the point-and-click release management tool built natively in Salesforce. It covers pipeline design, work item lifecycle, bundle promotion, source control connectivity, and conflict resolution. It does NOT cover SFDX CLI deployments, unlocked packages, or change sets.


Before Starting

Gather this context before working on anything in this domain:


Questions to Ask Before Configuring

| Ask | Why it matters | What a good answer adds |

|---|---|---|

| Is the org on the DevOps Center managed package or the next-generation DevOps Center? | The two are enabled by different Dev Hub settings and only the next-generation one exposes the Devops* / WorkItem objects this skill queries (gotcha 8). | The right troubleshooting path and data model from the first step. |

| Which org is each developer's development environment, and does it have source tracking? | Only source-tracked Developer/Developer Pro sandboxes and scratch orgs qualify; enabling the setting affects sandboxes created or refreshed afterwards (gotcha 3). | A development-environment list that will actually capture changes. |

| Which source control provider and account own the repository? | The provider is GitHub or Bitbucket and the connection runs through a Named Credential; a personal account breaks the pipeline when that person leaves (gotcha 5). | A service-owned provider connection and a named repository. |

| Which stage should start bundling work items together? | Bundling is a per-stage flag (IsBundled); deciding late reshuffles promotions already in flight (gotcha 4). | One agreed bundling stage and a release cadence for it. |

| Which test level must each stage's deployment run? | The default test level runs no tests in sandboxes and all local tests in production, so QA promotions can pass untested (gotcha 7). | An explicit TestLevel per stage and the test list for RunSpecifiedTests. |

| Does anyone deploy to pipeline orgs outside DevOps Center (CLI, change sets, Setup edits in stage orgs)? | Out-of-band changes leave stage branches behind the org; DevOps Center's back sync and rebase operations exist to bring environments back in step (gotcha 2). | A rule that every change to a pipeline org enters as a work item, with back sync as the documented recovery. |

| Who reads failed operations, and where? | Promotion and commit failures are recorded on DevopsRequestInfo with Status = ERROR and ErrorDetails; nobody looking there means stalled promotions sit unnoticed (gotcha 1). | A named owner and the query in Recommended Workflow step 5. |

A proper pipeline setup adds a written stage map, a bundling decision, and a test level per stage before the first work item exists, where "just clicking through the wizard" produces a pipeline whose QA stage runs no tests and whose failures nobody can find.


Core Concepts

Work Items

A work item is a logical unit of work — a user story, task, or bug — that tracks metadata and configuration-data changes until the work is complete and part of the release pipeline. Each work item has its own branch in the repository (the object reference's example branch name is feature/WI-000001). In the next-generation data model, WorkItem.Status moves through NEW, IN_PROGRESS, IN_REVIEW (changes committed and a pull request created for review), READY_TO_PROMOTE, PROMOTED, and finally CLOSED when the work is promoted through the entire pipeline. Two exception states matter for troubleshooting: MERGE_CONFLICT (conflicts must be resolved before promotion) and COMBINED (merged into another work item to resolve conflicts or dependencies). NEVERED marks an inactive item that won't be promoted.

Pipeline Stages

A DevopsPipelineStage connects a pipeline, an environment (DevopsEnvironment, currently always a Salesforce org), and the source control branch used for that stage. Stages are linked through NextStageId; the production stage has a null NextStageId. Promotions move work forward along that chain — a regression found in UAT is fixed by a new work item that starts in development, not by promoting backwards. The repository's default branch (typically main in GitHub) holds the changes you plan to release.

Bundling and Promotion

A stage promotion (DevopsPipelnStgProm) moves one or more work items to the next stage, and DevopsPipelnStgPromWkItem records the merge of each work item into the target stage branch, including the pull request reference. Bundling is configured per stage: DevopsPipelineStage.IsBundled (default false) indicates that work items in that stage are bundled together for promotion. The design decision is therefore which stage bundles, not "create a bundle object".

Conflicts, Combine, Rebase, and Back Sync

When two work items change the same component, the later one reaches MERGE_CONFLICT. The recovery operations DevOps Center records on DevopsRequestInfo.OperationType are REBASE, REBASE_AND_COMBINE, and BACK_SYNC; combining leaves the absorbed work item in COMBINED. A back sync brings changes from a pipeline stage (BackSyncStageId) back into a development environment so developers stop building on stale metadata. The merge itself is recorded per work item on DevopsPipelnStgPromWkItem, whose MergeRemoteReference holds the provider's pull request reference.

Deployments and Test Levels

Each deployment to a stage environment is a DevopsEnvDeployment record with a TestLevel (Default — no tests in sandboxes, all local tests in production; NoTestRun; RunLocalTests; RunAllTestsInOrg; RunSpecifiedTests with the class list in RunTests) and an IsFullDeploy flag (deploy everything in the branch instead of just the changes). Validate-only deployment is not supported in the next-generation DevOps Center.

SELECT Name, OperationType, Status, Message, ErrorDetails, RequestCompletionDate
FROM DevopsRequestInfo
WHERE Status IN ('ERROR', 'INTERRUPTED')
ORDER BY CreatedDate DESC
LIMIT 20

Common Patterns

Mode 1: Simple Linear Pipeline (Admin Team)

When to use: A small admin team with one source-tracked Developer sandbox and production. Minimal parallel work. Moving from change sets to a source-tracked workflow.

How it works:

  1. Turn on source tracking for sandboxes in production (SourceTrackingSettings.enableSourceTrackingSandboxes) and refresh or create the Developer sandbox afterwards.
  2. Enable DevOps Center, connect the source control provider through its Named Credential, and create or connect the repository.
  3. Create a pipeline with two stages: Development and Production (production's NextStageId is empty).
  4. Create a work item per change; it gets its own branch.
  5. Make the change in the development environment, commit it to the work item, and move it to READY_TO_PROMOTE.
  6. Promote it; check the resulting DevopsRequestInfo record if the promotion does not reach SUCCESS.

Why not change sets: Change sets have no version history and no conflict detection; DevOps Center records every change against a work item and a branch while staying point-and-click.

Mode 2: Multi-Stage Pipeline with a Bundling Stage (Mid-Size Team)

When to use: A team running parallel sprints whose work items share components (page layouts, permission sets, flows).

How it works:

  1. Stages Dev → QA → UAT → Production, each a different environment.
  2. Developers promote individual work items into QA as they finish.
  3. Set IsBundled on the stage where the release is assembled (commonly UAT), so items there promote onward together.
  4. Set an explicit test level for every stage deployment; do not rely on Default for QA and UAT.
  5. After each promotion into a shared stage, back sync development environments that build on it.

Why bundling matters: Without a bundling stage, two items that touch the same flow promote separately and the second one hits MERGE_CONFLICT at whichever stage it reaches last.

Mode 3: Combining Work Items to Manage Dependencies

When to use: Work item B depends on work item A (a flow that references A's new field), so promoting B alone fails.

How it works: Combine the items (recorded as REBASE_AND_COMBINE); the absorbed item moves to COMBINED and its changes travel with the surviving item. Confirm both are on the same release schedule first — the combined item promotes as one unit.


Decision Guidance

| Situation | Recommended Approach | Reason |

|---|---|---|

| Single developer, two orgs, no parallel work | Individual work item promotion, no bundling stage | Bundling adds overhead with no benefit when there is no parallelism |

| Multiple developers, shared metadata components | Set IsBundled on the release-assembly stage | Work items in that stage promote together; one deployment per release |

| Work items have a metadata dependency | Combine them before promoting | The dependent components travel in one item |

| Promotion stuck or failed | Query DevopsRequestInfo for ERROR / INTERRUPTED, read ErrorDetails | The request record is the documented place to troubleshoot stalled operations |

| Development environment is behind the stage it builds on | Back sync from that stage | BackSyncStageId names the stage changes flow back from |

| Team also uses SFDX CLI deployments alongside DevOps Center | Separate the orgs completely — do not mix (team practice) | CLI deploys leave stage branches and work item records describing a different org |

| Need rollback after a bad production promotion | Create a new work item that reverts the change and promote it through all stages (team practice) | Keeps the branch history and the org in step |


Recommended Workflow

  1. Identify the DevOps Center edition from settings/DevHub.settings-meta.xml (enableDevOpsCenterGA vs enableALMDevopsCorePref) and confirm source tracking for development sandboxes from settings/SourceTracking.settings-meta.xml.
  2. Fill in templates/devops-center-pipeline-template.md: stage map (environment, branch, next stage), bundling stage, and test level per stage; answer every row of the Questions table above.
  3. Export the stages with sf data query -o <devops-center-org-alias> -q "SELECT Id, Name, DevopsPipelineId, NextStageId, IsBundled, DevOpsEnvironmentId FROM DevopsPipelineStage" --json > devops/stages.json and run python3 skills/devops/devops-center-pipeline/scripts/check_devops_center_pipeline.py --manifest-dir . over the project; fix every ERROR (no production stage, a cycle in NextStageId).
  4. Run a first work item end to end through every stage before onboarding the team; record the DevopsEnvDeployment test level that actually ran.
  5. For any stuck promotion, run the DevopsRequestInfo query in Core Concepts and act on ErrorDetails; for MERGE_CONFLICT, rebase or combine, then back sync affected development environments.
  6. Re-run the checker and the Review Checklist before the first production promotion.

Review Checklist

Run through these before marking work in this area complete:


Salesforce-Specific Gotchas

Full list in references/gotchas.md. The three that cost the most time:

  1. Failures live on the request record — DevopsRequestInfo.ErrorDetails holds the error for a failed promotion, commit, or back sync.
  2. Default test level skips tests in sandboxes — a QA stage on Default promotes without running Apex tests.
  3. Validate-only deployments are not supported in the next-generation DevOps Center — plan check-only runs outside it.

Output Artifacts

| Artifact | Description |

|---|---|

| Pipeline stage design | Mapping of pipeline stages to environments, branches, next stage, bundling flag, and test level |

| Work item workflow guide | Status path from NEW to CLOSED, including MERGE_CONFLICT and COMBINED handling |

| Bundling decision | Which stage bundles and why |

| Troubleshooting query | DevopsRequestInfo query and the owner who runs it |

| Pre-production promotion checklist | Verification steps before promoting to production |


Reference Files

| File | Use it for |

|---|---|

| references/examples.md | Change-set-to-DevOps Center migration, a bundling-stage sprint, and the CLI-mixing anti-pattern |

| references/gotchas.md | Eight platform behaviours with avoidance steps |

| references/llm-anti-patterns.md | Answers AI assistants get wrong about DevOps Center |

| references/well-architected.md | Pillar framing and the corpus lines behind each claim |

| references/metadata-examples.md | Dev Hub and source tracking settings XML, stage export JSON, and troubleshooting SOQL |


Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.