conventional-changelog / conventional-changelog-config-spec

a spec describing the config options supported by conventional-config for upstream tooling
110 stars 31 forks source link

cannot override issue URL when `issueUrlFormat` has been set, because of `repository.url` value #34

Open achmadk opened 4 years ago

achmadk commented 4 years ago

My office use bitbucket and JIRA to organize SCM and issue management. I have set repository.url inside package.json file from bitbucket. For issue link, we use URL from JIRA instead. Here is our configuration inside package.json file.

{
  "repository": {
    "url": "git+https://${my-name}@bitbucket.org/${my-office}/${office-app}.git"
  },
  "standard-version": {
    "issueUrlFormat": "https://${my-office}.atlassian.net/browse"
  }
}

I have set issueUrlFormat to JIRA issue URL. I think that when we have set issueUrlFormat value, issue URL inside changelog.md file should be changed. Unfortunately, when running standard-changelog -f, generated CHANGELOG.md file still use URL from repository.url.

Here is CHANGELOG.md file content after running standard-changelog -f

### Bug Fixes

* **utilities:** unable to run `npm run pre-start` in demo ([${generated-commit-hash}](https://bitbucket.org/${my-office}/${office-app}/commits/${generated-commit-hash})), closes [${issue-ticket-id}](https://bitbucket.org/${my-office}/${office-app}/issue/${issue-ticket-id})
jbottigliero commented 4 years ago

Hi @achmadk – I've added a test case to standard-version (conventional-changelog/standard-version#486) in an attempt to reproduce this, but haven't had luck.

Would you be able to provide the version of standard-version you are using? (standard-version ---version)


This is the raw CHANGELOG.md content I'm seeing from that test, which looks like expected behavior to me – let me know if I'm missing something!

# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## 1.1.0 (2019-11-17)

### Features

* another commit addresses issue [#1](https://standard-version.company.net/browse/1) ([ed35416](http://scm.org/office/app/commit/ed35416e7ee6ff6675014a79aba0b4960fabbede))
achmadk commented 4 years ago

Previously, I am using standard-changelog to generate a changelog from the beginning of the created repository. And then I try the latest version standard-version (7.0.0) mentioned by @jbottigliero, but still not working as expected.

Although the test case has succeeded, is it working too in OS windows?

jbottigliero commented 4 years ago

@achmadk, standard-version runs tests in Windows against Node 8, 10 and latest so I expect us to be ok as far as OS compatibility (detailed Travis results).

Could you try updating to standard-version@7.0.1 (latest release) and let me know if you are still encountering the issue?

gh0st commented 4 years ago

I'm having a similar issue.

  "repository": {
    "url": "http://my.tfs.server:8080/tfs/MyTfsCollection/MyTfsProject/_git/MyGitRepository",
    "type": "git"
  },
  "standard-version": {
    "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}"
  }

yeilds: http://my.tfs.server:8080///commit/7e7470ceda222a0bbca58e699e740a486449b930

$ npm run standard-version -- --version

> myproject@0.0.0 standard-version C:\Users\username\source\Workspaces\my-project
> standard-version "--version"

7.1.0
anguspiv commented 4 years ago

I seem to be having the same issue, that I can't override the issueUrlFormat: I stand corrected, I had tried once and was seeing the issue, but then I added the bugs field to my package.json and suddenly it's generating the dry-run correctly.

macOS 10.15.3 (Catalina)
fish shell: 3.1.0
node v12.14.1
standard version: ^7.1.0

package.json

  "repository": {
    "type": "git",
    "url": "git+ssh://git@bitbucket.org/angusp-rex/javascript-project-template.git"
  }, 
"bugs": {
    "url": "https://rexproduct.atlassian.net/projects/WEB/issues"
  },

.versionrc

{
  "issueUrlFormat": "https://rexproduct.atlassian.net/browse/{{id}}",
  "userUrlFormat": "https://bitbucket.org/{{user}}",
  "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}"
}

npm run release -- --dry-run --first-release without bugs field


---
<a name="1.0.0"></a>
# 1.0.0 (2020-04-01)

### Bug Fixes

* **readme:** updates repository url in instructions ([b1178c6](https://bitbucket.org/angusp-rex/javascript-project-template/commits/b1178c6)), closes [#WEB-1015](https://bitbucket.org/angusp-rex/javascript-project-template/issue/WEB-1015)

### Features

* adds .editorconfig file ([894f5a9](https://bitbucket.org/angusp-rex/javascript-project-template/commits/894f5a9))
---

with bugs in package.json

## 1.0.0 (2020-04-01)

### Features

* adds .editorconfig file ([894f5a9](https://bitbucket.org/rexdev/javascript-project-template/commits/894f5a9fa1cff6e7f59bc0e618780c59f670af3b))

### Bug Fixes

* **readme:** updates repository url in instructions ([b1178c6](https://bitbucket.org/rexdev/javascript-project-template/commits/b1178c642c606c93506c2932bb3b616a4c7ba28f)), closes [#WEB-1015](https://rexproduct.atlassian.net/browse/WEB-1015)