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

Where does <owner> and <repository> come from? (non-JS, non-Github) #656

Open
howardjones opened this issue Aug 25, 2020 · 3 comments
Open
Labels

Comments

@howardjones
Copy link

howardjones commented Aug 25, 2020

I use Azure Devops for a python project. I've been using conventional commits for the lifetime of the project, so I liked the idea of standard-version.

When I run it, I get a CHANGELOG.md with incorrect links to the changes - https://dev.azure.com//commit/598788656ef276375f34da9b42837cf15f86f89d

It seems to be missing the <owner> and <repository> fields in the URL. Where does standard-version get those from? Do I need some kind of dummy package.json?

@SohamJ
Copy link

SohamJ commented Dec 1, 2020

Trying to figure out missing owner and repository fields, I found that both are set in the core's mergeConfig.js.

Owner and repo seems to be coming from either the context or the package file (package.json for example). I may be wrong, but in the case of non-node project, it seems this has to come from context.

The context is referred in the conventionalcommit writeopts.

One interesting observation is that setting { "preset": "angular" } in the .versionrc.json populates the fields. So it seems that the issue is with conventionalcommit preset, although I'm not yet sure where that difference is.

You can also refer to this reply in standard-version #384
Any pointers to figure that out would be super helpful!

@kiiiiwiiii
Copy link

As i found in this article: https://medium.com/@jazz.twk/automate-versioning-in-cicd-with-azure-devops-a65a9a6f4e69 you should configure your .versionrc like so:

{
  "compareUrlFormat":"{{host}}/your_azure_repo_link/branchCompare?baseVersion=GT{{previousTag}}&targetVersion=GT{{currentTag}}",
  "commitUrlFormat": "{{host}}/your_azure_repo_link/commit/{{hash}}"
}

Replace your_azure_repo_link with OrganizationName/ProjectName/_git/RepositoryName

@SohamJ
Copy link

SohamJ commented Dec 4, 2020

As i found in this article: https://medium.com/@jazz.twk/automate-versioning-in-cicd-with-azure-devops-a65a9a6f4e69 you should configure your .versionrc like so:

{
  "compareUrlFormat":"{{host}}/your_azure_repo_link/branchCompare?baseVersion=GT{{previousTag}}&targetVersion=GT{{currentTag}}",
  "commitUrlFormat": "{{host}}/your_azure_repo_link/commit/{{hash}}"
}

Replace your_azure_repo_link with OrganizationName/ProjectName/_git/RepositoryName

Thanks for the reply, this is what I did for Bitbucket for now -

{
  "commitUrlFormat": "https://<host>/projects/<project>/repos/<repo>/commits/{{hash}}",
  "compareUrlFormat": "https://<host>/projects/<project>/repos/<repo>/compare/diff?targetBranch=refs%2Ftags%2F{{previousTag}}&sourceBranch=refs%2Ftags%2F{{currentTag}}",
  "userUrlFormat": "https://<host>/users/{{user}}",
}

The compareUrl follows the new compare URL format that Bitbucket added post v6.3.

I still am not sure why angular preset works but not conventionalcommits. Was hoping to figure that out to see if there can be any enhancement to conventionalcommits preset or perhaps update to the angular-bitbucket project.

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

No branches or pull requests

3 participants