Skip to content

fix: only exclude pre-v4 versions#19328

Open
daynewlee wants to merge 2 commits intomasterfrom
yli3/properCheck410
Open

fix: only exclude pre-v4 versions#19328
daynewlee wants to merge 2 commits intomasterfrom
yli3/properCheck410

Conversation

@daynewlee
Copy link
Contributor

@daynewlee daynewlee commented Mar 6, 2026

Description

echo "4.11.0" | grep -oE '^4\.[0-3]\.' returns nothing

echo "4.11.0" | grep -oE '^[0-4]\.[0-3]'
4.1

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

change me!

@daynewlee daynewlee requested a review from a team as a code owner March 6, 2026 20:19
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new version filtering logic now uses two separate grep invocations and multiple pipes; consider consolidating the checks (e.g., a single regex or shell pattern match) to reduce process overhead and make the version ranges being excluded easier to read at a glance.
  • Instead of "$(echo "${releases[$v]}" | xargs)" to trim whitespace, you can use shell parameter expansion (e.g., ${var## } / ${var%% } or similar) to avoid spawning extra processes in this tight loop.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new version filtering logic now uses two separate `grep` invocations and multiple pipes; consider consolidating the checks (e.g., a single regex or shell pattern match) to reduce process overhead and make the version ranges being excluded easier to read at a glance.
- Instead of `"$(echo "${releases[$v]}" | xargs)"` to trim whitespace, you can use shell parameter expansion (e.g., `${var## }` / `${var%% }` or similar) to avoid spawning extra processes in this tight loop.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@daynewlee daynewlee requested review from dcaravel and jvdm March 6, 2026 20:32
# Sanity check.
if echo "$version" | grep -q '^[0-4]\.[0-3]'; then
echo >&2 "info: skipping pre-V4 tag: $version"
if echo "$version" | grep -q '^[0-3]\.'; then
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be extra cautious

Comment on lines +43 to +48
if echo "$version" | grep -q '^[0-3]\.'; then
# pre-v4, skip
continue
fi
if echo "$version" | grep -qE '^4\.[0-3]\.'; then
# v4.0 - v4.3, skip
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if echo "$version" | grep -q '^[0-3]\.'; then
# pre-v4, skip
continue
fi
if echo "$version" | grep -qE '^4\.[0-3]\.'; then
# v4.0 - v4.3, skip
# Validate and extract major.minor from X.Y.Z format.
if [[ ! "$version" =~ ^([0-9]+)\.([0-9]+)\.[0-9]+$ ]]; then
echo >&2 "error: invalid version format (expected X.Y.Z): $version"
exit 2
fi
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
# Pre-V4 means: major < 4, OR (major == 4 AND minor < 4).
if [[ $major -lt 4 ]]; then
exit 0 # is pre-V4
fi
if [[ $major -eq 4 && $minor -lt 4 ]]; then
exit 0 # is pre-V4
fi

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 6, 2026

Images are ready for the commit at fa0e4fa.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-168-g6f4c70e6aa.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.66%. Comparing base (90c5713) to head (fa0e4fa).
⚠️ Report is 96 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19328      +/-   ##
==========================================
+ Coverage   49.54%   49.66%   +0.12%     
==========================================
  Files        2674     2689      +15     
  Lines      201755   202532     +777     
==========================================
+ Hits        99956   100594     +638     
- Misses      94340    94428      +88     
- Partials     7459     7510      +51     
Flag Coverage Δ
go-unit-tests 49.66% <ø> (+0.12%) ⬆️

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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants