Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(util/template): add prettyVersion field #16831

Merged
merged 38 commits into from Aug 8, 2022

Conversation

hasanwhitesource
Copy link
Contributor

Changes

Exposed a handlebars function to enable prettifying newVersion and newMajor.

Context

Closes #13299

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

docs/usage/templates.md Outdated Show resolved Hide resolved
lib/util/template/index.ts Outdated Show resolved Hide resolved
@hasanwhitesource
Copy link
Contributor Author

@HonkingGoose what do you think of the docs change ?

@astellingwerf
Copy link
Collaborator

May I suggest you update the PR title to 'prepend' instead of 'append'?

@hasanwhitesource hasanwhitesource changed the title fix(util/template): add function to append 'v' fix(util/template): add function to prepend 'v' Jul 29, 2022
hasanwhitesource and others added 2 commits July 29, 2022 10:42
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
@rarkins
Copy link
Collaborator

rarkins commented Jul 29, 2022

How does this compare in ease of use to just using a replace helper? Or does it not support regex ^?

@hasanwhitesource
Copy link
Contributor Author

How does this compare in ease of use to just using a replace helper? Or does it not support regex ^?

You mean to expose a function to users that replaces strings ?

@rarkins
Copy link
Collaborator

rarkins commented Jul 31, 2022

We already expose a replace function

@rarkins
Copy link
Collaborator

rarkins commented Jul 31, 2022

Why not the prettyX strings we discussed previously? If it's a common use case then let's just prepopulate them

@hasanwhitesource
Copy link
Contributor Author

@rarkins It is the same as we discussed in the issue I just named it prettifyVersion so it can be used like this :

{
    "semanticCommits": "enabled",
    "commitMessageAction": "",
    "commitMessageTopic": "{{depName}}",
    "commitMessageExtra": "{{prettifyVersion newVersion}}"
}

or on newMajor

{
    "semanticCommits": "enabled",
    "commitMessageAction": "",
    "commitMessageTopic": "{{depName}}",
    "commitMessageExtra": "{{prettifyVersion newMajor}}"
}

@rarkins
Copy link
Collaborator

rarkins commented Jul 31, 2022

Why not just prettyVersion etc? I don't think we discussed which is better for the end user or maintainability

@hasanwhitesource hasanwhitesource marked this pull request as draft July 31, 2022 14:19
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Plans for prettyNewMajor too?

lib/modules/manager/types.ts Outdated Show resolved Hide resolved
lib/util/template/index.ts Outdated Show resolved Hide resolved
lib/workers/repository/updates/generate.ts Outdated Show resolved Hide resolved
@hasanwhitesource hasanwhitesource marked this pull request as ready for review August 5, 2022 21:24
rarkins
rarkins previously approved these changes Aug 6, 2022
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

lib/config/options/index.ts Show resolved Hide resolved
rarkins
rarkins previously approved these changes Aug 6, 2022
@rarkins rarkins requested a review from viceice August 7, 2022 07:00
lib/modules/manager/types.ts Outdated Show resolved Hide resolved
@viceice viceice changed the title fix(util/template): add prettyVersion field feat(util/template): add prettyVersion field Aug 8, 2022
@viceice viceice enabled auto-merge (squash) August 8, 2022 07:40
@viceice viceice merged commit 4ead106 into renovatebot:main Aug 8, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.152.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rarkins rarkins added the regression Issue about a regression bug, or the PR caused it label Aug 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Issue about a regression bug, or the PR caused it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

{{version}} in commitMessageExtra contains "v"
6 participants