Skip to content

DevOps Quick Reference: Environments, CI/CD, Testing & Governance

All-in-one DevOps reference for CTA scenarios. Environments, CI/CD pipelines, testing strategy, and governance — combined for rapid review. Tables over prose — this is your pre-board cheat sheet.

Sandbox Comparison Matrix

DeveloperDeveloper ProPartial CopyFull CopyScratch Org
MetadataFullFullFullFullSource-pushed
DataNoneNoneTemplate sampleFull productionScripted
Storage200 MB1 GB5 GBSame as prod200 MB
Refresh1 day1 day5 days29 daysRecreate (ephemeral)
Max lifetimePersistentPersistentPersistentPersistent30 days
Performance testingNoNoNoYesNo
Production dataNoNoSampledYes (mask it!)No
CI/CD useManual devManual devIntegration testStaging/perfPipeline validation

Environment-to-Test Mapping

EnvironmentTests That Run ThereData Needed
Scratch OrgApex unit tests, LWC Jest, static analysis (PMD/ESLint)Test data factory scripts
SIT (Partial Copy)Integration tests, cross-team validation, E2E smokeSandbox template data
UAT (Partial Copy)Business user acceptance testsRepresentative (masked) data
Staging (Full Copy)Performance tests, final regression, smoke testsProduction-scale (masked) data
ProductionPost-deployment smoke tests onlyReal data

CI/CD Pipeline — Step by Step

flowchart TD
    A["Developer commits\nto feature branch"] --> B["Pull Request created"]
    B --> C["CI Pipeline triggers"]
    C --> D["Static Analysis\n(PMD + ESLint)"]
    D --> E{Pass?}
    E -->|No| F["Block merge\nNotify developer"]
    E -->|Yes| G["Create scratch org"]
    G --> H["Deploy source"]
    H --> I["Run Apex tests\n(85%+ coverage)"]
    I --> J["Run LWC Jest tests"]
    J --> K{All pass?}
    K -->|No| F
    K -->|Yes| L["Code review\napproved"]
    L --> M["Merge to develop"]
    M --> N["Deploy to SIT"]
    N --> O["Integration tests"]
    O --> P["Deploy to UAT"]
    P --> Q["UAT sign-off"]
    Q --> R["Deploy to Staging"]
    R --> S["Smoke + perf tests"]
    S --> T["Deploy to Production"]

    style F fill:#e76f51,stroke:#c45a3f,color:#fff
    style T fill:#2d6a4f,stroke:#1b4332,color:#fff
    style K fill:#f4a261,stroke:#d4823e,color:#000

CI/CD Tool Comparison

ToolTypeStrengthCostCTA When to Recommend
GitHub ActionsGeneral CI/CDFlexible, free for public reposFree/PaidTeams already on GitHub
CopadoSF-nativeBuilt for SF, compliance, user storiesExpensiveRegulated industries, admin-friendly DevOps
GearsetSF DevOpsBest diff/merge/compare toolingModerateTeams needing metadata comparison
AutoRABITSF DevOpsFull suite with backup/restoreExpensiveEnterprise with backup requirements
Azure DevOpsGeneral CI/CDEnterprise integration, boardsPaidMicrosoft-centric enterprises
GitLab CIGeneral CI/CDIntegrated repo + CI, self-hostedFree/PaidSelf-hosted requirement

CTA Tool Selection Logic

Don’t recommend a tool — recommend criteria. “We need CI/CD that supports scratch org creation, automated Apex testing, and integrates with our existing Git provider. Given the team uses GitHub, GitHub Actions with the sf CLI is the most cost-effective choice.” The board cares about your reasoning, not brand loyalty.

Deployment Mechanisms Compared

MechanismRollbackVersion HistoryCI/CDDependency MgmtCTA Verdict
Change SetsNoneNoneNoNoneLegacy — migrate away
Salesforce CLIVia source controlGit historyYesManualEnterprise standard
Unlocked PackagesInstall previous versionPackage versionsYesDeclaredBest for modular orgs
Managed PackagesInstall previous versionPackage versionsYesDeclaredISV only
DevOps CenterLimitedBasic trackingPartialNoneTransitional tool

Unlocked Package Architecture

flowchart TD
    CORE["Core Package\n(Objects, Fields,\nPermission Sets)"] --> SALES["Sales Package\n(Flows, LWC, Apex)"]
    CORE --> SERVICE["Service Package\n(Flows, LWC, Apex)"]
    CORE --> INTEG["Integration Package\n(Named Creds,\nExt Services, Apex)"]

    style CORE fill:#1a535c,stroke:#0d3b44,color:#fff
    style SALES fill:#2d6a4f,stroke:#1b4332,color:#fff
    style SERVICE fill:#4ecdc4,stroke:#3ab5ad,color:#000
    style INTEG fill:#f4a261,stroke:#d4823e,color:#000

Feature Flags — Implementation Options

MechanismToggle SpeedScopeDeployment?Best For
Custom Metadata TypeDeploy requiredOrg-wideYes (metadata)Feature gates across environments
Custom SettingsInstant (DML)Per user/profileNo (data)Quick kill switches, user-level control
Custom PermissionsPermission Set assignPer userYes (metadata)User-level feature access

Testing Quick Reference

Test Data Strategies

StrategyDescriptionWhen
Test Data FactoryCentralized @isTest utility classAlways — default approach
@TestSetupCreates data once for all test methodsMultiple methods need same base data
Static ResourcesCSV loaded as test dataBulk tests with specific patterns
SeeAllData=trueTests see real org dataAlmost NEVER — only for specific platform features

Apex Testing Checklist

  • Test data factory pattern (no hardcoded data in tests)
  • Positive tests (happy path)
  • Negative tests (error handling, invalid data)
  • Bulk tests (200 records — trigger bulkification)
  • Boundary tests (0 records, null values, max values)
  • Test.startTest() / Test.stopTest() for governor limit reset
  • HttpCalloutMock for all external callouts
  • Meaningful assertions (not just “it didn’t crash”)
  • 85%+ coverage target (not 75%)

Test Automation Tools

ToolLayerAutomated?CTA Notes
Apex Testing FrameworkUnit + IntegrationFullyFoundation — always include
Jest (@salesforce/sfdx-lwc-jest)ComponentFullyRequired for any LWC
PMDStatic analysis (Apex)FullyFree, catches common issues
ESLintStatic analysis (JS)FullyStandard for LWC JavaScript
ProvarE2E (SF-native)AutomatedUnderstands SF DOM
Copado Robotic TestingE2E (SF-native)AutomatedNo-code test creation

Governance Cheat Sheet

RACI — Simplified CTA Version

ActivityCTA/EADev LeadAdmin LeadPM
Architecture decisionsA, RCCI
Code standardsARII
Declarative standardsACRI
Production deploymentsCRRA
Vendor evaluationA, RCCC
Release planningCRRA

R = Responsible, A = Accountable, C = Consulted, I = Informed

Change Classification

TypeRiskApprovalExample
StandardLowPre-approvedField label, report
NormalMediumCAB reviewNew automation, integration
EmergencyHighExpedited + post-reviewProduction bug, security patch
MajorHighFull CAB + ARBNew cloud, data migration

Compliance — What to Mention at the Board

FrameworkKey SF RequirementCTA Must-Say
GDPRRight to be forgotten, consent management”Data deletion processes, anonymization scripts”
HIPAAPHI encryption, audit logging”Shield Encryption, Event Monitoring, data masking in sandboxes”
SOXAudit trails, segregation of duties”Field Audit Trail, approval process segregation”
PCI-DSSCardholder data protection”Never store card data in SF — use payment gateway integration”

Compliance Overrides Everything

In regulated scenarios, compliance requirements override all architectural preferences. Do not recommend a technically superior solution that violates compliance. Document compliance as architectural constraints.

Reverse-Engineered Use Cases

Scenario 1: Insurance Company — Legacy Modernization

Situation: Insurance company has 15 developers, mix of change sets and manual deployments, no CI/CD, 3 production deployments per year. New CTO wants DevOps modernization.

What you’d do: Phased approach.

  • Phase 1 (Month 1-2): Introduce Git (GitHub), establish branching strategy (modified GitFlow), move all metadata to source control. Keep change sets temporarily for admin changes.
  • Phase 2 (Month 3-4): Set up GitHub Actions pipeline — scratch org validation on every PR. Automated Apex tests + PMD static analysis as merge gates.
  • Phase 3 (Month 5-6): Migrate from change sets to CLI deployments. Introduce unlocked packages (Core, Sales, Claims, Integration). Increase release cadence to monthly.

Governance: Establish ARB (monthly reviews). CAB for all production deployments. Hybrid CoE with central architecture team and BU delivery squads.

Scenario 2: Retail — High-Volume Seasonal Deployments

Situation: Retailer with Black Friday traffic spikes. Needs zero-downtime deployments, feature flags for seasonal promotions, and performance testing with 10M product records.

What you’d do: Feature flags via Custom Metadata Types for all promotional features — deploy code weeks early, activate flags on launch day. Full Copy sandbox for performance testing with production-scale data (10M records). Perf test every SOQL query and batch job.

Deployment: Phased by user group (pilot store first, then regional rollout). Kill switch via Custom Settings for instant disable if issues detected.

Testing: Automated regression suite runs on every PR. Load testing on Full Copy sandbox simulating Black Friday API volume. UAT with business team 2 weeks before promotion launch.

Scenario 3: Government Agency — FedRAMP Compliance

Situation: Federal agency implementing Service Cloud. FedRAMP compliance requires formal change management, audit trails, and government cloud hosting.

What you’d do: Waterfall-hybrid methodology (formal milestones with agile sprints within each phase) to satisfy audit requirements. Copado for CI/CD — its compliance features generate deployment artifacts needed for audits. Shield Event Monitoring for all admin actions.

Environment strategy: Government Cloud with dedicated infrastructure. Full Copy sandbox for staging with complete data masking. No production data in any other environment. Post-copy scripts disable all external integrations and mask all PII.

Governance: Formal CAB with documented approval for every change. ARB quarterly reviews. All architectural decisions recorded as ADRs.

DevOps Maturity Quick Assessment

LevelCharacteristicsCTA Recommendation
Level 1: Ad HocChange sets, manual testing, no source controlIntroduce Git + CLI, basic CI
Level 2: ManagedSource control, some CI, manual deploysAutomate pipeline, add scratch orgs
Level 3: DefinedCI/CD pipeline, automated testing, sandboxesAdd unlocked packages, performance testing
Level 4: MeasuredMetrics-driven, feature flags, fast rollbackOptimize release cadence, continuous deployment
Level 5: OptimizedFull automation, canary releases, self-healingMaintain and innovate

Key Anti-Patterns

Anti-PatternFix
Deploying to prod on FridaysTuesday/Thursday deployment windows (off-peak)
No rollback planDocument rollback for every deployment
Full Copy sandbox with unmasked PIISandboxPostCopy Apex for mandatory masking
One developer with all the knowledgeCross-training, documented runbooks, RACI
Skipping Staging environmentStaging is mandatory for performance validation
No destructive change reviewDestructive changes need code review + CAB approval
”75% coverage is enough”85%+ with meaningful assertions

Sources