Skip to content

Add resource on Git '.git/' folder anatomy#2300

Merged
jcubic merged 5 commits into
mainfrom
jcubic-contribution
Apr 6, 2026
Merged

Add resource on Git '.git/' folder anatomy#2300
jcubic merged 5 commits into
mainfrom
jcubic-contribution

Conversation

@jcubic

@jcubic jcubic commented Apr 6, 2026

Copy link
Copy Markdown
Member

Added a new resource about the anatomy of the '.git/' folder.

I'm fixing a bug or typo

  • if this is your first time contributing, run npm run add-contributor and follow the prompts to add yourself to the README
  • squash merge the PR with commit message "fix: [Description of fix]"

I'm adding a parameter to an existing command X:

  • add parameter to the function in src/api/X.js (and src/commands/X.js if necessary)
  • document the parameter in the JSDoc comment above the function
  • add a test case in __tests__/test-X.js if possible
  • if this is your first time contributing, run npm run add-contributor and follow the prompts to add yourself to the README
  • read "Appendix A submodules" in the CONTRIBUTING.md document. Be sure to include submodule tests.

I'm adding a new command:

  • add as a new file in src/api (and src/commands if necessary)
  • add command to src/index.js
  • update __tests__/test-exports.js
  • create a test in src/__tests__
  • document the command with a JSDoc comment
  • add page to the Docs Sidebar website/sidebars.json
  • add page to the v1 Docs Sidebar website/versioned_sidebars/version-1.x-sidebars.json
  • if this is your first time contributing, run npm run add-contributor and follow the prompts to add yourself to the README
  • squash merge the PR with commit message "feat: Added 'X' command"
  • read "Appendix A submodules" in the CONTRIBUTING.md document. Be sure to include submodule tests.

Summary by CodeRabbit

  • Documentation
    • Added an advanced video resource on Git internals ("Anatomy of '.git/' folder") to contribution guidelines, including its thumbnail and watch URL.
  • Tests
    • GitHub test credentials are now configurable at runtime, allowing use of external credential values instead of hardcoded tokens.
  • Chores / CI
    • CI test step now exposes environment variables to support the configurable test credentials.

Added a new resource about the anatomy of the '.git/' folder.
Copilot AI review requested due to automatic review settings April 6, 2026 16:35
@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d200e03a-a3f9-4673-9141-db511279ebe3

📥 Commits

Reviewing files that changed from the base of the PR and between c5547da and d2810d7.

📒 Files selected for processing (3)
  • __tests__/test-hosting-providers-in-submodule.js
  • __tests__/test-hosting-providers.js
  • azure-pipelines.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/test-hosting-providers.js
  • azure-pipelines.yml
  • tests/test-hosting-providers-in-submodule.js

📝 Walkthrough

Walkthrough

Added a CONTRIBUTING.md video entry, replaced hardcoded GitHub test credentials with environment-variable-driven values in two tests, and updated azure-pipelines.yml to expose those environment variables to the npm test step.

Changes

Cohort / File(s) Summary
Documentation
CONTRIBUTING.md
Added one "Advanced videos" bullet with Piotr Kowalski's "Anatomy of '.git/'" video, its YouTube thumbnail reference, and watch URL.
Tests
__tests__/test-hosting-providers.js, __tests__/test-hosting-providers-in-submodule.js
Replaced hardcoded GitHub test credentials with env-driven values: password read from process.env.TEST_PUSH_GITHUB_TOKEN, username from process.env.GITHUB_TEST_USERNAME with a fallback to isomorphic-git-test-push; onAuth usage unchanged.
CI / Pipeline
azure-pipelines.yml
Added variable group reference for TEST_PUSH_GITHUB_TOKEN and injected TEST_PUSH_GITHUB_TOKEN and GITHUB_TEST_USERNAME into the npm test step's environment.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Learning resource #2296 — Documentation update to CONTRIBUTING.md adding/adjusting "advanced videos" entries (closely related doc change).

Poem

🐰 I hopped through docs and tests today,
A tidy video link left on the way.
Secrets now fetched from fields unseen,
CI will whisper what lies between.
Nibble, commit, then bound away.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes adding a resource about Git '.git/' folder anatomy, but the actual changeset includes environment variable configuration in test files and CI/CD pipeline, which represents a significant portion of the changes not captured in the title. Revise the title to reflect all substantive changes, such as 'Add Git folder anatomy resource and update test credentials to use environment variables' or clarify if this PR should be split into separate changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jcubic-contribution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

This PR updates the contributor documentation by adding an additional learning resource about the internal structure of Git’s .git/ directory.

Changes:

  • Add a new “advanced video” link covering the anatomy of the .git/ folder.
  • Include a YouTube thumbnail preview for the new resource.

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

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 101-102: Fix the two typos in the video entry line that currently
reads 'Anatomy of ".git/" folder - How Git Really Works Under the Hood by Piotr
KowalskiPiotr Kowalski' and the image alt text '[![ Anatomy of ".git/" folder -
How Git Really Works Under the
Hood](https://img.youtube.com/vi/rzwyDeRlLdE/0.jpg)](...)': remove the
duplicated author so it reads "Piotr Kowalski" and remove the leading space in
the alt text so " Anatomy" becomes "Anatomy"; update the text around the title
and the alt text in the same line to keep formatting consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4338dc68-e140-49c1-8201-651dfd16b945

📥 Commits

Reviewing files that changed from the base of the PR and between ecaf4d4 and 8f60bce.

📒 Files selected for processing (1)
  • CONTRIBUTING.md

Comment thread CONTRIBUTING.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@__tests__/test-hosting-providers-in-submodule.js`:
- Around line 165-167: The GitHub push tests attempt auth with password variable
(const password = process.env.TEST_PUSH_GITHUB_TOKEN) even when the env var is
unset, causing failures; guard those specs by checking password (and optionally
username) before running them and skip or return early when password is falsy so
no auth is attempted; update the test block that references password/username
(and any describe/test that performs the push) to conditionally skip the suite
when process.env.TEST_PUSH_GITHUB_TOKEN is missing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1f2be2e-a74e-46ef-85bd-0675031efcb7

📥 Commits

Reviewing files that changed from the base of the PR and between 6dca5ae and c5547da.

📒 Files selected for processing (3)
  • __tests__/test-hosting-providers-in-submodule.js
  • __tests__/test-hosting-providers.js
  • azure-pipelines.yml

Comment on lines +165 to +167
const password = process.env.TEST_PUSH_GITHUB_TOKEN
const username =
process.env.TEST_PUSH_GITHUB_USERNAME || 'isomorphic-git-test-push'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Guard GitHub specs when token is missing.

At Line 165, password is env-only. When unset, auth is attempted with undefined and these specs fail hard instead of being conditionally skipped.

Proposed fix
+  const runGitHubTests = process.env.TEST_PUSH_GITHUB_TOKEN
+    ? describe
+    : xdescribe
-  describe('GitHub', () => {
+  runGitHubTests('GitHub', () => {
     // This Personal OAuth token is for a test account (https://github.com/isomorphic-git-test-push)
     // with "public_repo" access. The only repo it has write access to is
     // https://github.com/isomorphic-git/test.empty
     // It is stored reversed to avoid Github's auto-revoking feature.
     // Can be overridden via TEST_PUSH_GITHUB_TOKEN env var (token must have write access to the test repo).
     const password = process.env.TEST_PUSH_GITHUB_TOKEN
     const username =
       process.env.TEST_PUSH_GITHUB_USERNAME || 'isomorphic-git-test-push'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@__tests__/test-hosting-providers-in-submodule.js` around lines 165 - 167, The
GitHub push tests attempt auth with password variable (const password =
process.env.TEST_PUSH_GITHUB_TOKEN) even when the env var is unset, causing
failures; guard those specs by checking password (and optionally username)
before running them and skip or return early when password is falsy so no auth
is attempted; update the test block that references password/username (and any
describe/test that performs the push) to conditionally skip the suite when
process.env.TEST_PUSH_GITHUB_TOKEN is missing.

@jcubic jcubic merged commit a62d75b into main Apr 6, 2026
8 of 9 checks passed
@jcubic jcubic deleted the jcubic-contribution branch April 6, 2026 18:58
@jcubic

jcubic commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.37.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jcubic jcubic added the released label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants