← Back to Pull requests

feat(ci): Auto-fetch Velox staging PRs from github project board and add nightly staging workflow #422

Closed
unknown closed this pull request without merging on Sep 15, 2026 18:40 UTC
View on GitHub
unknown unknown commented on Sep 10, 2026 20:50 UTC
Author

Summary

Switches staging PR auto-fetch from GitHub labels to the NVIDIA project board, and adds a staging
workflow that refreshes the Velox and Presto staging branches nightly.

Previously create_staging_branch.sh collected PRs by the cudf label, so staging contained whatever
happened to be labelled. There was no way to stage a PR without labelling it upstream, and no single
place to see what was queued. The board at NVIDIA/projects/306 is already the team's source
of truth, so staging now reads it directly.

Image builds from the staging branch are not part of this PR; they live in #424.

Where the staging branches are created

staging.yml runs at 03:00 UTC (plus workflow_dispatch / workflow_call) and fans out to two independent jobs with no dependency between them, so a Velox conflict does not block Presto:

| Job | Base | Target | Branches pushed | Script | Token |
|-----|------|--------|-----------------|--------|-------|
| velox-staging | facebookincubator/velox@main | rapidsai/velox | staging, staging_MM-DD-YYYY | velox/scripts/create_staging.sh | VELOX_FORK_PAT |
| presto-staging | prestodb/presto@master | karthikeyann/presto | staging, staging_MM-DD-YYYY | presto/scripts/create_staging.sh | PRESTO_FORK_PAT |

Call chain for each job:

staging.yml ──► velox-create-staging.yml ──► create-staging-composite.yml ──► [rapidsai/velox@staging]   

          └─► presto-create-staging.yml ──► create-staging-composite.yml ──► [karthikeyann/presto@staging]

create-staging-composite.yml holds the actual step sequence, and every step is one invocation of the
shared scripts/create_staging_branch.sh: clone the target repo, reset staging to the upstream base
commit, fetch the PR list from the board, test merges, merge, write .staging-manifest.yaml, and push.
Both staging and the dated snapshot go out in a single git push with two refspecs, so they cannot
diverge. force_push: true is required because staging is rebuilt from upstream every run and is
therefore never a fast-forward over the previous branch.

[!IMPORTANT]

presto-staging currently targets karthikeyann/presto for testing. This must be changed back to

rapidsai/presto before merge, otherwise the nightly pushes to a personal fork — and

PRESTO_FORK_PAT has no write access there, so the push step would fail.

Changes

PR discovery (scripts/create_staging_branch.sh)

  • Adds fetch_prs_from_project(), which reads the board with a single paginated gh api graphql call

  • and keeps items whose Velox Staging field is Staging.
  • The board is addressed by its node ID (PVT_kwDOABpemM4BgGAW) rather than owner + number, per

  • review feedback. The ID survives the board being renamed, moved between owners, or renumbered, and
    it skips the owner-type lookup gh project item-list performs — which is what required read:org
    on top of read:project and produced the misleading unknown owner type failure in CI.
  • The GraphQL response carries state, isDraft, and repository per PR, so closed and draft cards

  • are filtered from the same response (no second gh pr list call) and the skip log reports the actual
    reason, e.g. Skipping project PR #28398 (state=OPEN, draft=true).
  • One board serves both projects: cards for either repository share the Velox Staging field, so

  • results are separated by --base-repository. Constants are named STAGING_PROJECT_* to reflect
    that the script is shared rather than Velox-specific.
  • Keeps label-based fetching: --pr-labels overrides the board for one-off runs.
  • Empty board is a no-op, not a failure

    Auto-fetch previously aborted with No PRs found to merge whenever nothing was marked Staging, so a
    quiet night failed the nightly. fetch_pr_list now emits PR_COUNT=0 and returns cleanly, and the
    composite skips test-merge, test-pairwise, merge, manifest, and push on that count — the target branch
    is left exactly as the last successful run produced it. An explicitly supplied PR list that resolves to
    empty still fails, since that is a misconfiguration.

    Token handling

  • Adds an optional project_board_pat secret, wired from PROJECT_BOARD_TOKEN and applied as

  • GH_TOKEN on the Fetch PR list step only, so board scopes stay away from the clone, merge, and push
    steps. Only read:project is needed now that the board is addressed by node ID.
  • Drops GITHUB_TOKEN to contents: read across the staging chain. Every git operation runs with the

  • fork PAT, so the write grant was unused; it had to be repeated at each level only because a called
    workflow cannot be granted more than its caller.

    Workflow plumbing

  • velox-create-staging.yml and presto-create-staging.yml each gain a workflow_call trigger so

  • staging.yml can call them. Inputs are declared once and aliased with YAML anchors, matching
    velox.yml, so there is no duplicated input block to keep in sync.
  • target_repository moves from required: true to required: false on both; it keeps its default,

  • so the dispatch forms are unchanged.
  • auto_fetch_prs now defaults to true for Presto as well as Velox, and the Presto wrapper script no

  • longer forces --auto-fetch-prs false.

    Conflict handling

    Conflicts are detected up front, never auto-resolved, and abort the run before anything is pushed.
    Three gates:

    1. Each PR against base (test-merge) — every PR is merged with --no-commit --no-ff, then
    aborted and reset to BASE_COMMIT so tests cannot contaminate each other. All PRs are checked
    before failing, so the log lists every conflicting PR with its URL rather than just the first.
    2. Every pair together (test-pairwise) — all A+B combinations are tried; on failure the log
    includes a compatibility matrix plus a table of the involved PRs with author, title, and URL.
    3. The real merge (merge) — a joint conflict among three or more PRs can survive both gates
    above, so the sequential merge aborts and exits non-zero as well.

    Any of these fails the step and therefore the job. "Push branches" is the last step, so it never
    executes: nothing reaches the target repo and staging remains as the last successful run left it. The
    failure propagates up through create-staging-composite and the per-project workflow to the
    velox-staging or presto-staging job.

    The trade-off is bluntness: one conflicting PR costs that project's whole nightly refresh. The escape
    hatch is exclude_pr_numbers, reachable by dispatching the per-project workflow directly, or by
    removing the card from the board.

    Deployment note

    PROJECT_BOARD_TOKEN must exist as a repo secret (classic PAT with read:project, from an account
    that can read project 306) before the nightly runs.

    Testing

  • Board query verified against project 306 by node ID: returns the three Staging cards, skips the

  • draft (#28398), and keeps #27719 and #27975.
  • Per-repo separation verified from the same board read: facebookincubator/velox resolves to []

  • and prestodb/presto to [27719 27975], so neither path can see the other's cards.
  • Empty-board handling verified both ways: auto-fetch exits 0 with PR_COUNT=0, while an empty manual

  • list still exits 1.
  • staging.yml cannot be dispatched until it is on main, since workflow_dispatch resolves workflow

  • names against the default branch.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Avinash-Raj Review duration: 7069m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #422"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%