Skip to content

fix: retain event hooks when override omits events - #5102

Merged
mnriem merged 1 commit into
github:mainfrom
Shubham-Padkonde:fix/5092-keep-events-on-invalid-override
Oct 26, 2026
Merged

mnriem merged 1 commit into
github:mainfrom
Shubham-Padkonde:fix/5092-keep-events-on-invalid-override

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor

Description

Fixes #5092. An integration override such as claude: {} or one with a misspelled evnts key currently acts as events: {}, silently removing every existing event hook during an upgrade.

Treat a missing events field like the other invalid, non-mapping values: warn and preserve the built-in and extension handlers. An explicitly supplied events: {} still disables hooks. This matches the documented override contract and the existing validation comment.

Testing

  • Tested locally using this checkout's virtualenv and an offline sample project.
  • Ran affected existing tests after uv sync --extra test.

Windows / Python 3.14.6:

  • Two regression cases (empty integration entry and misspelled key) fail on the base and pass with this fix. They assert both prior handler layers survive and a warning is logged.
  • .venv/Scripts/python -m pytest tests/specify_cli/events -q: 211 passed, 5 skipped, 4 failed. All four failures occur at os.symlink in existing fixture setup because this Windows environment lacks symlink privileges (WinError 1314), before the changed resolver is called. Existing explicit-empty override tests pass. The full repository suite was not run.
  • Real CLI sample: initialize an offline Claude project, add an extension event, and run integration upgrade claude --force. Both invalid overrides preserve the generated settings.json hooks unchanged. A subsequent explicit events: {} removes them. The test does not invoke Claude or a live model; it exercises the CLI and generated native configuration.
  • git diff --check passes.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance

AI disclosure: OpenAI Codex (GPT-6), operating autonomously on behalf of Shubham-Padkonde, investigated the issue, generated the fix and regression tests, ran validation, and drafted this PR. The exact model variant/reasoning setting is not exposed to the agent. No personal line-by-line human review is claimed.

Assisted-by: Codex (model: GPT-6, autonomous)
@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Oct 25, 2026
@mnriem
mnriem requested a max review from Copilot October 26, 2026 13:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The minimal fix matches the documented contract, with coverage for preserving handlers and explicitly disabling them.

No open issues 🎉

What changed in this PR

Fixes #5092 by preventing incomplete integration overrides from silently removing Spec Kit’s built-in and extension event hooks.

Changes:

  • Treats a missing events field as invalid, preserving existing handlers and logging a warning.
  • Adds regression cases for empty entries and misspelled keys; explicit events: {} still disables hooks.

Validation relied on source inspection and the supplied regression evidence; tests were not rerun.

File Description
tests/​specify_cli/​events/​test_events.py Adds regression coverage for preserving both handler layers and logging warnings.
src/​specify_cli/​events/​__init__.py Stops defaulting a missing events field to an empty override.

Review effort: Max

@mnriem
mnriem merged commit 8563a7d into github:main Oct 26, 2026
16 checks passed
@mnriem

mnriem commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: integration-events.yml entry without an events key silently removes all event hooks

3 participants