Skip to content

feat(ci): replace pre-commit into prek#17703

Open
aldy505 wants to merge 2 commits into
masterfrom
aldy505/ci/migrate-pre-commit-prek
Open

feat(ci): replace pre-commit into prek#17703
aldy505 wants to merge 2 commits into
masterfrom
aldy505/ci/migrate-pre-commit-prek

Conversation

@aldy505
Copy link
Copy Markdown
Collaborator

@aldy505 aldy505 commented May 10, 2026

DESCRIBE YOUR PR

Faster execution than pre-commit. The sentry and self-hosted repo are already using it right now.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment May 18, 2026 2:21am
sentry-docs Ready Ready Preview, Comment May 18, 2026 2:21am

Request Review

@aldy505 aldy505 requested review from BYK, jaffrepaul and sfanahata May 10, 2026 13:51
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4a9ff99. Configure here.

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml
Comment on lines +34 to +44
exclude: 'node_modules'
types: [text]
args: ['--write']
- id: eslint
entry: node_modules/.bin/eslint
name: eslint
description: This hook runs eslint on JavaScript and TypeScript files
entry: eslint
language: node
files: '\.[jt]sx?$'
exclude: 'node_modules'
types: [text]
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.

Bug: The local prettier and eslint hooks use language: node without additional_dependencies, which will cause them to fail with 'executable not found' errors during commits.
Severity: MEDIUM

Suggested Fix

To fix this, either change the language to language: system and point the entry to the project's local node_modules/.bin executables, or add additional_dependencies: [prettier, eslint] to the hook definitions to ensure the tools are installed in the isolated hook environment.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .pre-commit-config.yaml#L28-L44

Potential issue: The `pre-commit` configuration for the local `prettier` and `eslint`
hooks specifies `language: node`. This creates an isolated, empty Node.js environment
for the hooks. Because `additional_dependencies` are not provided, the `prettier` and
`eslint` packages will not be installed into this environment. As a result, when a
developer attempts to commit a file that triggers these hooks, the `pre-commit`
framework will be unable to find the `prettier` or `eslint` executables, causing the
hook to fail and blocking the commit.

Did we get this right? 👍 / 👎 to inform future reviews.

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.

3 participants