Skip to content

Commit

Permalink
fix: spring boot dep update
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek committed Aug 1, 2023
1 parent 6eac0d0 commit 8ee1591
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hack/update-springboot-platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const parseXML = (text) => new Promise((resolve, reject) => {
const platformFromPom = async (pomPath) => {
const pomData = await readFile(pomPath, {encoding: 'utf8'});
const pom = await parseXML(pomData)
return pom.project.properties[0]['springboot.platform.version'][0]
return pom.project.parent[0].version[0]
}

const prepareBranch = async (branchName, prTitle) => {
Expand All @@ -79,8 +79,10 @@ const prepareBranch = async (branchName, prTitle) => {

const updatePlatformInPom = async (pomPath, newPlatform) => {
const pomData = await readFile(pomPath, {encoding: 'utf8'});
const newPomData = pomData.replace(new RegExp('<springboot.platform.version>[\\w.]+</springboot.platform.version>', 'i'),
`<springboot.platform.version>${newPlatform}</springboot.platform.version>`)
const pom = await parseXML(pomData)
pom.project.parent[0].version[0] = newPlatform
const builder = new xml2js.Builder( { headless: false, renderOpts: { pretty: true } })
const newPomData = builder.buildObject(pom)
await writeFile(pomPath, newPomData)
}

Expand Down

5 comments on commit 8ee1591

@trisberg
Copy link
Member

Choose a reason for hiding this comment

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

Not sure how this would handle a point release upgrade of boot that also needs a spring-cloud version upgrade. Typically the spring-cloud releases only supports a limited range of boot version. The current (2022.4) version supports up to 3.1.x but not the next 3.2.x versions.

@matejvasek
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trisberg how could I solve this? Can I use some bom specifying compatible cloud event version?

@matejvasek
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trisberg At worst we could merge this PR. If there is incompatibility in future test will tell us.

@trisberg
Copy link
Member

Choose a reason for hiding this comment

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

We could do the same for spring-cloud and use the latest - https://api.github.com/repos/spring-cloud/spring-cloud-release/releases/latest

There might be a gap of a few days between the boot release and the compatible spring-cloud release, but if tests catch any issues then we should be ok.

@trisberg
Copy link
Member

Choose a reason for hiding this comment

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

Please sign in to comment.