Skip to content

Allow leading v on commit message versions#245

Closed
jonmcquillan wants to merge 0 commit intodependabot:mainfrom
jonmcquillan:main
Closed

Allow leading v on commit message versions#245
jonmcquillan wants to merge 0 commit intodependabot:mainfrom
jonmcquillan:main

Conversation

@jonmcquillan
Copy link
Contributor

@jonmcquillan jonmcquillan commented Aug 19, 2022

Fix #244

@jonmcquillan jonmcquillan requested a review from a team as a code owner August 19, 2022 03:40
@jonmcquillan jonmcquillan changed the title Allow leading v on commit message versions (#1) Allow leading v on commit message versions Sep 17, 2022
Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

This looks great, nice job with the tests.

Just need the one behavior change and then happy to merge... looks pretty straightforward.

Sorry took so long to get this reviewed, but now that I'm familiar with what you're trying to do I can review any updates quickly.

expect(updatedDependencies[0].packageEcosystem).toEqual('nuget')
expect(updatedDependencies[0].targetBranch).toEqual('main')
expect(updatedDependencies[0].prevVersion).toEqual('4.0.1')
expect(updatedDependencies[0].newVersion).toEqual('4.2.2')
Copy link
Member

Choose a reason for hiding this comment

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

As I explained in #244 (comment), I think it'd be more consistent if this was v4.2.2 preserving the "v"...

const prev = bumpFragment?.groups?.from ?? ''
const next = bumpFragment?.groups?.to ?? ''
const prev = bumpFragment?.groups?.from.replace('v', '') ?? ''
const next = bumpFragment?.groups?.to.replace('v', '') ?? ''
Copy link
Member

Choose a reason for hiding this comment

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

I think if you move this replace() from here to where the update is actually calculated then it'll preserve the "v"

src/main.test.ts Outdated
expect(core.setOutput).toBeCalledWith('cvss', 0)
})

test('it sets the updated dependency as an output for subsequent actions when there is a leading v in the commit message version', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

This is exactly why we should preserve the leading "v"... the user may do post-processing and I'd rather leave the decision to "strip" any prefix up to them...

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.

Handle leading "v" in versions in a commit message

2 participants