Skip to content

Fix running tests on PRs from forks#5100

Open
andrewnester wants to merge 2 commits intomainfrom
allow-fork-prs
Open

Fix running tests on PRs from forks#5100
andrewnester wants to merge 2 commits intomainfrom
allow-fork-prs

Conversation

@andrewnester
Copy link
Copy Markdown
Contributor

Changes

Fix running tests on PRs from forks

Why

Problem

PRs from forks fail CI entirely. Two root causes:

  1. JFrog authentication — Go module resolution uses a JFrog Artifactory proxy authenticated via GitHub OIDC. GitHub does not mint OIDC tokens for forked PR workflows, so the JFrog auth step fails.
  2. Protected runner groups — The test jobs run on databricks-protected-runner-group-large and databricks-deco-testing-runner-group, which are inaccessible to fork workflows.

Solution

Pre-warm the Go module download cache from a privileged workflow on main, then restore it in fork PR workflows using Go's file:// proxy in offline mode - no JFrog credentials required.

@github-actions
Copy link
Copy Markdown

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in .github/workflows/, .github/actions/setup-build-environment/

Eligible reviewers: @anton-107, @denik, @renaudhartert-db, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

# Protected runner groups and JFrog OIDC auth are not available for fork PRs.
# Each job mirrors its non-fork counterpart but uses a single OS and is-fork: 'true'.

test-fork:
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.

question - Can we reuse the same jobs as regular bit parametrize runner?

Ideally we would not have to maintain separate jobs, especially given that they are hard to test.


# Fork PR variants: run on ubuntu-latest with public Go/Python proxies.
# Protected runner groups and JFrog OIDC auth are not available for fork PRs.
# Each job mirrors its non-fork counterpart but uses a single OS and is-fork: 'true'.
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.

single OS

what single OS? why?

- go.sum
schedule:
- cron: '0 6 * * *' # Daily — prevents 7-day GitHub cache eviction
workflow_dispatch:
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.

Does this workflow require an approval from us? Claude flagged that historically there have been arbitary code execution vectors via things like this (e.g. if you use cgo, and then use compile time macros)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is triggered on main barcnh only so can't be executed from PR code

steps:
- name: Detect fork PR
id: check
run: |
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.

maybe can be simplied? Claude recommended:

  env:
    IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
  run: echo "is_fork=${IS_FORK:-false}" >> "$GITHUB_OUTPUT"

@simonfaltum simonfaltum removed their request for review May 7, 2026 11:24
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