Commits included in DevOps change request
Summarize
Summary of Commits included in DevOps change request
The process of determining which commits are included in a DevOps change request is guided by the DevOps artifact package and associated artifact versions. The inclusion of commits varies based on the change type, which can be manual or automated. Understanding this process is crucial for effectively managing changes in ServiceNow's DevOps environment.
Show less
Key Features
- Change Type:
- Manual: Includes commits from the artifact versions and task executions related to the change.
- Automated:
- Without Package: All commits from linked artifact versions are included.
- With Package: Includes commits from the last successful prod deploy if there is an upstream task with a prod deploy step; otherwise, all artifact version commits are included.
- Commit Types:
- Normal Commits: Associated with the change request from the tracked repository.
- Revert Commits: Not associated if marked as revert.
- Merge Commits: Special commits that combine changes from branches.
- Squash and Merge: Keeps changes without individual commit history.
- Commit Calculation Logic: All commits from pipeline executions in the same branch are associated with the artifact version created, allowing for clear tracking of changes.
Key Outcomes
By understanding the commit inclusion rules and types, ServiceNow customers can effectively manage their DevOps change requests. Customers can anticipate that:
- All relevant commits will be accurately captured based on the specified change type.
- Change requests will reflect the current state of artifact versions, ensuring that only appropriate commits are included.
- Commit associations will remain consistent across different branches, providing clarity within the change management process.
The DevOps artifact package and its associated artifact versions are used to determine which commits are included in a DevOps change.
| Change type | Commits included |
|---|---|
| Manual | Commits from the artifact versions of the package in the change. In addition, the commits from task executions of all the pipeline executions in the change reference record when the data_type column is plan or pipeline execution are included. |
| Automated |
|
- Major version 2
- Minor version 0
- Patch/hotfix version 1
Failed task executions between the previous and current artifact versions that did not build an artifact but have associated commits are also associated to the created artifact version.
Types of commits
- Normal commits: Commits on the tracked repository are associated to the change request.
- Revert commits: Commits that have the revert field value as true. A revert commit results in a reverted commit and revert commit in the source tree. Both the commits are not associated to the change request.
- Merge commits: Commits that have the merge field value as true.
- Merge commit: The source tree tracks the commit to a branch over time and allows for a special merge commit to be made. This merge commit combines the parent commits located directly after the most recent common commit on both the current branch and the branch to be merged. Merge commit adds a new commit on the main branch.
- Squash and merge: Squashing during a merge generates the working tree and index state to match a merge without creating a merge commit. Squash and merge keeps the changes but removes the individual commits from history. It has a single commit with the merge value as true.
Example: Commits and packages
- Three build pipelines (A, B, and C)
- A release pipeline (ABC) under change control, with four packages:
- Build pipeline A (major version 1)
- Build pipelines A and B (major version 1)
- Build pipelines B and C (major version 1)
- Build pipelines A, B, and C (major version 1)
| Commit | Build pipeline | Semantic version | Included in package |
|---|---|---|---|
| 1 | A | 1.0.0 | X |
| 2 | A | 1.0.1 | -- |
| 3 | A | 1.1.0 | X |
Note: Commit 2 (build A, semantic version 1.0.1) is not included in the package because the
semantic version syntax indicates a patch or hot fix. |
|||
| Commit | Build pipeline | Semantic version | Included in package |
|---|---|---|---|
| 4 | A | 1.1.1 | -- |
| 5 | A | 1.2.0 | X |
| 6 | A | 1.2.0 | X |
| 7 | B | 1.0.0 | X |
| 8 | B | 1.0.0 | X |
| 9 | B | 1.1.0 | X |
| 10 | B | 1.1.0 | X |
Note: Commit 4 (build A, semantic version 1.1.1) is not included because the semantic
version syntax indicates a patch or hot fix. |
|||
| Commit | Build pipeline | Semantic version | Included in package |
|---|---|---|---|
| 11 | A | 1.3.0 | -- |
| 12 | B | 1.2.0 | X |
| 13 | B | 1.2.0 | X |
| 14 | C | 1.0.0 | X |
| 15 | C | 1.0.0 | X |
| 16 | C | 1.0.0 | X |
Note: Commit 11 (build A, semantic version 1.3.0) is not included because the package does
not specify build A. |
|||
| Commit | Build pipeline | Semantic version | Included in package |
|---|---|---|---|
| 17 | A | 1.4.0 | X |
| 18 | A | 1.4.0 | X |
| 19 | B | 1.3.0 | X |
| 20 | B | 1.3.0 | X |
| 21 | C | 1.1.0 | X |
| 22 | C | 1.1.0 | X |
| 23 | C | 1.2.0 | X |
| 24 | C | 1.2.0 | X |
Note: Commit 11 is also included in this package because it is part of the changes in major
version 1 of build A since the last package (including major version 1 of build A),
package #2, was deployed to production. |
|||
Example: Commit calculation logic
Use case with the logic for calculating commits that get associated to artifact versions. The branch information is included whenever the commits are defined.
For example, consider two pipelines, one on the main branch, one on the test branch. Run scenario:
- Create a commit C0 on main, run CI build, but don’t create Artifact Version.
- Create a commit C1 on test, run CI build, but don’t create Artifact Version.
- Create a commit C2 on main, run CI build and the build fails.
- Create 2 commits C3,C4 on main, run a CI build and create an Artifact Version (v1.0).
- Create 1 commit C5 on main, run CI build, but don’t create Artifact Version.
- Create 1 commit C6 on main, run CI build and create an Artifact Version (v2.0).
- All commits from pipeline executions (success & failed) in the same branch, between last Artifact Version for a given Artifact and current Artifact Version, are associated.
- If no previous Artifact Version for the given Artifact is found, then all commits from pipeline executions in the same branch are associated.
Continuing with the use case:
Create a release with Artifact Version from the previous step, have a CD pipeline with Step type = Prod Deploy.
- Release is associated with the same Artifact Version (v2.0).
- Change Request created shows Artifact Version (v2.0) and Commits C0, C2, C3, C4, C5, C6.
- Commits from both Artifact Versions (v1.0, v2.0) built on main branch (no previous package was deployed to Prod) are shown in the change request, but not the commit from execution on test branch.
- The number of commits shown in the change request will be the same as the number in the tool.
- Create 2 commits C7, C8 on test branch, run CI build and create an Artifact Version.
Expected result: Artifact Version (v3.0) is associated to C1, C7, C8.
- Create 2 commits C9, C10 on main branch, run CI build and create an Artifact Version.
Expected result: Artifact Version (v4.0) is associated to C9, C10.
- Create a release with Artifact Version from previous step (v4.0), have a CD pipeline with Step type = Prod Deploy.Expected result:
- Release is associated with Artifact Version (v4.0).
- Change Request created shows Artifact Version (v4.0) and commits C9, C10.
- The change request shows commits just from the latest Artifact Version built on main branch, as commits from previous Artifact Versions built on main had been deployed to Prod on the previous package.
- No commits from Artifact Version built on test are shown.
- The number of commits shown in the change request will be the same as the number in the tool.