๐Ÿ”—
ServiceNow ยท Hybrid CI/CD Pipeline โ€” Source Control (DEV/TEST) + App Repository (PROD)
Source Control with apply_remote_changes for DEV & TEST ยท App Repository Publish โ†’ Install for PROD ยท GitHub Actions sncicd-* actions
Source Control โ€” DEV/TEST App Repo โ€” PROD only ATF Suites Change Management SN Official Limitation
๐Ÿšซ
ServiceNow Official Limitations โ€” 3 Hard Constraints You Cannot Work Around โ‘  Source Control NOT on PROD. Official docs: "Source control integration does not support managing applications on a production instance." Using apply_remote_changes on PROD triggers cascade deletes of configuration-linked data โ€” silent and destructive. โ‘ก Publish to App Repo from DEV only. sncicd-publish-app must originate from a non-production (DEV) instance. TEST and PROD instances cannot publish to the App Repository. This is a platform constraint, not a convention. โ‘ข apply_remote_changes = active branch only. The API operates only on the branch currently checked out on the instance. Switch branch in Studio first, then trigger the action โ€” or the wrong code gets applied.
Branch โ†’ Instance Mapping Hybrid โ€” Source Control (DEV/TEST) ยท App Repository (PROD)
๐Ÿ’ป feature/* โ†’ DEV
Developer codes in Studio manual
Studio โ†’ Create Branch
Commit Changes โ†’ GitHub push
Open PR โ†’ develop
๐Ÿ”ต develop โ†’ DEV Instance
Trigger: merge to develop auto
apply_remote_changes API
ATF smoke suite runs
Integration validation
๐ŸŸก release/* โ†’ TEST Instance
Trigger: release/* cut auto
Install from App Repo (official)
Full ATF regression suite
Auto-rollback if ATF fails ๐Ÿ”„
UAT sign-off + CHG raised
๐ŸŸข main โ†’ App Repo โ†’ PROD
Publish App from DEV App Repo
sncicd-publish-app action
Install on PROD via App Mgr
sncicd-install-app on PROD
Hybrid Deployment Flow Source Control โ†’ App Repository โ†’ PROD Install
๐Ÿ”ต Source Control Zone โ€” apply_remote_changes (DEV + TEST only)
๐Ÿ’ป Developer
feature/*
Studio on DEV
Commit โ†’ Push
PR + CI
2 reviews
๐Ÿ”ต DEV Instance
develop
apply_remote_changes
ATF smoke
release/*
branch cut
๐ŸŸก TEST Instance
release/*
apply_remote_changes
Full ATF regression
UAT pass
merge main
๐Ÿ“ฆ App Repository
sncicd-publish-app
from DEV instance
version tagged
CAB approve
Install App
๐ŸŸข PROD Instance
App Manager
sncicd-install-app
ATF critical path
๐ŸŸข App Repository Zone โ€” Publish โ†’ Install (ServiceNow recommended for all PROD deployments)
Official GitHub Actions Pipeline ServiceNow/sncicd_githubworkflow ยท 3 Sequential Jobs
โš™๏ธ Job 1 โ€” Build (PR + push)
sncicd-apply-changes โ†’ DEV SC
sncicd-publish-app โ†’ App Repo DEV only
out: newVersion โ†’ job 2 & 3
๐Ÿงช Job 2 โ€” Test (after build)
sncicd-install-app โ†’ TEST
sncicd-run-atf-suite (full)
sncicd-rollback-app if ATF fails
๐Ÿš€ Job 3 โ€” Deploy Prod (master only)
if: push to master/main only ๐Ÿ”’
sncicd-install-app โ†’ PROD
ATF critical path post-install
โš  Publish constraint: sncicd-publish-app must run from DEV only. The App Repository rejects publishes from TEST or PROD. Build job always targets the non-production source instance.
โ„น Active-branch constraint: apply_remote_changes applies changes for the branch currently active on the instance. Ensure Studio is on the correct branch before the workflow runs.
Git Branch Strategy Adapted Git Flow โ€” App Repo publish points on main
main โ†’ triggers Publish to App Repo
release/* โ†’ TEST (apply_remote_changes)
develop โ†’ DEV (apply_remote_changes)
feature/* โ†’ DEV (Studio)
hotfix/* โ†’ App Repo โ†’ PROD direct
๐Ÿ“ฆ App Repo publish point
๐Ÿ“ฆ Publish v2.4 ๐Ÿ“ฆ Publish v2.4.1 release/v2.4 back-merge hotfix back feature/INC-1042 hotfix/* main release develop feature
All Scenarios โ€” Happy Path to Worst Case
โœ…Happy Path
feature/* โ†’ PR โ†’ develop
CI passes, 2 reviews
apply_remote_changes โ†’ DEV
release/* โ†’ TEST full ATF
UAT pass โ†’ merge to main
๐Ÿ“ฆ Publish to App Repo (DEV)
๐ŸŸข Install on PROD via App Mgr
๐ŸšจCI Failure on PR
PR opened โ†’ CI triggers
Lint / test / CodeQL fails
PR blocked โ€” cannot merge
Dev fixes same feature/*
CI re-runs on new commit
DEV instance untouched โœ“
App Repo never reached
๐Ÿ›Defect in TEST
QA finds bug on TEST
fix/* cut from release/*
Fix built on DEV, committed
PR: fix/* โ†’ release/*
Re-deploy TEST via SC
ATF re-run โ†’ UAT pass
Back-merge release โ†’ develop
๐Ÿ”ฅPROD Incident
Alert fires after install
Find prev stable version
sncicd-rollback-app action
Rolls PROD to prior version
App Repo version history โœ“
Fix via normal cycle after
Never touch PROD Studio ๐Ÿšซ
โšกHotfix (PROD)
hotfix/* cut from main
Fix built on DEV instance
Abbreviated TEST regression
hotfix/* โ†’ main (CAB)
๐Ÿ“ฆ Publish hotfix to App Repo
๐ŸŸข Install on PROD (App Mgr)
Back-merge โ†’ develop โš 
Non-Negotiable Rules
๐Ÿšซ
Never use Source Control on PROD
ServiceNow docs are explicit: apply_remote_changes on PROD triggers cascade deletes of config data. App Repository is the only approved PROD deployment method.
๐Ÿ“ฆ
App Repo = PROD gateway
After TEST passes: merge to main โ†’ sncicd-publish-app from DEV (version tagged) โ†’ sncicd-install-app on PROD via GitHub Actions.
๐Ÿ”
Back-merge every time
Release branch fix or hotfix must always back-merge to develop. Skip once and the same bug reappears guaranteed in the next release.
โฎ๏ธ
PROD rollback = App Repo version
Use sncicd-rollback-app GitHub Action. App Repository maintains full version history โ€” rollback to any prior published version in minutes.
๐Ÿ—๏ธ
One scoped app, one repo
Source Control links at app level. Never mix multiple scoped apps in one repo. Each app gets its own GitHub repo, pipeline, and App Repo entry.
๐Ÿงช
ATF calibrated per environment
DEV โ†’ smoke only. TEST โ†’ full regression. PROD post-install โ†’ critical path only. Never run full regression suite after every PROD install.