Skip to content

feat: add v2 config schema validation#20

Merged
dbrosio3 merged 2 commits into
mainfrom
issue-2-pushgate-schema-validation
May 22, 2026
Merged

feat: add v2 config schema validation#20
dbrosio3 merged 2 commits into
mainfrom
issue-2-pushgate-schema-validation

Conversation

@dbrosio3
Copy link
Copy Markdown
Member

@dbrosio3 dbrosio3 commented May 22, 2026

Description

Closes #2.

Adds the v2 .pushgate.yml config contract and a typed config loader so Pushgate can validate and normalize project config before later deterministic runner and AI provider layers consume it.

This replaces ad hoc YAML parsing assumptions with a versioned schema, actionable validation errors, explicit legacy-file handling, and a config shape that can safely support nested provider settings and argv-based tool commands.

Type of change

  • fix: - Bug fix (patch version bump)
  • feat: - New feature (minor version bump)
  • feat!: / fix!: - Breaking change (major version bump)
  • docs: - Documentation only (no version bump)
  • chore: - Maintenance or config (no version bump)
  • refactor: - Code restructure, no behaviour change (no version bump)

Changes made

  • Add a versioned v2 JSON Schema and TypeScript config loader for .pushgate.yml.
  • Normalize defaults for review, AI mode, tools, and ignored paths into typed internal config objects.
  • Validate invalid versions, unknown keys, unsafe tool command shapes, invalid AI modes, and provider-selection mismatches with actionable errors.
  • Surface migration behavior for legacy .push-review.yml repos, including legacy-only failures and coexistence warnings.
  • Update bundled templates, README examples, and schema docs to use version: 2, nested ai.providers config, argv-array tool commands, and review prompt defaults outside the config surface.
  • Add config fixtures and tests covering valid configs, defaults, schema failures, provider selection, legacy config behavior, and bundled template compatibility.
  • Add the Node config-layer build/test setup and CI path using pnpm and Corepack.

Testing

  • pnpm install --frozen-lockfile
  • pnpm build
  • pnpm test
  • bash -n hook/pre-push passes with no output
  • bash -n install.sh passes with no output
  • Manually tested the hook on a real repository
  • Tested on macOS
  • Tested on Linux

Checklist

  • Commit messages follow Conventional Commits
  • No eval, heredoc variable expansion, or unquoted variable interpolation in shell scripts
  • File lists passed as arrays, never as interpolated strings
  • VERSION, CHANGELOG.md, .release-please-manifest.json, and release-please-config.json were not manually edited - these are managed by release-please
  • New template added to the table in README.md (not applicable)
  • New template name added to install.sh usage comment (not applicable)

Screenshots / output

N/A. This PR adds the v2 config contract, validation layer, docs, templates, and automated coverage.

@dbrosio3 dbrosio3 merged commit 8e262e7 into main May 22, 2026
1 check passed
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.

M0: Freeze v2 config schema and replace ad hoc YAML parsing

1 participant