feat(examples): add GitLab built-in changelog templates#1561
feat(examples): add GitLab built-in changelog templates#1561JDanRibeiro wants to merge 2 commits into
Conversation
orhun
left a comment
There was a problem hiding this comment.
thank you for the PR, looks great! just have some suggestion for improving it
There was a problem hiding this comment.
There seems to be some issues with formatting, can you look into it?
e.g. I tried:
$ cargo run -- -c examples/gitlab.toml --gitlab-repo filipriec/tui-pages -u
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.44s
Running `target/debug/git-cliff -c examples/gitlab.toml --gitlab-repo filipriec/tui-pages -u`
## What's Changed
### Bug Fixes
* handle nested annotated tags
* move heart emoji before "New Contributors" heading
* link to correct release notes
* ignore missing git objects
### Features
* add GitLab built-in changelog templates
* add no_increment_regex config<!-- generated by git-cliff -->
(there is no newline before footer)
There was a problem hiding this comment.
Problem identified and corrected.
There was a problem hiding this comment.
Can we use the ! prefix for the GitLab MR references? That's what we do in the other template :)
e.g.
- Ignore missing git objects (#1523) ([4377363](https://gitlab.com/filipriec/tui-pages/-/commit/437736385b66057cdb138f08a4bbb7a4f0424adf))
I think that should be !1523, right?
|
|
||
| ## GitLab Changelog | ||
|
|
||
| If you would like to create release notes tailored for GitLab, you can use the [`gitlab.toml`](https://github.com/orhun/git-cliff/tree/main/examples/gitlab.toml) example. |
There was a problem hiding this comment.
We can mention the other template file (detailed) as well.
There was a problem hiding this comment.
Thank you very much, correction made.
| - [`gitlab.toml`](https://github.com/orhun/git-cliff/tree/main/examples/gitlab.toml): release notes format tailored for GitLab Releases. | ||
| - [`gitlab-detailed.toml`](https://github.com/orhun/git-cliff/tree/main/examples/gitlab-detailed.toml): detailed changelog with GitLab commit and merge request links. |
There was a problem hiding this comment.
How about we remove the detailed template and just add keepachangelog one, just to be aligned with the GitHub template as well?
i.e. let's have gitlab and gitlab-keepachangelog :)
There was a problem hiding this comment.
The applied standard really makes a lot of sense.
| {% macro print_commit(commit) -%} | ||
| - {% if commit.breaking %}**BREAKING:** {% endif %}{{ commit.message | split(pat="\n") | first | upper_first | trim }} \ | ||
| ([{{ commit.id | truncate(length=7, end="") }}]({{ self::project_url() }}/-/commit/{{ commit.id }}))\ | ||
| {%- if commit.remote.pr_number %} in [!{{ commit.remote.pr_number }}]({{ self::project_url() }}/-/merge_requests/{{ commit.remote.pr_number }}){%- endif -%}\ |
There was a problem hiding this comment.
This behavior was replicated, as shown in lines 44 and 67.
#1561 (comment)
- Fix missing newline before footer in gitlab.toml (unreleased output) - Rename gitlab-detailed.toml to gitlab-keepachangelog.toml - Use ! prefix for MR references and strip (orhun#123) from commit messages - Update docs (initializing, integration, templating examples)
7249193 to
9888ee5
Compare
Description
Adds two built-in GitLab changelog templates under
examples/:gitlab.toml— release notes format tailored for GitLab Releases (merge request links, contributors, tag links)gitlab-keepachangelog.toml— detailed Keep a Changelog-style format with GitLab commit and merge request linksAlso updates the documentation:
website/docs/usage/initializing.md— lists the new templates for--initand--configwebsite/docs/integration/gitlab.md— adds a "GitLab Changelog" section with usage exampleswebsite/docs/templating/examples.md— adds rendered previews for both GitLab templatesMotivation and Context
GitLab integration has been supported since v2.3.0, but there were no official built-in templates equivalent to
github.tomlandgithub-keepachangelog.toml. This makes it harder for GitLab users to get started with--init/ built-in--confignames.Closes #1560
How Has This Been Tested?
cargo build(templates are embedded viaBuiltinConfig)git cliff --init gitlabgeneratescliff.tomlfrom the new templategit cliff --config gitlab --dry-runloads the built-in templategit cliff --config gitlab-keepachangelog --dry-runloads the detailed templatecargo testpassesEnvironment: git-cliff built from source with the
gitlabfeature enabled.Screenshots / Logs (if applicable)
N/A
Types of Changes
Checklist:
cargo +nightly fmt --all— N/A (no Rust changes)cargo clippy --tests --verbose -- -D warnings— N/A (no Rust changes)cargo test