Sub topic 2
Tracking Changes with Work Items
Assume you understand Salesforce sandboxes, metadata, Git branches, commits, and pull requests. DevOps Center uses these concepts to move Salesforce changes through a controlled release path.
Tracking Changes with Work Items
A work item is a DevOps Center record for one change, feature, or defect. It connects the business request to:
- A pipeline stage
- A development environment
- A Git branch
- The metadata changes made for the work item
Create a work item in the stage where development begins. Give it a clear title and description. DevOps Center creates or associates a branch for that work item. Keep related changes together so reviewers can understand and test them as one unit.
A work item is not a copy of the data in a sandbox. It tracks source-controlled metadata, such as Apex classes, flows, and custom fields.
Developing in a Sandbox with Change Tracking
Assign a development sandbox to the work item. In that sandbox, make changes with Setup, the Salesforce user interface, or supported development tools.
DevOps Center uses source tracking to detect metadata changes between the connected environment and the work item branch. Change tracking does not automatically decide whether a change is ready for release. Review the detected components and remove unrelated work before committing.
The basic flow is:
Pulling and Committing Changes
When development is ready for review, pull changes from the sandbox into the work item. Pulling retrieves the changed metadata and places it in the work item's source branch. Inspect the component list and resolve any unexpected differences.
Committing records the selected changes in Git. Use a message that explains the purpose, such as Add validation for expired contracts. A commit is a saved version in source control. It does not yet deploy the change to production.
If more work is needed, repeat the pull and commit process. Each commit adds history to the work item branch.
Reviewing Changes with Pull Requests
After the work item contains the intended commits, create a pull request against the branch for the next pipeline stage. A pull request asks reviewers to compare branches and approve a merge.
Reviewers should check the metadata diff, naming, tests, security impact, and acceptance criteria. Resolve comments before merging. A successful review prepares the work item for promotion and the next environment's validation.
Exercise
Why should unrelated sandbox changes be removed before committing a work item?
Show answer
They make the pull request harder to review and can deploy changes that were not tested or approved for that work item.