question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version Comparison Links in CHANGELOG Don't Work on Bitbucket

See original GitHub issue

I’m using lerna publish --conventional-commits, which works amazingly well for our organization. So thanks! The CHANGELOG updates provide links to differences between tagged versions. In bitbucket it seems that the URLs aren’t correct. They point to a 404 in Bitbucket.

Expected Behavior

Clicking Version link in the changelog should take me to a page in Bitbucket that compares the version against the previous one.

Current Behavior

The link takes me to a 404

Possible Solution

It seems like there’s a few things wrong with the URL. When I compare two versions manually, the portion of the URL after: .../compare/ is URL Encoded. Also the separator between the two versions seems to be %0D not ... which is in the URL in the CHANGELOG.

Steps to Reproduce (for bugs)

  1. Run git commit -m "feature: My new awesome feature" so that step 2 produces an entry in the CHANGELOG
  2. Run lerna publish --conventional-commits
  3. View the generated/updated CHANGELOG.md file to see the erroneous URL.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14

github_iconTop GitHub Comments

3reactions
davidsierradzcommented, Mar 13, 2020

Modify your changelog generation settings:

lerna.json:

{
  "command": {
    "version": {
      "changelogPreset": "./changelog-preset.config.js"
    }
  }
}

changelog-preset.config.js

module.exports = Promise.resolve()
  .then(() => require('conventional-changelog-conventionalcommits'))
  .then(presetPromise => presetPromise())
  .then(preset => {
    preset.writerOpts.commitUrlFormat =
      '{{host}}/{{owner}}/{{repository}}/commits/{{hash}}'
    preset.writerOpts.compareUrlFormat =
      '{{host}}/{{owner}}/{{repository}}/compare/{{currentTag}}%0D{{previousTag}}'
    return preset
  })

See:

2reactions
bertho-zerocommented, Jul 21, 2020

It is now possible with the lerna.json:

{
  // ...
  "command": {
    "version": {
      "conventionalCommits": true,
      "changelogPreset": {
        "name": "conventionalcommits",
        "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}",
        "compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/branches/compare/{{currentTag}}..{{previousTag}}"
      }
    }
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Compare branches, tags, and commits | Bitbucket Data ...
You can quickly find revision changes using the Compare page. ... synched with the destination branch and the most recent version of the...
Read more >
How to compare two revisions in Bitbucket?
Does not work in version 4.14. Gives a Dead Link error when you add anything after compare/ including the above. – Juha Untinen....
Read more >
Version Control Software: An Overview
Learn about version control systems like Git, SVN, and Mercurial. Understand the differences so you can decide which version control software is right....
Read more >
Doing Code Reviews Using BitBucket and Pull Requests
Building better pull requests · Create a pull request · Add reviewers to your pull request · Compare before issuing a request ·...
Read more >
Using GitLab CI/CD with a Bitbucket Cloud repository
GitLab is now configured to mirror changes from Bitbucket, run CI/CD pipelines ... Create an issue if there's something you don't like about...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found