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

Support tags prefixed with 'v' #55

Open
hutson opened this issue Mar 20, 2018 · 0 comments
Open

Support tags prefixed with 'v' #55

hutson opened this issue Mar 20, 2018 · 0 comments

Comments

@hutson
Copy link
Contributor

hutson commented Mar 20, 2018

Re-posting the following enhancement suggestion from the previous GitLab project for conventional-gitlab-releaser:


Alexander Kachkaev @kachkaev:

At the moment tagname is hardcoded to have a format of D.D.D. It would be nice if users could also release vD.D.D (e.g. like GitLab does this itself)


Alexander Kachkaev @kachkaev:

This could be probably solved either in a form of a boolean flag or an optional transform function. What would be also nice is to have a transform function for the message field, which currently defaults to Release x.x.x. Someone may want to see smth like Release x.x.x (YYYY-MM-DD), for instance.


Me:

@kachkaev I believe the value passed to tag_name is nothing more than the tag created by the following line. Therefore, perhaps we can update semantic-release-gitlab to prepend a v, and allow that to propagate to semantic-release-gitlab-releaser and semantic-gitlab-notifier? Thoughts on that idea?

As for your second idea, would you mind breaking that out into a separate issue? As for the transform function idea, I like the idea. I think it's fantastic. The only issue we'll need to keep in mind is that the arguments we pass to conventional-gitlab-releaser need to match conventional-github-releaser. We plan on merging the two projects together in the future.


Alexander Kachkaev @kachkaev:

Thanks for your reply @hutson!

Looks like that line is not the only one that needs changing. In index.js of conventional-gitlab-releaser the remote tag on GitLab is derived from the semver again. I'm using this package separately from semantic-release-gitlab and still can't get v in the version.

Possible solution:

// before
conventionalGitlabReleaser(AUTH, {
  preset: 'angular'
}, callback);

// after
conventionalGitlabReleaser(AUTH, {
  preset: 'angular',
  vInTag: true
}, callback);
// ...
gitlab.projects.repository.addTag({
            id: context.owner + '/' + context.repository,
            // 'tag_name': version, // <-- before
            'tag_name': (changelogOpts.vInVersion ? 'v' : '') + version, // <-- after
            ref: chunk.keyCommit.hash,
            message: 'Release ' + version,
            'release_description': chunk.log
          }, function(response) {
// ...

How about this?

Perhaps, something like tagPrefix: 'v' could be an alternative to a boolean flag, but I can't remember any repos that would use any other convention for semantic tags rather than D.D.D or vD.D.D.


Alexander Kachkaev @kachkaev:

Re. release transform function: https://gitlab.com/hyper-expanse/conventional-gitlab-releaser/issues/5


Me:

@kachkaev the boolean proposal for conventional-gitlab-releaser looks fine with me. Please feel free to submit a pull request to add that option.


Alexander Kachkaev @kachkaev:

I'm not sure I'll find time for this @hutson. Feel free to reuse my code in a new PR! I might be back when I find a need to use your library again, it really helped me last year 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant