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

Wrong commit link bitbucket [help] #90

Open
arkadioz opened this issue Jan 5, 2024 · 2 comments
Open

Wrong commit link bitbucket [help] #90

arkadioz opened this issue Jan 5, 2024 · 2 comments

Comments

@arkadioz
Copy link

arkadioz commented Jan 5, 2024

I have an issue were my bitbucket commit links at the changelog are looking like:

https://bitbucket.org/my-workspace/my-repo/commit/commitnumber

but it should be:

https://bitbucket.org/my-workspace/my-repo/commits/commitnumber

notice it should have s in commits, I notice here it is well configured https://github.com/semantic-release/release-notes-generator/blob/c4963f573930df1b5352ef38d3bc2c58286a9fb3/lib/hosts-config.js#L12

but it is not being applyed maybe I am missing something on my releaserc.json config? Also I noticed that when using the conventional commits preset which is my case, it does this by default: https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#commiturlformat-string

maybe that is the problem? But I do not know how to change it or configure, tried with the commit property at the plugins config based on this https://github.com/semantic-release/release-notes-generator?tab=readme-ov-file#configuration but it did not work, here is my current releaserc.json file:

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "conventionalcommits",
        "releaseRules": [
          {
            "breaking": true,
            "release": "major"
          },
          {
            "type": "refactoring",
            "release": "patch"
          },
          {
            "type": "refactor",
            "release": "patch"
          }
        ]
      }
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        "preset": "conventionalcommits",
        "commit": "commits",
        "presetConfig": {
          "types": [
            {
              "type": "feat",
              "section": "New Feature(s) 🚀"
            },
            {
              "type": "fix",
              "section": "Bug Fix(es) 🐛️"
            },
            {
              "type": "docs",
              "section": "Documentation Changes 📝"
            },
            {
              "type": "refactor",
              "section": "Code Refactor 💅"
            },
            {
              "type": "test",
              "section": "Tests 📡️"
            },
            {
              "type": "perf",
              "section": "Performance Improvement(s) 🚄️"
            },
            {
              "type": "build",
              "section": "Build system 🛠️"
            },
            {
              "type": "refactoring",
              "section": "Refactoring \uD83D\uDEE0"
            }
          ]
        }
      }
    ],
    [
      "@semantic-release/exec",
      {
        "prepareCmd": "mvn versions:set -DnewVersion=\"${nextRelease.version}\" && mvn clean install && echo \"NEXT_VERSION=${nextRelease.version}\""
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "docs/CHANGELOG.md",
        "changelogTitle": "# Semantic Versioning Changelog"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": [
          "**/pom.xml",
          "docs/CHANGELOG.md"
        ],
        "message": "chore(release): ${nextRelease.version}"
      }
    ]
  ],
  "branches": [
    "main",
    "hotfix/*"
  ]
}

@arkadioz
Copy link
Author

arkadioz commented Jan 5, 2024

Okay fixed it, needed to set the commitUrlFormat parameter like so: "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}" at the presetConfig of the "@semantic-release/release-notes-generator".

like so:

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "conventionalcommits",
        "releaseRules": [
          {
            "breaking": true,
            "release": "major"
          },
          {
            "type": "refactoring",
            "release": "patch"
          },
          {
            "type": "refactor",
            "release": "patch"
          }
        ]
      }
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        "preset": "conventionalcommits",
        "presetConfig": {
          "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}",
          "types": [
            {
              "type": "feat",
              "section": "New Feature(s) 🚀"
            },
            {
              "type": "fix",
              "section": "Bug Fix(es) 🐛️"
            },
            {
              "type": "docs",
              "section": "Documentation Changes 📝"
            },
            {
              "type": "refactor",
              "section": "Code Refactor 💅"
            },
            {
              "type": "test",
              "section": "Tests 📡️"
            },
            {
              "type": "perf",
              "section": "Performance Improvement(s) 🚄️"
            },
            {
              "type": "build",
              "section": "Build system 🛠️"
            },
            {
              "type": "refactoring",
              "section": "Refactoring \uD83D\uDEE0"
            }
          ]
        }
      }
    ],
    [
      "@semantic-release/exec",
      {
        "prepareCmd": "mvn versions:set -DnewVersion=\"${nextRelease.version}\" && mvn clean install && echo \"NEXT_VERSION=${nextRelease.version}\""
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "docs/CHANGELOG.md",
        "changelogTitle": "# Semantic Versioning Changelog"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": [
          "**/pom.xml",
          "docs/CHANGELOG.md"
        ],
        "message": "chore(release): ${nextRelease.version}"
      }
    ]
  ],
  "branches": [
    "main",
    "hotfix/*"
  ]
}

@arkadioz
Copy link
Author

arkadioz commented Jan 5, 2024

But also I wonder how could I also apply the config that is already defined for bitbucket in here: https://github.com/semantic-release/release-notes-generator/blob/c4963f573930df1b5352ef38d3bc2c58286a9fb3/lib/hosts-config.js#L12

So I dont have to configure all of that again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant