ATLAS-5293: ATLAS UI: Add repo-wide Git hooks and dashboard pre-commit/push verification#631
Open
pawarprasad123 wants to merge 2 commits into
Open
ATLAS-5293: ATLAS UI: Add repo-wide Git hooks and dashboard pre-commit/push verification#631pawarprasad123 wants to merge 2 commits into
pawarprasad123 wants to merge 2 commits into
Conversation
…t/push verification
…t/push verification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds local Git automation for the whole Atlas repo so contributors catch issues before a PR: license headers on new files, ESLint on staged dashboard sources (via lint-staged), TypeScript tsc --noEmit for the dashboard when dashboard/ is staged, and for dashboardv2/ and docs/ lighter checks (ASF license + node --check on pre-commit; npm run build on pre-push). It does not add Jest or test files; those are PR 2+.
What it does
Root .githooks/pre-commit and .githooks/pre-push call scripts/git-hooks/run-precommit.mjs and run-prepush.mjs.
scripts/git-hooks/: Orchestrates dashboard (existing verify scripts + lint-staged + typecheck), v2/docs license + syntax, v2/docs build on push.
dashboard/scripts/install-git-hooks.mjs: Sets git config core.hooksPath .githooks at repo root (run via npm install in dashboard/ prepare).
dashboard/.githooks/: Forwarders to root hooks for compatibility.
dashboard/lint-staged.config.mjs: ESLint only on staged dashboard/src/**/.{ts,tsx}.
dashboard/docs/GIT_HOOKS.md: When/what/where, skip env vars, manual commands (node scripts/git-hooks/run-precommit.mjs from repo root).
Setup on another machine
cd /path/to/atlas
git config core.hooksPath .githooks
or cd dashboard && npm install
Verify: git config --get core.hooksPath → .githooks
How was this patch tested?
Manual test, build pass
