ci(uidrift): clone wandb/core's default branch instead of master - #3264
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
Original prompt from Devin Bot
|
There was a problem hiding this comment.
👀 1 finding needs your review
Devin reviewed the finding on 47278ce and left it for you. Click a finding below to jump to its comment.
For your review (1)
| local_path_env="CORE_REPO", | ||
| local_path_default="~/core", | ||
| default_head="origin/master", | ||
| default_head="origin/HEAD", |
There was a problem hiding this comment.
🟡 Local drift scans miss renamed branch
After core's branch rename, default_head can still select master in an existing checkout. origin/HEAD is a local symbolic ref that ordinary fetches do not retarget. Local scans then miss commits on main, or fail if master is pruned.
Learn more
A fresh CI clone sets origin/HEAD from the remote default. Existing local checkouts keep their own symbolic origin/HEAD, which a normal fetch does not retarget when the server renames its default branch. scan uses that symbolic ref to select the entire commit range; ownership also reads through it. If the old remote-tracking branch remains, local scans silently keep reporting against it; if it is removed, the scan cannot resolve its head.
Example: A local checkout has origin/HEAD -> origin/master. Core renames master to main and the user fetches origin/main. Running the default scan still selects origin/master, instead of the commits on origin/main.
Recommended fix: Resolve the source remote's advertised HEAD before selecting a default head in an existing checkout, or refresh origin/HEAD with git remote set-head origin -a after fetching the new branch. Ensure the default also handles checkouts where origin/HEAD was never initialized.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
This gap is real, but it only affects existing local clones of wandb/core after the rename, and this PR didn't introduce it. The old origin/master default breaks the same way once master is renamed away. CI isn't affected: uidrift-scan.yml makes a fresh --single-branch clone on every run, so origin/HEAD points at the current default branch. The core cutover runbook tells engineers to run git remote set-head origin -a, which fixes local clones. I left the code alone because refreshing origin/HEAD inside the scanner would add a network call to local runs. If a maintainer wants that, it can go in a follow-up PR.
Description
Prep for renaming wandb/core's default branch
master->main(done later in an announced cutover). This change works before and after the rename.uidrift-scan.yml:git clone --single-branchwithout--branch masterclones core's remote HEAD and setsrefs/remotes/origin/HEAD(verified with a local single-branch clone); the log line now readsorigin/HEAD.scripts/uidrift/config.py:SOURCE.default_headorigin/master->origin/HEAD; comments/tests updated to match.The raw Weave OpenAPI URL in
sync_openapi_spec.py(raw.githubusercontent.com/wandb/core/master/...) is left alone here: it already has a fallback, and it is tracked as a post-cutover item in the core rename runbook.Testing
Link to Devin session: https://coreweave.devinenterprise.com/sessions/e8431f366b364b3c8855620e1c58f823
Open in Devin Desktop: https://coreweave.devinenterprise.com/desktop/session/e8431f366b364b3c8855620e1c58f823?variant=devin
Requested by: @wandbjake