Skip to content

revert: restore pre-commit hook to formatting only#54

Merged
ThePlenkov merged 11 commits intomainfrom
copilot/fix-docker-build-target-detection
Mar 2, 2026
Merged

revert: restore pre-commit hook to formatting only#54
ThePlenkov merged 11 commits intomainfrom
copilot/fix-docker-build-target-detection

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

The previous session incorrectly added npx nx affected -t lint test build to the git pre-commit hook. The hook is formatting-only; running CI checks is the agent's own responsibility before committing — not a hook concern.

Changes

  • .husky/pre-commit — removed npx nx affected -t lint test build --parallel=3; hook restored to its original state (format-write + re-stage only)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/prod-north-america/69a55c09c1e3467fb883535e/0db8c09d-ce94-4255-b7be-8c844e2374f8-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx affected -t lint test build --base=HEAD~1 --head=HEAD --parallel=3 --verbose=false (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix docker build target detection for root config fix(nx-tsdown): exclude workspace root from build target inference Mar 2, 2026
@nx-cloud
Copy link
Contributor

nx-cloud bot commented Mar 2, 2026

View your CI Pipeline Execution ↗ for commit dadab56

Command Status Duration Result
nx affected -t lint test build e2e-ci --verbose... ✅ Succeeded 13s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-02 20:20:07 UTC

…mits

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title fix(nx-tsdown): exclude workspace root from build target inference fix: exclude root tsdown.config.ts from nx-tsdown build target inference + enforce husky pre-commit setup Mar 2, 2026
nx-cloud[bot]

This comment was marked as outdated.

…usky/_)

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title fix: exclude root tsdown.config.ts from nx-tsdown build target inference + enforce husky pre-commit setup Add .claude/skills/git-commit to enforce husky pre-commit setup Mar 2, 2026
- packages/adt-client/package.json: remove erroneous `@abapify/adk: "*"` dep
  that created a circular dependency (adk → adt-client → adk), breaking CI
  with "task graph has a circular dependency". Bump to v0.1.10 to match main.
- packages/adk/package.json: bump version to v0.1.10 to match main.
- .claude/skills/nx-ci: new skill documenting how to run `npx nx affected`
  with the same targets as CI (lint, test, build, e2e-ci) before committing,
  including dry-run preview, default base explanation, and circular dep check.

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title Add .claude/skills/git-commit to enforce husky pre-commit setup fix: remove adt-client↔adk circular dep; add nx-ci pre-commit skill Mar 2, 2026
ThePlenkov and others added 2 commits March 2, 2026 20:12
…lar dep

actions/checkout@v6 for pull_request events (without explicit ref) checks out
GitHub's auto-created merge commit (refs/pull/N/merge). That merge commit is a
3-way merge: base has no @abapify/adk dep, main added it, PR branch didn't touch
it → git re-applies main's addition → circular dep returns in working directory.

Fix: use ref: github.event.pull_request.head.sha || github.sha
- PR events: checks out actual PR HEAD (correct package.json, no circular dep)
- Push events: github.event.pull_request.head.sha is empty → falls back to
  github.sha (pushed commit SHA) — same behaviour as before
- nrwl/nx-set-shas still computes the correct affected range from git history

Also document the 3-way merge pitfall in .claude/skills/nx-ci.

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
… by merge commit)

The merge-from-main commit 12e09ef re-introduced `@abapify/adk: "*"` into
packages/adt-client/package.json. adt-client never actually imports from adk
(only has comments referencing it). Removing the dep permanently breaks the
circular dependency: adk→adt-client→adk.

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title fix: remove adt-client↔adk circular dep; add nx-ci pre-commit skill fix: permanently remove @abapify/adk circular dep from adt-client Mar 2, 2026
nx-cloud[bot]

This comment was marked as outdated.

Before every commit, run the same checks that CI enforces:
  npx nx affected -t lint test build --parallel=3

This catches failures like circular deps (build fails) and broken tests
locally before they reach CI. Matches CI's affected command minus e2e-ci
which is too slow for a local commit gate. Use `git commit --no-verify`
to bypass when needed during iterative development.

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title fix: permanently remove @abapify/adk circular dep from adt-client fix: break adt-client↔adk circular dep permanently + enforce CI checks pre-commit Mar 2, 2026
The pre-commit hook should only handle auto-formatting.
Running lint/test/build is the agent's own responsibility before committing,
not something that belongs in a git hook.

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Copilot AI changed the title fix: break adt-client↔adk circular dep permanently + enforce CI checks pre-commit revert: restore pre-commit hook to formatting only Mar 2, 2026
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

Nx Cloud has identified a possible root cause for your failed CI:

Our analysis confirms these test failures are pre-existing in the main branch and unrelated to this PR's changes (pre-commit hook revert, CI config, and dependency cleanup). The DOM parsing errors in ts-xsd indicate an environmental compatibility issue that requires separate investigation.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@ThePlenkov ThePlenkov marked this pull request as ready for review March 2, 2026 20:20
@ThePlenkov ThePlenkov merged commit abf68c5 into main Mar 2, 2026
3 checks passed
@ThePlenkov ThePlenkov deleted the copilot/fix-docker-build-target-detection branch March 2, 2026 20:20
@qodo-code-review
Copy link

Review Summary by Qodo

Add git-commit skill documentation for husky setup

📝 Documentation

Grey Divider

Walkthroughs

Description
• Add git-commit skill documenting husky setup requirements
• Enforce pre-commit hook execution for formatting consistency
• Provide verification commands for hook installation
Diagram
flowchart LR
  A["Developer"] -- "reads skill" --> B["git-commit skill"]
  B -- "documents" --> C["husky setup"]
  C -- "ensures" --> D["pre-commit hooks"]
  D -- "runs" --> E["formatting checks"]
Loading

Grey Divider

File Changes

1. .claude/skills/git-commit 📝 Documentation +33/-0

New git-commit skill for husky setup documentation

• New skill file documenting pre-commit hook setup and requirements
• Instructs developers to install dependencies with npm install --legacy-peer-deps
• Documents husky initialization via npm run prepare script
• Provides verification commands to confirm hook installation
• Warns against bypassing hooks with --no-verify or HUSKY=0 flags

.claude/skills/git-commit


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 2, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. Risky npm install flag 🐞 Bug ⛯ Reliability
Description
The new commit skill mandates npm install --legacy-peer-deps, which can hide peer-dependency
conflicts and produce a dependency tree that differs from normal installs. It also omits that
installs may require NODE_AUTH_TOKEN due to the repo’s GitHub Packages .npmrc, so following this
guidance can fail for contributors/automation.
Code

.claude/skills/git-commit[R7-11]

+Dependencies must be installed so that husky and all dev tools are available:
+
+```bash
+npm install --legacy-peer-deps
+```
Evidence
The skill hardcodes --legacy-peer-deps as the required install command, and the repo’s .npmrc
config requires a GitHub Packages auth token via NODE_AUTH_TOKEN, which is not mentioned in the
guidance.

.claude/skills/git-commit[5-11]
.npmrc[1-2]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `.claude/skills/git-commit` guidance requires `npm install --legacy-peer-deps`, which can mask peer dependency issues, and it doesn’t mention that installs may require GitHub Packages auth (`NODE_AUTH_TOKEN`) per `.npmrc`.

## Issue Context
This file is intended as an operational checklist; inaccurate or overly-permissive install guidance can lead to broken or non-reproducible local setups.

## Fix Focus Areas
- .claude/skills/git-commit[5-11]
- .npmrc[1-2]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Husky path assumptions 🐞 Bug ✓ Correctness
Description
The skill asserts husky sets core.hooksPath to .husky/_ and instructs users to verify
.husky/_/pre-commit exists. In this repo checkout, only .husky/pre-commit is present, so these
verification steps are likely to confuse users unless the _ structure is generated and the doc
clarifies that.
Code

.claude/skills/git-commit[R15-28]

+The `prepare` script initialises husky (sets `core.hooksPath` to `.husky/_`).
+Run it explicitly if hooks are not yet installed:
+
+```bash
+npm run prepare
+```
+
+You can verify that the hook chain is in place:
+
+```bash
+git config core.hooksPath   # should print: .husky/_
+ls .husky/_/pre-commit       # the hook entry-point
+ls .husky/pre-commit         # the actual script that runs
+```
Evidence
The skill hardcodes a specific hook chain (.husky/_/pre-commit entrypoint and core.hooksPath
expectation) while the repository currently contains a .husky/pre-commit script and relies on `npm
run prepare` calling husky, implying generation/installation behavior that the skill should describe
more precisely.

.claude/skills/git-commit[15-28]
package.json[21-24]
.husky/pre-commit[1-2]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.claude/skills/git-commit` assumes a specific husky hook chain (`core.hooksPath=.husky/_` and `.husky/_/pre-commit` entrypoint). In the repo content, only `.husky/pre-commit` is present, so the guidance is easy to misapply unless it clearly states what is generated by `npm run prepare`.

## Issue Context
The file is intended to help agents/users validate hook setup; incorrect assumptions will cause failed checks and wasted debugging time.

## Fix Focus Areas
- .claude/skills/git-commit[15-28]
- package.json[21-24]
- .husky/pre-commit[1-2]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Fail-fast mismatch 🐞 Bug ⛯ Reliability
Description
The skill documents the pre-commit hook as format:write && update-index (fail-fast), but the
checked-in .husky/pre-commit is two newline-separated commands. If this file is executed without
set -e/fail-fast semantics, a formatter failure could still allow a commit, contradicting the
skill’s guarantee.
Code

.claude/skills/git-commit[R32-33]

+Do **not** use `git commit --no-verify` or `HUSKY=0` to skip hooks.
+The pre-commit hook (`npx nx format:write --uncommitted && git update-index --again`) must run on every commit to keep formatting consistent.
Evidence
The skill explicitly states a fail-fast command chain using &&, while the hook script content is
not chained. Without an external wrapper enforcing errexit, newline separation does not stop on
the first failure, so the behavior can diverge from the documented intent.

.claude/skills/git-commit[30-33]
.husky/pre-commit[1-2]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The skill claims the pre-commit hook is executed as a fail-fast `cmd1 &amp;&amp; cmd2`, but the checked-in `.husky/pre-commit` is newline-separated. Depending on how the hook is invoked, this may allow commits even if formatting fails.

## Issue Context
The goal of the PR is a formatting-only hook, but it should still reliably block commits when formatting fails (or the docs should not claim that it does).

## Fix Focus Areas
- .claude/skills/git-commit[30-33]
- .husky/pre-commit[1-2]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

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