Skip to content

[Initiative] Config-Driven git-receive-pack Hook Orchestration and Admission Phase Routing #107

@juliuskrah

Description

@juliuskrah

Summary

Implement runtime-configurable git-receive-pack hook orchestration so GitStore can enable or disable hook phases via environment variables and route admission control to the configured phase.

This wires the following environment variables into executable behavior:

  • GITSTORE_HOOKS_GIT_RECEIVE_PACK_PRE_RECEIVE_ENABLED
  • GITSTORE_HOOKS_GIT_RECEIVE_PACK_UPDATE_ENABLED
  • GITSTORE_HOOKS_GIT_RECEIVE_PACK_POST_RECEIVE_ENABLED
  • GITSTORE_HOOKS_GIT_RECEIVE_PACK_PROC_RECEIVE_ENABLED
  • GITSTORE_HOOKS_GIT_RECEIVE_PACK_POST_UPDATE_ENABLED
  • GITSTORE_ADMISSION_CONTROL_VALIDATING_ADMISSION_POLICY_PHASE

Scope

In Scope

  • Parse and validate git-receive-pack hook phase configuration from environment.
  • Enable or disable each supported git-receive-pack hook phase at runtime.
  • Route ValidatingAdmissionPolicy execution to the configured phase (default pre-receive).
  • Enforce phase compatibility rules, including fail-fast behavior when admission control targets a disabled or unsupported hook phase.
  • Emit structured startup logs showing enabled hook phases and the active admission-control phase.
  • Add integration tests for phase enable/disable behavior, admission phase routing, and invalid configuration handling.

Out of Scope

Acceptance Criteria

  • Hook execution respects all GITSTORE_HOOKS_GIT_RECEIVE_PACK_*_ENABLED flags.
  • GITSTORE_ADMISSION_CONTROL_VALIDATING_ADMISSION_POLICY_PHASE is parsed and validated at startup.
  • Invalid phase values or disabled-target-phase configurations fail fast with actionable errors.
  • Admission control executes exactly once in the configured hook phase when enabled.
  • Startup logs clearly report enabled hook phases and the active admission phase.
  • Integration tests cover valid config, invalid config, and disabled-phase edge cases.

Dependencies

Tracking

  • Milestone: TBD

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions