Skip to content

feat: optional gh_token to install private-org deps in CI#56

Open
JarbasAl wants to merge 3 commits into
devfrom
feat/private-dep-auth
Open

feat: optional gh_token to install private-org deps in CI#56
JarbasAl wants to merge 3 commits into
devfrom
feat/private-dep-auth

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Jun 26, 2026

Copy link
Copy Markdown
Member

Adds an optional gh_token secret to the reusable build-tests and coverage workflows. When a caller passes it, git is configured (insteadOf) to authenticate clones of PRIVATE org dependencies during pre_install_pip. No-op when unset, so all existing callers are unaffected.

Use case: a public repo whose CI installs an unpublished/private sibling package from a branch ref.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added optional support for authenticated installs of private GitHub dependencies in CI workflows.
    • Workflows can now accept a token to help package installation succeed when pre-install steps pull from private repositories.
    • The token-based setup only runs when custom pre-install commands are provided, leaving standard builds unchanged.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JarbasAl, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9db8bdb-8e5e-4000-ac1b-b9203f79205e

📥 Commits

Reviewing files that changed from the base of the PR and between 52516ef and 16a500b.

📒 Files selected for processing (4)
  • .github/workflows/build-tests.yml
  • .github/workflows/coverage.yml
  • .github/workflows/license-check.yml
  • docs/license-whitelist.md
📝 Walkthrough

Walkthrough

Both build-tests and coverage workflows add an optional gh_token secret and a conditional step that configures git URL rewriting before pre_install_pip runs.

Changes

Private dependency Git authentication

Layer / File(s) Summary
Secret interface
.github/workflows/build-tests.yml, .github/workflows/coverage.yml
Both workflows declare an optional workflow_call secret named gh_token for private dependency authentication during pre_install_pip.
Conditional git auth step
.github/workflows/build-tests.yml, .github/workflows/coverage.yml
Both workflows add a step, gated by pre_install_pip, that rewrites https://github.com/ clone URLs to include the token when the secret is present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny hops through YAML in the night,
With token-tipped whiskers, all set right.
Private clones now roll along,
While pre_install_pip sings its song.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: adding an optional gh_token for private dependency installs in CI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/private-dep-auth

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.

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-tests.yml:
- Around line 91-102: The git authentication step in the workflow is leaving a
global token rewrite behind in `~/.gitconfig`, which can expose `GH_DEP_TOKEN`
to later steps. Update the `Authenticate git for private dependencies` step so
the `git config --global url."https://x-access-token:...".insteadOf` setting is
only applied for the `pre_install_pip` phase, or add a following cleanup step
with `always()` to remove that global config immediately after. Keep the fix
localized around the existing `Authenticate git for private dependencies` step.

In @.github/workflows/coverage.yml:
- Around line 128-139: The git authentication rewrite in the private
dependencies step leaves a global `insteadOf` rule behind, which can leak into
later operations such as the Pages deploy push. Update the workflow around the
Authenticate git for private dependencies step to add an immediate cleanup using
the same git config key so the token rewrite is removed right after pre-install;
use the existing authenticate step name and the git config
`url."https://x-access-token:${GH_DEP_TOKEN}`@github.com/`".insteadOf` setting as
the identifiers to locate and reverse.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7e401b9-73c3-45c2-b219-c287ae0735dd

📥 Commits

Reviewing files that changed from the base of the PR and between f7bff0c and 52516ef.

📒 Files selected for processing (2)
  • .github/workflows/build-tests.yml
  • .github/workflows/coverage.yml

Comment thread .github/workflows/build-tests.yml
Comment thread .github/workflows/coverage.yml
@JarbasAl JarbasAl force-pushed the feat/private-dep-auth branch from 52516ef to c0e558d Compare July 4, 2026 01:46
@JarbasAl JarbasAl marked this pull request as draft July 4, 2026 01:49
JarbasAl and others added 2 commits July 9, 2026 12:44
build-tests and coverage gain an optional 'gh_token' secret; when set, a git
insteadOf credential is configured before pre_install_pip so git URLs to PRIVATE
org repos (e.g. an unpublished sibling package on a branch) clone successfully.
No-op when unset — existing callers are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…se positives

Prerelease httpx builds (httpx==1.0.dev3, resolved under UV_PRERELEASE=allow)
carry no parseable license metadata and pilosus reports category Error;
marisa-trie (MIT) and psycopg2-binary (LGPL-with-exception) are misflagged
WeakCopyleft. All three are unmodified imported libraries, safe under the
Apache-2.0 donor policy. Add them to the central whitelist and the audited
source-of-truth doc, using the same name-then-version anchored pattern as
tqdm so they re-match pilosus's resolved name==version requirement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JarbasAl JarbasAl force-pushed the feat/private-dep-auth branch from c0e558d to 7c2e579 Compare July 9, 2026 11:46
@JarbasAl JarbasAl marked this pull request as ready for review July 9, 2026 14:07
The insteadOf rule embeds GH_DEP_TOKEN in the runner's global gitconfig,
so every step after pre_install_pip could read it -- including third-party
actions, the test suite, and the coverage Pages deploy push.

Unset it immediately after pre_install_pip. Guarded by always() so the
token does not survive a failed pre-install.
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.

1 participant