Skip to content

fix(ci): fetch upstream tags in WSL2 workflow for correct version detection, for #8151#8153

Merged
rfay merged 3 commits into
ddev:mainfrom
rfay:20260217_rfay_better_version
Feb 18, 2026
Merged

fix(ci): fetch upstream tags in WSL2 workflow for correct version detection, for #8151#8153
rfay merged 3 commits into
ddev:mainfrom
rfay:20260217_rfay_better_version

Conversation

@rfay

@rfay rfay commented Feb 18, 2026

Copy link
Copy Markdown
Member

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 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

…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>
@rfay rfay requested a review from a team as a code owner February 18, 2026 01:41
@github-actions

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown

rfay added 2 commits February 17, 2026 18:48
…[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.
@rfay

rfay commented Feb 18, 2026

Copy link
Copy Markdown
Member Author

@stasadev stasadev changed the title fix(ci): fetch upstream tags in WSL2 workflow for correct version detection fix(ci): fetch upstream tags in WSL2 workflow for correct version detection, for #8151 Feb 18, 2026

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

@rfay rfay merged commit 5aa0fe4 into ddev:main Feb 18, 2026
41 checks passed
@rfay rfay deleted the 20260217_rfay_better_version branch February 18, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants