Fix stray fragment injection in updateVersion gradle task - #1913
Merged
Conversation
heemin32
requested review from
VijayanB,
bzhangam,
chishui,
jmazanec15,
junqiu-lei,
martin-gaievski,
minalsha,
model-collapse,
naveentatikonda,
navneet1v,
owaiskazi19,
sean-zheng-amazon,
vamshin,
vibrantvarun,
yuye-aws,
zane-neo and
zhichao-aws
as code owners
July 24, 2026 23:40
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1913 +/- ##
============================================
+ Coverage 83.43% 83.45% +0.01%
- Complexity 3898 3900 +2
============================================
Files 291 291
Lines 13844 13844
Branches 2304 2304
============================================
+ Hits 11551 11553 +2
+ Misses 1458 1457 -1
+ Partials 835 834 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
heemin32
force-pushed
the
updateVersion
branch
2 times, most recently
from
July 24, 2026 23:55
7c0513a to
5bfbe93
Compare
| def rollingSection = updatedContent.substring(updatedContent.indexOf('Rolling-Upgrade-BWCTests-NeuralSearch:')) | ||
| def rollingVersions = extractVersions(rollingSection) | ||
| if (!rollingVersions.isEmpty() && isCurrentVersionNewer(rollingVersions.last())) { | ||
| def updatedRollingSection = rollingSection.replaceFirst( |
Member
There was a problem hiding this comment.
Not introduced by this PR, but noticed while tracing: two replace regexes differ.
- Restart:
^\s*bwc_version\s*:\s*\[...tolerates a space before the colon - Rolling:
^\s*bwc_version:\s*\[...requires no space before the colon
if the rolling bwc_version line were ever formatted as bwc_version :, extraction would succeed and log "Added …" while replaceFirst silently no-ops, silent failure
martin-gaievski
approved these changes
Jul 27, 2026
When appending the current version to the rolling-upgrade BWC list, the rolling section was sliced from updatedContent using a stale offset. Updating the restart-upgrade section beforehand changed the string length, so the stale offset pointed before the rolling job header and captured the tail of the preceding line, injecting an invalid fragment into the workflow YAML. Recompute the offset inline when extracting the rolling section, matching the pattern used by the equivalent task in the search-relevance repo. Signed-off-by: Heemin Kim <heemin@amazon.com>
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.
Description
When appending the current version to the rolling-upgrade BWC list, the
rolling section was sliced from updatedContent using a stale offset. Updating
the restart-upgrade section beforehand changed the string length, so the stale
offset pointed before the rolling job header and captured the tail of the
preceding line, injecting an invalid fragment into the workflow YAML.
Recompute the offset inline when extracting the rolling section, matching the
pattern used by the equivalent task in the search-relevance repo.
Related Issues
N/A
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.