Skip to content

QUAL-017: introduce BuildContext value object for job builders#391

Merged
ydesgagn merged 1 commit into
masterfrom
refactor/build-context
May 17, 2026
Merged

QUAL-017: introduce BuildContext value object for job builders#391
ydesgagn merged 1 commit into
masterfrom
refactor/build-context

Conversation

@ydesgagn
Copy link
Copy Markdown
Contributor

Summary

Resolves the QUAL-017 data-clump finding from the deep code review. The recurring { options, old_workflow, new_workflow, file_cache, submodules } keyword-argument clump threaded into every job builder is replaced by a single immutable GHB::BuildContext value object. Behaviour-preserving — the existing 321-example suite passes unchanged and RuboCop is clean across all 46 files.

Key changes:

  • New lib/ghb/build_context.rb — immutable value object holding options, old_workflow, new_workflow, file_cache, submodules (referenced objects are still mutated in place by the pipeline; only the container is frozen).
  • Application#execute builds one BuildContext and passes it to all builders; per-builder extras (unit_tests_conditions, dependencies_commands, code_deploy_pre_steps) remain explicit keyword args alongside context:.
  • All 8 builders/managers updated to initialize(context:, ...) and destructure from it: variables, linter, licenses, language, code_deploy, aws, slack job builders + gitignore_manager.
  • 8 corresponding builder specs updated to construct via GHB::BuildContext.new(...).

Types of changes

  • Bugfix (fixes an issue)
  • New feature (adds functionality)
  • Refactoring (improves code without changing functionality)
  • Breaking change (incompatible changes)
  • Build or security update (updates dependencies, libraries, or security patches)
  • Code style or documentation update (formatting, renaming, or documentation changes)
  • Other (please describe):

Checklist

  • Unit tests added to validate my fix/feature
  • I have manually tested my change
  • I did not add automation test. Why ?: Behaviour-preserving refactor; the existing 321-example suite (updated for the new constructor) covers these paths and passes unchanged.
  • Database changes requiring migration with downtime or reprocessing of existing data
  • The SOUP file lists the risk Level, requirements and verification reasoning associated with each library
  • `readme.md` includes sections on introduction, installation, usage, and contributing
  • `docs/architecture.md` includes sections on the architecture diagram, software units, software of unknown provenance, critical algorithms and risk controls related to PII and security
  • Impact on PII, privacy regulations (CCPA/GDPR/PIPEDA), CIS benchmarks or security (availability/confidentiality/integrity); management must be notified

@ydesgagn ydesgagn requested a review from a team as a code owner May 17, 2026 20:52
@ydesgagn ydesgagn merged commit 06c834c into master May 17, 2026
16 checks passed
@ydesgagn ydesgagn deleted the refactor/build-context branch May 17, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants