Repository navigation
Conversation
The addition of `single-branch: true` in pytorch#172544 prevented git tags from being fetched during checkout. This caused `binary_populate_env.sh` to fail to detect release candidate tags (e.g. v2.12.0-rc1) via `git describe --tags --exact`, falling back to dev nightly versions. Authored with Claude.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/180504
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 136 PendingAs of commit 1ff6a44 with merge base ad0b2d3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| # --depth=1 for speed, manually fetch history and other refs as necessary | ||
| fetch-depth: ${{ inputs.fetch-depth }} | ||
| single-branch: true | ||
| fetch-tags: true |
There was a problem hiding this comment.
do we always want this? Won't this add some overhead?
There was a problem hiding this comment.
Good point, let me fetch-tag only on tag event
Refine the fix to conditionally fetch tags using github.ref_type == 'tag', avoiding unnecessary tag fetching on regular branch pushes and PRs. Authored with Claude.
|
@pytorchmergebot merge -f "lint is green, checkout works" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot cherry-pick --onto release/2.12 -c critical |
…180504) ## Summary Release candidate builds triggered by tags (e.g. `v2.12.0-rc1`) are incorrectly producing dev nightly versions instead of RC versions. The root cause is that #172544 added `single-branch: true` to the `checkout-pytorch` action when switching from `actions/checkout@v4` to `pytorch/test-infra/.github/actions/checkout@main`. With `single-branch: true`, git restricts the fetch refspec and tags are no longer fetched — even with `fetch-depth: 0`. This causes `binary_populate_env.sh` to fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exact fatal: No names found, cannot describe anything. and fall through to the dev version path, producing `2.12.0.dev20260415+cpu` instead of `2.12.0+cpu`. The fix adds `fetch-tags: true` to both checkout steps (primary and retry) in the `checkout-pytorch` action, ensuring tags are explicitly fetched regardless of `single-branch` mode. Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912 ## Test plan - Verify that a workflow triggered by an RC tag (e.g. `v2.12.0-rc1`) correctly sets `PYTORCH_BUILD_VERSION=2.12.0+cpu` instead of `2.12.0.dev<date>+cpu` - Verify that nightly builds on the `nightly` branch are unaffected (they should still produce dev versions) Pull Request resolved: #180504 Approved by: https://github.com/seemethere (cherry picked from commit ba240c9)
Cherry picking #180504The cherry pick PR is at #180508 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated: Details for Dev Infra teamRaised by workflow job |
…180508) Enable fetch-tags in checkout-pytorch to fix release tag detection (#180504) ## Summary Release candidate builds triggered by tags (e.g. `v2.12.0-rc1`) are incorrectly producing dev nightly versions instead of RC versions. The root cause is that #172544 added `single-branch: true` to the `checkout-pytorch` action when switching from `actions/checkout@v4` to `pytorch/test-infra/.github/actions/checkout@main`. With `single-branch: true`, git restricts the fetch refspec and tags are no longer fetched — even with `fetch-depth: 0`. This causes `binary_populate_env.sh` to fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exact fatal: No names found, cannot describe anything. and fall through to the dev version path, producing `2.12.0.dev20260415+cpu` instead of `2.12.0+cpu`. The fix adds `fetch-tags: true` to both checkout steps (primary and retry) in the `checkout-pytorch` action, ensuring tags are explicitly fetched regardless of `single-branch` mode. Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912 ## Test plan - Verify that a workflow triggered by an RC tag (e.g. `v2.12.0-rc1`) correctly sets `PYTORCH_BUILD_VERSION=2.12.0+cpu` instead of `2.12.0.dev<date>+cpu` - Verify that nightly builds on the `nightly` branch are unaffected (they should still produce dev versions) Pull Request resolved: #180504 Approved by: https://github.com/seemethere (cherry picked from commit ba240c9) Co-authored-by: atalman <[email protected]>
…ytorch#180504) ## Summary Release candidate builds triggered by tags (e.g. `v2.12.0-rc1`) are incorrectly producing dev nightly versions instead of RC versions. The root cause is that pytorch#172544 added `single-branch: true` to the `checkout-pytorch` action when switching from `actions/checkout@v4` to `pytorch/test-infra/.github/actions/checkout@main`. With `single-branch: true`, git restricts the fetch refspec and tags are no longer fetched — even with `fetch-depth: 0`. This causes `binary_populate_env.sh` to fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exact fatal: No names found, cannot describe anything. and fall through to the dev version path, producing `2.12.0.dev20260415+cpu` instead of `2.12.0+cpu`. The fix adds `fetch-tags: true` to both checkout steps (primary and retry) in the `checkout-pytorch` action, ensuring tags are explicitly fetched regardless of `single-branch` mode. Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912 ## Test plan - Verify that a workflow triggered by an RC tag (e.g. `v2.12.0-rc1`) correctly sets `PYTORCH_BUILD_VERSION=2.12.0+cpu` instead of `2.12.0.dev<date>+cpu` - Verify that nightly builds on the `nightly` branch are unaffected (they should still produce dev versions) Pull Request resolved: pytorch#180504 Approved by: https://github.com/seemethere
…ytorch#180504) ## Summary Release candidate builds triggered by tags (e.g. `v2.12.0-rc1`) are incorrectly producing dev nightly versions instead of RC versions. The root cause is that pytorch#172544 added `single-branch: true` to the `checkout-pytorch` action when switching from `actions/checkout@v4` to `pytorch/test-infra/.github/actions/checkout@main`. With `single-branch: true`, git restricts the fetch refspec and tags are no longer fetched — even with `fetch-depth: 0`. This causes `binary_populate_env.sh` to fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exact fatal: No names found, cannot describe anything. and fall through to the dev version path, producing `2.12.0.dev20260415+cpu` instead of `2.12.0+cpu`. The fix adds `fetch-tags: true` to both checkout steps (primary and retry) in the `checkout-pytorch` action, ensuring tags are explicitly fetched regardless of `single-branch` mode. Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912 ## Test plan - Verify that a workflow triggered by an RC tag (e.g. `v2.12.0-rc1`) correctly sets `PYTORCH_BUILD_VERSION=2.12.0+cpu` instead of `2.12.0.dev<date>+cpu` - Verify that nightly builds on the `nightly` branch are unaffected (they should still produce dev versions) Pull Request resolved: pytorch#180504 Approved by: https://github.com/seemethere
Summary
Release candidate builds triggered by tags (e.g.
v2.12.0-rc1) are incorrectly producing dev nightly versions instead of RC versions.The root cause is that #172544 added
single-branch: trueto thecheckout-pytorchaction when switching fromactions/checkout@v4topytorch/test-infra/.github/actions/checkout@main. Withsingle-branch: true, git restricts the fetch refspec and tags are no longer fetched — even withfetch-depth: 0.This causes
binary_populate_env.shto fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exactfatal: No names found, cannot describe anything.
and fall through to the dev version path, producing
2.12.0.dev20260415+cpuinstead of2.12.0+cpu.The fix adds
fetch-tags: trueto both checkout steps (primary and retry) in thecheckout-pytorchaction, ensuring tags are explicitly fetched regardless ofsingle-branchmode.Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912
Test plan
v2.12.0-rc1) correctly setsPYTORCH_BUILD_VERSION=2.12.0+cpuinstead of2.12.0.dev<date>+cpunightlybranch are unaffected (they should still produce dev versions)