You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Phoenix500526 (via GitHub)" <gi...@apache.org> on 2026/08/29 06:02:42 UTC

[PR] feat(ci): add fast local validation hooks [maka]

Phoenix500526 opened a new pull request, #4132:
URL: https://github.com/apache/maka/pull/4132

   ## Summary
   
   Agent-assisted changes can violate repository invariants that only surface
   after a branch is pushed, causing an avoidable CI failure and another
   edit-push cycle.
   
   Install lightweight local Git hooks through the normal npm setup so agents
   and developers receive that feedback at commit time:
   
   - `pre-commit` checks staged formatting and lint, ASF headers for newly added
     files, Runtime Host protocol epoch changes, and basic diff errors.
   - `commit-msg` validates Conventional Commit messages with the standard
     commitlint configuration.
   - Installs that omit root development dependencies continue to work, and hook
     commands never download fallback packages.
   
   ## Verification
   
   - `npm install --package-lock-only --ignore-scripts --no-audit --no-fund`
   - `npm run lint`
   - `npm run format:check`
   - `node --test --test-concurrency=1 scripts/protocol-epoch-check.test.mjs scripts/asf-license-headers.test.mjs` — 56 passed
   - `npm run check:asf-headers`
   - `npm run build`
   - `npm run typecheck`
   - Confirmed `commit-msg` rejects a non-conventional message.
   - Confirmed Husky setup skips cleanly when root development dependencies are
     omitted.
   
   ## AI use
   
   Select exactly one:
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex implemented the hooks and staged checks,
   added tests, and ran verification.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(ci): add fast local validation hooks [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #4132:
URL: https://github.com/apache/maka/pull/4132#discussion_r3889679444


##########
.husky/pre-commit:
##########
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+./node_modules/.bin/biome check --staged --no-errors-on-unmatched

Review Comment:
   Thanks for wiring the hook to the checkout-local Biome binary. In an isolated Git fixture this [P2] category ① command selected the staged path but checked the working-tree bytes, not the index snapshot: staging an unformatted file and then formatting only the working tree made the full hook return 0 while `git diff --cached` still contained the unformatted version; the inverse produced a false failure. That means the hook can allow a commit that CI will reject and can block a valid staged commit. I suggest running Biome against an index materialization (or another index-aware seam) and adding a regression where staged and working-tree contents deliberately differ. Please push back if there is an intended Biome/index contract I have missed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(ci): add fast local validation hooks [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #4132:
URL: https://github.com/apache/maka/pull/4132#discussion_r3885892858


##########
.husky/pre-commit:
##########
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+npx --no -- biome check --staged --no-errors-on-unmatched

Review Comment:
   **[P2] Resolve hook executables only from this checkout**
   
   `npx --no` does not guarantee that this command uses the repository’s local binary. With no local dependencies and npm in offline mode, I reproduced this command successfully executing cached `biome@0.3.3`, which is an unrelated package rather than this repository’s `@biomejs/biome@2.5.9`.
   
   This can make a stale hook or omit-dev checkout run the wrong cached package. Please invoke an explicitly local binary—or fail clearly when it is absent—in both the Biome and commitlint hooks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(ci): add fast local validation hooks [maka]

Posted by "Phoenix500526 (via GitHub)" <gi...@apache.org>.
Phoenix500526 commented on code in PR #4132:
URL: https://github.com/apache/maka/pull/4132#discussion_r3891402096


##########
.husky/pre-commit:
##########
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+./node_modules/.bin/biome check --staged --no-errors-on-unmatched

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(ci): add fast local validation hooks [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #4132:
URL: https://github.com/apache/maka/pull/4132


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(ci): add fast local validation hooks [maka]

Posted by "Phoenix500526 (via GitHub)" <gi...@apache.org>.
Phoenix500526 commented on code in PR #4132:
URL: https://github.com/apache/maka/pull/4132#discussion_r3886211988


##########
.husky/pre-commit:
##########
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+npx --no -- biome check --staged --no-errors-on-unmatched

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org