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

Allow overriding git-semver-tags. #151

Open
samkelleher opened this issue May 10, 2019 · 2 comments
Open

Allow overriding git-semver-tags. #151

samkelleher opened this issue May 10, 2019 · 2 comments
Labels
goal::advance developer workflow Issues related to behavior that address a workflow not part of the most common workflow. type::enhancement A change to a project's repository that adds new behavior for downstream consumers. type::help wanted We need the community's help to address this issue through the contribution of a merge request.

Comments

@samkelleher
Copy link

samkelleher commented May 10, 2019

It's not possible to use the releaser tool unless you tag exactly with semver tags because it consumes the git-semver-tags package directly.

This is the line:
https://github.com/conventional-changelog/releaser-tools/blob/master/packages/conventional-github-releaser/src/index.js#L50

For better or worse, I have a website project that doesn't use semver tags, but an incremental counter tag, so v1, v2, v3, v4, v18273 and so forth; and alas these are not picked up by the semver tags so I can't get nice changelogs released 😢

Even providing from/to GIT SHAs doesn't work because the git tags check is still performed regardless.

I suggest:

  • Skip tag loading when a from and to value is provided.
  • Allow passing a function that can be used for returning tag data to replace git-semver-tags
@hutson hutson added goal::advance developer workflow Issues related to behavior that address a workflow not part of the most common workflow. type::enhancement A change to a project's repository that adds new behavior for downstream consumers. type::help wanted We need the community's help to address this issue through the contribution of a merge request. labels May 28, 2019
@hutson
Copy link
Contributor

hutson commented May 28, 2019

@samkelleher, thank you for explaining your use case. I was able to confirm that the semver package used by git-semver-tags treats a tag, such as v1, as invalid:

> semver.valid(`v1`)
null
> semver.valid(`v1.0.0`)
'1.0.0'

Personally I don't have time to work on this particular feature, but I have marked the issue as help wanted in case someone is willing and able to invest the time in incorporating support for non-semver tags, such as v1, into the release tools.

@samkelleher
Copy link
Author

I've been working on this. Since non-semver suits my usecase, I'd preferable to use the package as is but pass in options. I've had success with this, however, the changlog outputted contains duplicate headers, due to the non-configurable line below.

This line hardcodes semver detection and cannot be changed by passing in config options:
https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-core/lib/merge-config.js#L25

This line uses semver by default, but can be replaced by options:
https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/index.js#L33

So all thats needed is a config option for conventional-changelog-core and it'll all work as normal, providing you give it new regex to match tags on (/v[0-9]+\.[0-9]+(?:\.[0-9]+)?/gi; which would allow v1 and v1.2.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal::advance developer workflow Issues related to behavior that address a workflow not part of the most common workflow. type::enhancement A change to a project's repository that adds new behavior for downstream consumers. type::help wanted We need the community's help to address this issue through the contribution of a merge request.
Development

No branches or pull requests

2 participants