Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -689,15 +689,16 @@ task updateVersion {
println "Added ${currentVersionWithoutSnapshot} to Restart-Upgrade BWC version list"
}

// Extract and update Rolling-Upgrade section
def rollingSection = updatedContent.substring(rollingStart)
// Extract and update Rolling-Upgrade section.
// Recompute the offset inline, since updating the restart section above may have
// changed the length of updatedContent and invalidated rollingStart.
def rollingSection = updatedContent.substring(updatedContent.indexOf('Rolling-Upgrade-BWCTests-NeuralSearch:'))
def rollingVersions = extractVersions(rollingSection)
if (!rollingVersions.isEmpty() && isCurrentVersionNewer(rollingVersions.last())) {
def updatedRollingSection = rollingSection.replaceFirst(

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.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated

/(?m)(^\s*bwc_version:\s*\[([^\]]+))\]/,
"\$1, \"${currentVersionWithoutSnapshot}\"]"
)
// Need to recalculate rollingStart in case the restart section changed
def newRollingStart = updatedContent.indexOf('Rolling-Upgrade-BWCTests-NeuralSearch:')
updatedContent = updatedContent.substring(0, newRollingStart) + updatedRollingSection
println "Added ${currentVersionWithoutSnapshot} to Rolling-Upgrade BWC version list"
Expand Down
Loading