fix(ci): fetch upstream tags in WSL2 workflow for correct version detection, for #8151#8153
Merged
Merged
Conversation
…ection ## The Issue - For ddev#8151 PR ddev#8151 added WSL2 testing but builds from forked PRs get incorrect version numbers (e.g., v1.23.5-846-gbaeb0de45 instead of v1.25.0-xxx). This causes addon-get tests to fail on version constraint checks because the fork's remote may not have current upstream tags synced. ## How This PR Solves The Issue The workflow clones from the fork (for PRs) but only fetches tags from that fork's remote. Since forks may not have current upstream tags synced, `git describe` finds old tags like v1.23.5 instead of v1.25.0. **Changes:** - Add upstream (ddev/ddev) as a git remote after cloning - Fetch tags from upstream instead of (or in addition to) origin - This matches the behavior of `actions/checkout@v5` with `fetch-depth: 0` used in other workflows The clone command now: 1. Clones from fork (preserving PR source) 2. Adds upstream remote (github.repository = ddev/ddev) 3. Fetches tags from upstream (git fetch upstream --tags) 4. git describe now finds correct version tags ## Manual Testing Instructions 1. Create a PR from a fork that doesn't have latest tags synced 2. Trigger the WSL2 workflow 3. Verify the "Clone repository for testuser" step shows correct version 4. Verify addon-get tests pass with proper version detection ## Automated Testing Overview This fix will be validated by the WSL2 workflow itself. The workflow should now correctly detect version as v1.25.0-based instead of v1.23.5-based. ## Release/Deployment Notes - No impact on released artifacts - Fixes CI testing for PRs from forks Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Download the artifacts for this pull request:
See Testing a PR. |
…[skip buildkite] When a fork has conflicting tags (e.g., v1.5.2), git fetch --tags fails with 'would clobber existing tag'. Using --force allows upstream tags to overwrite fork tags, ensuring git describe finds correct version tags from upstream.
…s [skip buildkite]
This is a cleaner approach that avoids tag conflicts entirely:
Before:
- Cloned from fork URL with fork's branch
- Had to add upstream remote and force-fetch tags
- Tags could conflict between fork and upstream
After:
- Always clone from ddev/ddev (base repository)
- For PRs: fetch refs/pull/{PR_NUMBER}/head
- For push/workflow_dispatch: fetch the branch name
- Automatically has all upstream tags, no conflicts
This matches how GitHub Actions checkout works internally and is the
standard way to access PR code from the base repository.
Member
Author
|
Working on this forked PR, see https://github.com/ddev/ddev/actions/runs/22123406104/job/63948283377#step:9:131 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
PR #8151 added WSL2 testing but builds from forked PRs get incorrect version
numbers (e.g., v1.23.5-846-gbaeb0de45 instead of v1.25.0-xxx). This causes
addon-get tests to fail on version constraint checks because the fork's
remote may not have current upstream tags synced.
Example failure: https://github.com/ddev/ddev/actions/runs/22113033548/job/63929400145#step:9:13845
How This PR Solves The Issue
The workflow clones from the fork (for PRs) but only fetches tags from that
fork's remote. Since forks may not have current upstream tags synced,
git describefinds old tags like v1.23.5 instead of v1.25.0.Changes:
actions/checkout@v5withfetch-depth: 0used in other workflows
The clone command now:
Manual Testing Instructions
Automated Testing Overview
This fix will be validated by the WSL2 workflow itself. The workflow should
now correctly detect version as v1.25.0-based instead of v1.23.5-based.
Release/Deployment Notes