Git workflows and source integrations
Exam alignment: DOP-C02 Domain 1 task statements for pipelines, testing, artifacts, or deployment.
Learning objective
Choose branch and trigger strategies that support fast integration and traceability.
| Difficulty / Schwierigkeitsgrad | Intermediate |
| Study time / Lernzeit | 120 minutes |
| Prerequisites / Voraussetzungen | Previous lessons in this volume |
Professional scenario
Long-lived branches create large merges and the deployed revision is unclear.
Core concepts
- Trunk-based development favors small frequent integration.
- AWS CodeConnections integrates supported external repositories with CodePipeline.
- PR validation and release delivery should have different side effects.
- Commit ID, artifact version, and digest must be linked.
Architecture flow
- Identify the release input and immutable identity.
- Select the managed AWS control plane and least-privilege role.
- Execute build, test, artifact, or deployment work.
- Collect service events, logs, reports, and runtime metrics.
- Stop, retry, or roll back according to explicit rules.
Decision matrix
| Requirement | Preferred choice | Reason |
|---|---|---|
| Fast integration | Short-lived branches | Less merge delay |
| External Git source | CodeConnections | Managed event integration |
| Release traceability | Commit plus digest | Exact provenance |
Failure modes and troubleshooting
- Pipeline watches the wrong branch.
- Connection is pending or unauthorized.
- Build requires Git history but receives only archive content.
Security and operations
- Use short-lived service roles and least privilege.
- Encrypt artifacts and protect logs from secret exposure.
- Record changes and approvals for audit.
Hands-on lab
Goal / Ziel: Design PR validation and main-branch delivery.
Tasks
- Create the smallest safe test architecture.
- Implement or simulate the main workflow.
- Introduce one controlled failure.
- Diagnose it from service evidence.
- Document cleanup and one improvement.
Validation
- The workflow uses an immutable version.
- A required failure blocks promotion.
- The diagnosis identifies the first failed transition.
Cost control / Kostenkontrolle: Keep resources short lived; read cleanup before starting.
Cleanup
- Delete pipeline/build/deployment resources.
- Delete temporary artifacts, images, logs, and roles.
Exam traps
- Assuming branch name alone identifies deployed bytes.
- Using stored AWS keys at the source provider.
Key takeaways
- Trunk-based development favors small frequent integration.
- Commit ID, artifact version, and digest must be linked.
- Decisions must be justified by requirements and failure behavior.
Review questions
- What is the immutable release identity?
- Which evidence proves failure or success?
- What is the safest recovery action?
Answers
- A version, digest, or uniquely versioned artifact.
- Service events, logs, reports, health checks, and runtime metrics.
- Restore the known-good version using the configured rollback path.