semantic-release / release-notes-generator

:clipboard: semantic-release plugin to generate changelog content with conventional-changelog
MIT License
310 stars 47 forks source link

Wrong commit link for Bitbucket #491

Open Gabson1 opened 1 year ago

Gabson1 commented 1 year ago

Hello everyone.

I would like to raise a possible issue with the generated links for the diff and commits when using bitbucket. What is generated by default looks like this https://<BASE>/scm/<PROJ_NAME>/<REPO_NAME>/commit/<HASH>. Bitbucket commit links look like this though: https://<BASE>/projects/<PROJ_NAME>/repos/<REPO_NAME>/commits/<HASH>. I have tried setting the host to the correct path, but /scm/<PROJ_NAME>/ is still appended after my override.

My question is, am I supposed to define the repo URL somewhere else or is this an issue with this plugin?

Version Information:

Thank you in advance. Please reach out if you require further information.

hpe-ykoehler commented 1 year ago

Would be interested in a fix to that as well, instead of "issue" and "commit" being configuration, I would recommend a config settings such as "scm-server" where one could set "github, gitlab, bitbucket cloud, bitucket server" and get proper URL for each of those.

travi commented 1 year ago

this sounds very related to https://github.com/semantic-release/release-notes-generator/issues/449, so the conversation there likely applies here as well. i think this example highlights my hesitation with the previously suggested solution for the specific situation in that other thread.

to find a path forward, i think we need to define a way to make configuration of this area flexible enough to handle various reasons that this needs to be adjusted. this example feels close to me and is an example of what has been enabled by the underlying conventional-changelog project. i have not investigated far enough to know if that can easily be surfaced to make similar possible directly in our config, but understanding options like that is probably the shortest path to enabling a solution here.

szegheo commented 9 months ago

We use Bitbucket Enterprise in our own cloud, and I'm here because I wanted to quickly configure the plugin for: https://bitbucket.DOMAIN.TLD/projects/<PROJ_NAME>/repos/<REPO_NAME>/commits/<HASH> Am I miss something or is it impossible (as of now)? 😞

pnpm add -D conventional-changelog-conventionalcommits

  [
    "@semantic-release/release-notes-generator",
    {
      "preset": "conventionalcommits",
      "host": "https://bitbucket.company.tld",
      "presetConfig": {
        "commitUrlFormat": "{{host}}/projects/PROJECT-NAME/repos/{{repository}}/commits/{{hash}}"
      }
    }
  ]