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

Preset: read version from file #157

Closed
jmfayard opened this issue Jan 2, 2020 · 8 comments · Fixed by #160
Closed

Preset: read version from file #157

jmfayard opened this issue Jan 2, 2020 · 8 comments · Fixed by #160
Labels
enhancement New feature or request

Comments

@jmfayard
Copy link

jmfayard commented Jan 2, 2020

Hello,
I have found out about gitmoji-changelog at https://dev.to/yvonnickfrin/gitmoji-changelog-v2-is-out-51hb and really like the idea

I would like to use it for my project https://github.com/jmfayard/gradle-dependencies-plugins

To make it easy to setup the CI, my versions are in a simple file text

$ cat refreshVersions/plugins_version.txt
0.8.6
$ cat dependencies/plugins_version.txt
0.5.1

(that would be two changelogs, which is fine)

Not terribly complicated.
The thing is that my javascript skills are closed to undefined so I would be really grateful if someone can write the corresponding preset for me

@frinyvonnick
Copy link
Owner

frinyvonnick commented Jan 2, 2020

Hi @jmfayard,

Thank you for posting this feature request! I have a few questions.

Your project don't use gitmoji. Are you planning to follow it otherwise gitmoji-changelog won't works well since it uses it to classify commits in categories.

A preset needs at least 3 properties: a name, a description and a version. Your file only contains a version. You should define where the preset should look for these. The naming of your file seems a bit specific aswell?

The list of commits in your two changelogs will be the same? gitmoji-changelog uses tags to link commits to a version. I can't find out how you can have two differents versions in the same repository. I'm not really familiar with Kotlin version management. Maybe you can explain it to me a bit or at least give me a pointer to some documentation?

I wondering if a gradle plugin would be what you are really looking for?

Sorry for the huge amount of questions. I try to understand what you would best fit to your needs and remain useful for other users 👍

@jmfayard
Copy link
Author

jmfayard commented Jan 2, 2020

Hello @frinyvonnick

  • I didn't know about gitmoji before I stumbled upon your post, but now I want to use it
  • I can change the filename and add infos to it. It is setup this way only so that when I change this file, GitHub Action starts making a release. see workflow
  • The simple way to answer your questions is that the folder refreshVersions and dependencies are separate projects contained in the same git repository. There is not much Kotlin specific really. Ideally I could launch gitmoji-changelog inside the refreshVersions folder and it will count only the commits inside that folder.

@frinyvonnick
Copy link
Owner

frinyvonnick commented Jan 2, 2020

Ok so you want a sort of standalone preset that works regardless of the technology. Actually gitmoji-changelog use the .git folder to get commits so it doesn't take in account the current folder to filter commits. It is not monorepo friendly which is silly since gitmoji-changelog is a monorepo 😂

We have two issues here:

  • Create a generic preset
  • gitmoji-changelog should filter commits if the current path is not project root

Thank you for your answers!

@jmfayard
Copy link
Author

jmfayard commented Jan 2, 2020

that sounds about right. relative to the first task, if you can come up with a simple file format that contain the information you need, I will update my project tu use that!

@frinyvonnick
Copy link
Owner

One last thing. In a previous comment I talked about tags. gitmoji-changelog uses tags to retrieve previous versions (also useful to determine which part of the changelog it can override and which part to let unchanged). I see you use tags but they seems related to only one of the projects, am I wrong? I bet this will lead to some weird result. I don't know how to deal with independent versioning in a monorepo.

@jmfayard
Copy link
Author

jmfayard commented Jan 2, 2020

I am not sure. Would that help if all my tags are like refreshVersions-x.y.z and dependencies-x.y.z ?

@frinyvonnick
Copy link
Owner

These are not semver but that could be a solution to handle a prefix in tags (I need to look for literature on that subject). The conversation about handling monorepos can be discussed in a separate issue. 👉 #158

@frinyvonnick
Copy link
Owner

@jmfayard I created a generic preset. You can test it with the canary version.

Here is how to use the generic preset:

  1. Create a file .gitmoji-changelogrc at the project root with the following content
{
  "project": {
    "name": "gradle-dependencies-plugins",
    "description": "Gradle dependencies with IDE integration and lookup for available updates",
    "version": "0.8.3"
  }
}
  1. Call gitmoji-changelog with the preset option set to generic
npx gitmoji-changelog@canary --preset generic

Hope it will help!

I'll publish it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants