Skip to content

🐛 Fix api-lint-diff to work from a git worktree#2765

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
pedjak:fix-worktree-compat
Jun 12, 2026
Merged

🐛 Fix api-lint-diff to work from a git worktree#2765
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
pedjak:fix-worktree-compat

Conversation

@pedjak

@pedjak pedjak commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

hack/api-lint-diff/run.sh checks for the repository root by testing
-d ".git". In a git worktree .git is a file (containing a
gitdir: pointer), not a directory, so the check always fails with
"Must be run from repository root".

This switches the test from -d (directory) to -e (exists) so it
works in both regular checkouts and worktrees.

Reviewer Checklist

  • API Go Documentation — N/A (no API changes)
  • Tests: Unit Tests (and E2E Tests, if appropriate) — manually verified in a worktree and in a non-git directory
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

In a git worktree `.git` is a file (not a directory), so the `-d`
test always fails.  Switch to `-e` which checks for existence
regardless of type.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 14:07
@openshift-ci openshift-ci Bot requested review from OchiengEd and fgiudici June 12, 2026 14:07
@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit be26ec6
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6a2c12915b799d000835ef8e
😎 Deploy Preview https://deploy-preview-2765--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pedjak pedjak requested review from perdasilva and removed request for OchiengEd June 12, 2026 14:07

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.

Pull request overview

Updates the hack/api-lint-diff/run.sh repository-root check so the script works when executed from a Git worktree (where .git is a file rather than a directory), aligning the tool with common local development setups.

Changes:

  • Replace the root validation from [[ ! -d ".git" ]] to [[ ! -e ".git" ]] to support both standard checkouts and worktrees.
  • Expand the comment to document why existence is checked instead of directory type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.82%. Comparing base (b5f05bb) to head (be26ec6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2765      +/-   ##
==========================================
- Coverage   66.90%   66.82%   -0.08%     
==========================================
  Files         149      149              
  Lines       11382    11382              
==========================================
- Hits         7615     7606       -9     
- Misses       3210     3219       +9     
  Partials      557      557              
Flag Coverage Δ
e2e 35.26% <ø> (+0.14%) ⬆️
experimental-e2e 52.30% <ø> (-0.20%) ⬇️
unit 52.12% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tmshort

tmshort commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

It's small enough to have just one reviewer.

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 12, 2026

@rashmigottipati rashmigottipati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rashmigottipati, tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit 8807a64 into operator-framework:main Jun 12, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants