Skip to content

fix: update_cucumber script should not fail on manually created releases#396

Merged
acoulton merged 1 commit intoBehat:masterfrom
acoulton:fix-cucumber-update
Nov 12, 2025
Merged

fix: update_cucumber script should not fail on manually created releases#396
acoulton merged 1 commit intoBehat:masterfrom
acoulton:fix-cucumber-update

Conversation

@acoulton
Copy link
Contributor

The script was assuming that target_commitish in the releases API would generally be the hash of the release tag, other than for an edge case on v29.0.0 which had been patched manually in the code.

In fact, target_commitish will only be a hash if the tag was created before the release (e.g. by cucumber's automated release actions). If the release is created manually in the github UI with a not-yet-existing tag then target_commitish will instead be the branch name it was created from. In that case, the only way to get the hash is to separately look up the tag name in the tags API.

This was causing the script to fail due to two recent manual releases on the upstream repo.

I have fixed this to now look up tag details if they're missing from the releases API. As part of this, I have refactored to only look up releases that are >= the one we are currently pinned to. This means we will only need to look up tags for manual releases until we update past them.

The script was assuming that `target_commitish` in the releases API
would generally be the hash of the release tag, other than for an edge
case on v29.0.0 which had been patched manually in the code.

In fact, `target_commitish` will only be a hash if the tag was created
before the release (e.g. by cucumber's automated release actions). If
the release is created manually in the github UI with a not-yet-existing
tag then `target_commitish` will instead be the branch name it was
created from. In that case, the only way to get the hash is to
separately look up the tag name in the tags API.

This was causing the script to fail due to two recent manual releases on
the upstream repo.

I have fixed this to now look up tag details if they're missing from the
releases API. As part of this, I have refactored to only look up
releases that are `>=` the one we are currently pinned to. This means we
will only need to look up tags for manual releases until we update past
them.
@acoulton acoulton requested a review from stof November 12, 2025 09:39
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.86%. Comparing base (9dec914) to head (4e2de3c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #396   +/-   ##
=========================================
  Coverage     95.86%   95.86%           
  Complexity      669      669           
=========================================
  Files            44       44           
  Lines          1934     1934           
=========================================
  Hits           1854     1854           
  Misses           80       80           
Flag Coverage Δ
php8.1 95.86% <ø> (ø)
php8.1--with=symfony/yaml:^5.4 95.86% <ø> (ø)
php8.1--with=symfony/yaml:^6.4 95.86% <ø> (ø)
php8.2 95.86% <ø> (ø)
php8.3 95.86% <ø> (ø)
php8.4 95.86% <ø> (ø)
php8.5 95.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@acoulton acoulton merged commit 061a7e3 into Behat:master Nov 12, 2025
11 checks passed
@acoulton acoulton deleted the fix-cucumber-update branch November 12, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants