Skip to content

Fix Depot governance runs (packages token) - #77

Merged
yakimoto merged 1 commit into
mainfrom
depot-governance-token
Sep 15, 2026
Merged

yakimoto merged 1 commit into
mainfrom
depot-governance-token

Conversation

@yakimoto

@yakimoto yakimoto commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

User description

Same class as webhook-edge#50: Depot lacks automatic GITHUB_TOKEN, so the enforcer install E403d. Points .depot copy at imported GH_PACKAGES_TOKEN. .github untouched.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Depot-only CI credential wiring for private package install; no application or governance logic changes.

Overview
Depot runs of governance-enforce were failing when installing @wave-av/governance from GitHub Packages (E403) because Depot does not inject an automatic GITHUB_TOKEN like GitHub Actions.

The .depot/workflows/governance-enforce.yml copy now sets NODE_AUTH_TOKEN to secrets.GH_PACKAGES_TOKEN for the isolated npm install step, with a comment documenting why. The .github workflow is unchanged.

Reviewed by Cursor Bugbot for commit 4f8e6db. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by Sourcery

Bug Fixes:

  • Fix Depot governance enforcement package installation by using the imported GitHub packages token instead of the unavailable automatic GitHub token.

CodeAnt-AI Description

Restore successful governance checks on Depot runners

What Changed

  • Depot governance runs now authenticate package downloads with the configured packages token instead of relying on an unavailable automatic GitHub token
  • Governance enforcement can complete without package installation authorization failures

Impact

✅ Fewer failed Depot governance runs
✅ Reliable access to private governance packages

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Review in cubic

…epot only)

Depot has no automatic GITHUB_TOKEN; the enforcer install E403d on
@wave-av/governance on every Depot run. Mirrors webhook-edge#50.
@codeant-ai

codeant-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 4f8e6db Sep 15, 2026 · 21:23 21:25

@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the Depot governance workflow to authenticate enforcer package installation with the imported GH_PACKAGES_TOKEN, addressing Depot’s lack of an automatic GITHUB_TOKEN while preserving step-level token scoping.

File-Level Changes

Change Details Files
Use the imported GitHub packages token when installing the governance enforcer in Depot.
  • Replace the unavailable automatic GitHub token with GH_PACKAGES_TOKEN.
  • Keep NODE_AUTH_TOKEN scoped to the package-installation step to limit credential exposure.
.depot/workflows/governance-enforce.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your workspace is out of credits. Ask your workspace admin to add credits to resume reviews. Manage billing

@codeant-ai

codeant-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9d8631b5-634f-4944-8628-c939020212b1

📥 Commits

Reviewing files that changed from the base of the PR and between 30b78b6 and 4f8e6db.

📒 Files selected for processing (1)
  • .depot/workflows/governance-enforce.yml

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Macroscope - Approvability Check
  • GitHub Check: Cursor Approval Agent: Pull Request Router and Approver
  • GitHub Check: Macroscope - Approvability Check
  • GitHub Check: Gitar
  • GitHub Check: Cursor Security Agent: Security Reviewer
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.depot/workflows/governance-enforce.yml (1)

58-59: LGTM!


📝 Summary

Summary by CodeRabbit

  • Chores
    • Updated package installation authentication in the governance workflow to use the designated packages token.

Walkthrough

The governance workflow now uses GH_PACKAGES_TOKEN for GitHub Packages authentication during isolated Depot package installation.

Changes

Package Authentication

Layer / File(s) Summary
Update package installation token
.depot/workflows/governance-enforce.yml
The package-install step sets NODE_AUTH_TOKEN from secrets.GH_PACKAGES_TOKEN instead of secrets.GITHUB_TOKEN.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4f8e6

The Depot governance installation now uses the intended package token without introducing a repository-level merge risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Depot governance fix and the packages token change.
Description check ✅ Passed The description accurately explains the Depot authentication failure, the GH_PACKAGES_TOKEN change, and the unchanged .github workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch depot-governance-token
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch depot-governance-token

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

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Sep 15, 2026

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. This changes which credential is placed in the environment for the governance step, so a wrong scope or an untrusted downloaded package could expose the packages token and grant unintended repository-package access. Reverting stops future use, but any token exposure or access performed before the revert would require token rotation and separate cleanup.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Depot has no automatic GITHUB_TOKEN: use the imported packages token.
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Edge Case: GH_PACKAGES_TOKEN must exist as a secret imported into Depot

This is the only reference to GH_PACKAGES_TOKEN anywhere in the repo, and Depot secret configuration lives outside this checkout (in Depot's project settings), so it can't be verified from the repo whether this secret is actually imported there. If it isn't configured, the step will still fail (empty token in .npmrc), reproducing the same E403 this PR is meant to fix — worth a quick confirmation in Depot's dashboard before merging, or a note in the PR description confirming it's already set up.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your team has used its included automatic processing for this billing period (headroom scales with your seat count). You can still comment "Gitar review" to run one anytime, and automatic reviews resume on their own by October 1. Add seats for more headroom.
Learn more

Code Review 👍 Approved with suggestions 0 closed / 1 findings

Sets NODE_AUTH_TOKEN to secrets.GH_PACKAGES_TOKEN in .depot/workflows/governance-enforce.yml to fix E403 errors during Depot governance enforcement runs when installing from GitHub Packages. Verify that GH_PACKAGES_TOKEN is already imported as a secret in Depot's project settings, otherwise the step will fail with the same error this PR addresses.

💡 Edge Case: GH_PACKAGES_TOKEN must exist as a secret imported into Depot

📄 .depot/workflows/governance-enforce.yml:59

This is the only reference to GH_PACKAGES_TOKEN anywhere in the repo, and Depot secret configuration lives outside this checkout (in Depot's project settings), so it can't be verified from the repo whether this secret is actually imported there. If it isn't configured, the step will still fail (empty token in .npmrc), reproducing the same E403 this PR is meant to fix — worth a quick confirmation in Depot's dashboard before merging, or a note in the PR description confirming it's already set up.

🤖 Prompt for agents
Code Review: Sets `NODE_AUTH_TOKEN` to `secrets.GH_PACKAGES_TOKEN` in `.depot/workflows/governance-enforce.yml` to fix E403 errors during Depot governance enforcement runs when installing from GitHub Packages. Verify that `GH_PACKAGES_TOKEN` is already imported as a secret in Depot's project settings, otherwise the step will fail with the same error this PR addresses.

1. 💡 Edge Case: GH_PACKAGES_TOKEN must exist as a secret imported into Depot
   Files: .depot/workflows/governance-enforce.yml:59

   This is the only reference to `GH_PACKAGES_TOKEN` anywhere in the repo, and Depot secret configuration lives outside this checkout (in Depot's project settings), so it can't be verified from the repo whether this secret is actually imported there. If it isn't configured, the step will still fail (empty token in `.npmrc`), reproducing the same E403 this PR is meant to fix — worth a quick confirmation in Depot's dashboard before merging, or a note in the PR description confirming it's already set up.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Depot has no automatic GITHUB_TOKEN: use the imported packages token.
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Fork pull request workflows do not receive repository secrets, so GH_PACKAGES_TOKEN is empty and the private package install fails before governance enforcement runs. [api mismatch]

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .depot/workflows/governance-enforce.yml
**Line:** 59:59
**Comment:**
	*Api Mismatch: Fork pull request workflows do not receive repository secrets, so `GH_PACKAGES_TOKEN` is empty and the private package install fails before governance enforcement runs.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@cursor cursor 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.

Risk: medium. Left a non-blocking comment and did not approve: Cursor Security Agent was present and finished as skipped. Reviewers were not assigned (the only code owner is the PR author).

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@macroscopeapp

macroscopeapp Bot commented Sep 15, 2026

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This is a small Depot-only CI credential change with no application runtime impact, but its success depends on an externally configured secret whose availability for fork pull requests is unresolved. That dependency could leave governance enforcement failing in the exact scenario the PR intends to fix.

Not approved because:

  • Credit balance exhausted. Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

@yakimoto
yakimoto merged commit d1a752d into main Sep 15, 2026
26 of 54 checks passed
@yakimoto
yakimoto deleted the depot-governance-token branch September 15, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant