tomasbjerre / git-changelog-maven-plugin

Maven plugin that can generate a changelog, or releasenotes, from git repository
Other
78 stars 35 forks source link

Problem with GitLab CI/CD #47

Closed arboeh closed 1 year ago

arboeh commented 1 year ago

I have problems using the plugin with GitLab CI/CD. Problem is, that the generated changelog ("changelog.html" with custom html template) is cut off after about 30 entries. Everything works fine generating the changelog from local machine. I got all commits there correctly - about 5000. Maven-Version on the server is 3.6.3. Plugin-Version is 1.95.2. I tried a lot, set "fromRef" / "toRef", "ignoreCommitsOlderThan" and changed execution phase and so on. I got no errors from plugin execution log. I have no idea what else to try. Any help would be appriciated.

Configuration of the plugin:

<plugin>
    <groupId>se.bjurr.gitchangelog</groupId>
    <artifactId>git-changelog-maven-plugin</artifactId>
    <version>${git-changelog-maven-plugin.version}</version>
    <executions>
        <execution>
            <phase>prepare-package</phase>
            <goals>
                <goal>git-changelog</goal>
            </goals>
            <configuration>
                <gitLabEnabled>true</gitLabEnabled>
                <gitLabServer>${gitlab-host}</gitLabServer>
                <ignoreCommitsOlderThan>${gitlab-ignore-commits-older-than}</ignoreCommitsOlderThan>
                <fromRef>${gitlab-changelog-fromRef}</fromRef>
                <toRef>${gitlab-changelog-toRef}</toRef>
                <extendedVariables>
                    <projectVersion>${project.version}</projectVersion>
                    <gitLabHost>${gitlab-host}</gitLabHost>
                    <jiraHost>${jira-host}</jiraHost>
                </extendedVariables>
                <templateFile>${changelog-template-file}</templateFile>
                <file>${changelog-generated-file}</file>
            </configuration>
        </execution>
    </executions>
</plugin>

Template file:

<!DOCTYPE html>
<html lang="de" style="font-family: Consolas, monaco, monospace;">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Changelog</title>
  </head>
  <body>

      <style>
         h3, h4, div {
            margin: 0.5em;
         }
         h2 {
            margin-top: 1.25em;
         }
         h3 {
            margin-top: 1.75em;
         }
         h4 {
            margin-top: 1em;
         }
         span {
            font-weight: normal;
         }
         li {
            padding-left: 2.5%;
         }
         a {
            color: #007bff;
            text-decoration: none;
         }
         a:hover {
            color: #0056b3;
            text-decoration: underline;
         }
      </style>

         <h1>CHANGELOG</h1>

         <p>Branch: {{projectVersion}}</p>

         {{#tags}}

            <h2>{{name}}</h2> 

            {{#issues}}

               {{#commits}}

                  {{#ifMatches messageTitle "^(?!Merge).*"}} <!-- Ignore Merges -->

                     {{#messageBodyItems}}
                        <li>{{.}}</li>
                     {{/messageBodyItems}}

                  {{/ifMatches}}

               {{/commits}}

            {{/issues}}

         {{/tags}}

  </body>
</html>
tomasbjerre commented 1 year ago

Perhaps the repository is shallow cloned by Gitlab? It might be using Git clone depth.