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(release): add automatic git tagging #207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dignifiedquire
Copy link

  • uses command line for now, to avoid introducing new dependencies and get something working now
  • currently can not be disabled, always uses the default, needs likely discussion what to do here, see todo in the code
  • command is configurable through tagCmd
  • no signing, could be added by everyone who wants, by modifying the tagCmd

Ref #157

@Stebalien
Copy link
Collaborator

Do we really need a separate tagCmd? Can we not just run two commands in the release command hook?

@hsanjuan
Copy link
Contributor

hsanjuan commented Oct 3, 2018

Please don't change default behaviour of gx release (don't do auto-tagging). It might break integrations which do tagging separately. (I think it's probably fine as it is now, assuming it doesn't tag when using legacy package.json without the tagCmd defined).

@Stebalien
Copy link
Collaborator

I'm definitely not suggesting that we replace existing releaseCmd definitions, just that new package.json files (generated by gx init) should have new releaseCmd definitions that auto-tag. The tricky part is running two commands without, e.g., depending on bash (although I guess that may be fine).

@raulk
Copy link

raulk commented Feb 25, 2019

Now that we're introducing different tag namespaces to distinguish gx vs. gomod version lineages, we need gx to create the tag to mitigate the chance of human error.

My concern with piling the tag command into the releaseCmd is that we'd need to go back and rewrite all package.json files of all repos to opt into tagging.

On the contrary, the tagCmd solution with a default fallback is immediately applicable to all repos.

BTW – gx should remind the user to use the --tags option when pushing, if a tag was created.

cc @Kubuxu

@Stebalien
Copy link
Collaborator

That assumes that the user has a git-based releaseCmd. If not, this'll end up tagging the commit before the package changes are committed.

I'm perfectly happy to mass-update the releaseCmd if we merge #227.

@raulk
Copy link

raulk commented Feb 26, 2019

@Stebalien I approved that PR (non-binding). If we're OK with the rewrite, then I'm fine as long as we explicitly echo "please push with --tags" as a reminder because I can see us tripping up more than once.

@Stebalien
Copy link
Collaborator

SGTM. So:

git commit -a -m \"gx publish $VERSION\" && git tag -as -m \"gx publish $VERSION\" gx/v$VERSION && echo \"Please remember to push with '--tags'\"

?

@raulk
Copy link

raulk commented Feb 26, 2019

I'd state the hash in the tag message, as the version number is redundant because it's part of the tag name. Other than that, LGTM.

@Stebalien
Copy link
Collaborator

So, the tag message is often (e.g., on GitHub) used as the tag's title. However, we should probably put the hash on the second line of the message. We'll need #228 for that.

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.

4 participants