Skip to content

Resolve and build dependency wheels in one PR with the dependency bump that triggers the build#23063

Open
iliakur wants to merge 9 commits intomasterfrom
ik/AI-6182/pass-package-base-url
Open

Resolve and build dependency wheels in one PR with the dependency bump that triggers the build#23063
iliakur wants to merge 9 commits intomasterfrom
ik/AI-6182/pass-package-base-url

Conversation

@iliakur
Copy link
Copy Markdown
Contributor

@iliakur iliakur commented Mar 26, 2026

What does this PR do?

  • Pass PACKAGE_BASE_URL to triggered agent builds
  • Update ddev size tools to handle both lockfile URL formats
  • Upload wheels to dev/ prefix and use ${PACKAGE_BASE_URL} in lockfiles
  • Update promote.py to parse ${PACKAGE_BASE_URL} lockfile format
  • Change publish job to run on PRs only and commit lockfiles to branch
  • Add promote-gate and promote-wheels workflows
  • Update upload tests and add promote tests for new lockfile format

Motivation

We're fed up with having to make 2 PRs every time we resolve dependencies!

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

iliakur and others added 7 commits March 26, 2026 15:25
When integrations-core triggers agent CI builds, pass PACKAGE_BASE_URL
pointing to dev storage. This prepares for lockfiles switching to
${PACKAGE_BASE_URL}/... format so PR-triggered builds use dev wheels.
No-op today since current lockfiles use hardcoded URLs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Support both the legacy hardcoded URL format and the new
\${PACKAGE_BASE_URL}/... template format in lockfile entries.
Resolves \${PACKAGE_BASE_URL} to the stable base URL before
downloading wheels for size calculations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wheels are now uploaded to dev/{artifact_type}/{project_name}/ paths
in GCS instead of the unprefixed paths. Lockfile entries are templated
with \${PACKAGE_BASE_URL} so pip resolves the URL at install time using
either the dev or stable base URL depending on the environment.

Also fix brittle index extraction in generate_artifact_listings and
list_wheels_with_prefix to use split('/')[-1] and split('/')[-2]
instead of hardcoded indices.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Lockfiles now use \${PACKAGE_BASE_URL}/... template entries instead of
hardcoded URLs. Update url_to_blob_path to extract the relative path
from \${PACKAGE_BASE_URL}/... entries, then prepend dev/ when looking up
blobs in GCS and stable/ for the promotion destination.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of creating a separate PR with updated lockfiles, the publish
job now commits them directly to the PR branch. This collapses the
two-PR dependency update workflow into a single PR.

- Trigger: pull_request only (remove push and workflow_dispatch)
- Permission: contents: write (needed for git push)
- Token: GitHub App token checked out before checkout so push works
- Replace peter-evans/create-pull-request with a git commit + push step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
promote-gate.yaml runs on every PR push to master/7.*.*. If dependency
files (agent_requirements.in or .deps/resolved/) changed, it sets the
promote-wheels commit status to pending, blocking merge. Otherwise it
sets it to success (no promotion needed).

promote-wheels.yaml is triggered via workflow_dispatch (by ddev promote).
It checks out the PR branch at the given SHA, runs .builders/promote.py
to copy wheels from dev/ to stable/ in GCS, then sets the promote-wheels
commit status to success and posts a comment on the PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test_upload.py: update all blob path assertions to use dev/ prefix
and all lockfile URL assertions to use \${PACKAGE_BASE_URL} format.
Update generate_artifact_listings assertions to use dev/-prefixed paths.

test_promote.py (new): test lockfile parsing, url_to_blob_path,
collect_relative_paths, GCS copy with correct dev/stable paths,
idempotency, and failure on missing source blobs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

⚠️ Recommendation: Add qa/skip-qa label

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the qa/skip-qa label if these changes do not require QA testing.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14bd37bd66

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- name: Check if dependency files changed
id: deps-changed
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- \
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fetch base branch before computing dependency diff

The git diff command relies on origin/${{ github.base_ref }}, but this workflow uses actions/checkout with its default shallow fetch (single triggering commit), so the base branch ref is not guaranteed to exist locally. In that state this step fails with fatal: bad revision ..., and the workflow never sets the promote-wheels commit status. Add fetch-depth: 0 (or diff against explicit SHAs from the event payload) before running this command.

Useful? React with 👍 / 👎.

name: Publish artifacts and update lockfiles via PR
if: needs.check-should-run.outputs.should_run_build == 'true' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && (github.ref_name == github.event.repository.default_branch || startsWith(github.ref_name, '7.'))))
name: Publish artifacts and commit lockfiles to branch
if: needs.check-should-run.outputs.should_run_build == 'true' && github.event_name == 'pull_request'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude fork PRs from publish-and-push path

This job now runs for all pull_request events, but later steps require write-capable secrets/tokens and push back to the PR branch. For fork-based PRs, those secrets are unavailable and the head branch is not in the base repository, so dependency-update PRs from forks will fail in publish even when builds succeed. Gate this job to non-fork PRs (or add a fork-safe fallback) to avoid breaking external contribution flows.

Useful? React with 👍 / 👎.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.33%. Comparing base (5fa36f1) to head (ad29d97).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant