Course outline

CI/CD / Integration and candidate foundations / Lesson 7

Configuration and environment identity

Trace the same candidate through different environment configuration without exposing secrets.

About 3 min readContent reviewed
On this page

Lesson goals

  • Separate artifact identity from environment-specific configuration.
  • Verify the intended target and effective configuration before promotion.

Separate code and configuration

A single built candidate can be promoted to different environments while receiving different configuration. Record both the immutable artifact identity and the configuration version or relevant effective values for each deployment. A matching artifact alone does not prove that the application points to the intended database or service. Keep secrets out of logs and review evidence, and treat configuration changes as release decisions.

Inspect a staging fixture

The first JSON fixture describes a synthetic staging deployment with a sandbox payment mode. The digest text is a placeholder label for teaching rather than a valid cryptographic digest or deployment instruction. The example contains no credential and performs no operation. In a real release, record an actual verified digest and inspect the approved target and effective configuration through authorized tooling.

json Synthetic staging configuration
{"artifact_digest":"sha256:0000000000000000000000000000000000000000000000000000000000000000","environment":"staging","payment_mode":"sandbox"}

The environment and sandbox mode identify a test context; the digest is only an illustrative label.

Compare the target configuration

The second fixture uses the same illustrative artifact label but selects production and live mode. This comparison demonstrates that configuration can change behavior even when code identity is unchanged. A release plan should name the approved target, nonsecret configuration version and authorized secret references without recording secret values. Check that the referenced service and environment are actually the intended ones before adoption.

json Synthetic production configuration
{"artifact_digest":"sha256:0000000000000000000000000000000000000000000000000000000000000000","environment":"production","payment_mode":"live"}

The same example candidate has a different target and mode; no deployment is performed.

Find drift and test boundaries

Compare intended configuration with the values actually resolved by the running application, using sanitized evidence and the platform’s access controls. Defaults, stale secret references and differing service endpoints can make staging and production behave differently. Test a safe representative change in a disposable environment and confirm the application rejects a missing required setting rather than silently using an unsafe fallback.

Verify before promotion

A bounded promotion check ties source revision, artifact digest, target, configuration identity and approval to one candidate. Verify the actual destination after deployment and keep a rollback configuration compatible with the previous artifact. Testing with sandbox settings cannot establish live payment behavior; it can verify the intended configuration boundary without contacting real accounts or external payment services.

Common errors and fixes

A tested artifact connects to the wrong production service.

Why it happens
Only the code digest was checked.
How to fix it
Compare the effective target and configuration identity.
Prevent it next time
Review configuration with every promotion.

A secret appears in a release log.

Why it happens
All environment values were printed for debugging.
How to fix it
Remove exposed evidence and follow the organization’s credential response.
Prevent it next time
Log approved nonsecret identifiers only.

A missing required setting silently uses an unsafe default.

Why it happens
Configuration validation was omitted.
How to fix it
Fail clearly on the missing required value.
Prevent it next time
Test missing and invalid settings in isolation.

2 practice exercises

1. Both fixtures use the same artifact label. Are their behaviors necessarily identical?

Show worked solution

No. The staging fixture selects sandbox mode and production selects live mode. The code identity can be the same while configuration changes which external behavior is requested; the fixtures do not perform either operation.

2. What evidence should a promotion reviewer compare without seeing a secret?

Show worked solution

Compare the source revision, verified artifact digest, target environment, approved configuration version and the identity of required secret references. Verify the resolved destination through authorized tooling without printing secret values.

Key takeaways

  • A release identity includes both candidate and target configuration.
  • Validate required settings and keep secrets out of evidence.

Official references