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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic links for GitLab merge requests are not generated #193

Open
dbluxo opened this issue Nov 24, 2021 · 0 comments
Open

Automatic links for GitLab merge requests are not generated #193

dbluxo opened this issue Nov 24, 2021 · 0 comments

Comments

@dbluxo
Copy link

dbluxo commented Nov 24, 2021

Hi 馃憢

Expected Behavior

We expect a generated changelog to contain the links to the GitLab merge requests.

Actual Behavior

The generated changelog lists the merge requests, but the links are missing:

<a name="2021.09.22"></a>
## [2021.09.22] - 2021-09-22
### Merge Requests
- Merge branch 'renovate/aws-ebs-csi-driver-2.x' into 'main'
- Merge branch 'renovate/aws-ebs-csi-driver-2.x' into 'main'
- Merge branch 'renovate/aws-ebs-csi-driver-2.x' into 'main'
- Merge branch 'renovate/cluster-autoscaler-9.x' into 'main'
- Merge branch 'renovate/cluster-autoscaler-9.x' into 'main'
- Merge branch 'renovate/kubernetes-dashboard-5.x' into 'main'
- Merge branch 'renovate/kubernetes-dashboard-4.x' into 'main'

Steps to Reproduce (including precondition)

We are running git-chglog -o CHANGELOG.md in a repo which includes merge request commits, extract from a git log:

...
commit addf4f5ed8fac3e38aa59e88eb373a38c2123bb4 (tag: 2021.09.22)
Merge: 941f9bf 17bc668
Author: <redacted>
Date:   Wed Sep 22 07:16:30 2021 +0000

    Merge branch 'renovate/aws-ebs-csi-driver-2.x' into 'main'

    Update Helm release aws-ebs-csi-driver to v2.2.1

    See merge request k8s/quickstart-eks!207

commit a7bc668bdffba52366858d1d805b1950d0594bd2
Author: <redacted>
Date:   Wed Sep 22 03:15:08 2021 +0000

    Update Helm release aws-ebs-csi-driver to v2.2.1

commit a41f9bfe69cd686f409cd95808df24eaddf39a20
Merge: 8e75b7d c595646
Author: <redacted>
Date:   Fri Sep 17 06:04:27 2021 +0000

    Merge branch 'renovate/aws-ebs-csi-driver-2.x' into 'main'

    Update Helm release aws-ebs-csi-driver to v2.2.0

    See merge request k8s/quickstart-eks!206

commit a59564677dbb25fdd29fa86354c310989b4b44c6
Author: <redacted>
Date:   Fri Sep 17 03:15:04 2021 +0000

    Update Helm release aws-ebs-csi-driver to v2.2.0
...

Our config.yml

style: gitlab
template: CHANGELOG.tpl.md
info:
  title: CHANGELOG
  repository_url: https://<private-gitlab-domain>/k8s/quickstart-eks
options:
  commits:
    filters:
      Type:
        - build
        - ci
        - docs
        - feat
        - fix
        - perf
        - refactor
        - style
        - test
  commit_groups:
    title_maps:
      build: Build System
      ci: CI/CD Pipeline
      docs: Documentation
      feat: Features
      fix: Bug Fixes
      perf: Performance Improvements
      refactor: Code Refactoring
      style: Style Improvements
      test: Test Improvements
  header:
    pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
    pattern_maps:
      - Type
      - Scope
      - Subject
  notes:
    keywords:
      - BREAKING CHANGE

Our CHANGELOG.tpl.md:

{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .MergeCommits -}}
### Merge Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/-/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...main
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}

Your Environment

  • OS: macOS 11.6.1
  • git-chglog version: 0.15.0

Related to: #160

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

No branches or pull requests

1 participant