Comments (8)
@pvdlg Is there any plan to add support to azure DevOps?
Currently, I'm unable to link issues correctly as <repository> isn't part of the url.
Azure formats are:
commit: <host>/<owner>/_git/<repository>/commit/<commit-sha>
issue: <host>/<owner>/_workitems/edit/<issue-number>
the <host> will usually be <organization>.visualstudio.com.
also ssh format is a bit different:
<organization>@vs-ssh.visualstudio.com:v3/<organization>/<owner>/<repository>
edit:
just sharing the solution if anyone else also has this issue
module.export = {
...,
plugins: [
...,
['@semantic-release/release-notes-generator', {
preset: 'angular',
writerOpts: {
finalizeContext: function(context) {
return {
...context,
repository: null,
repoUrl: '<host>/<owner>',
commit: '_git/<repository>/commit',
issue: '_workitems/edit'
};
}
}
}]
]
}
from release-notes-generator.
For me solution from @nausaf didn't work either. The one I came up with:
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
presetConfig: {
...,
issueUrlFormat: `${process.env.SYSTEM_COLLECTIONURI}${process.env.SYSTEM_TEAMPROJECT}/_workitems/edit/{{id}}`,
commitUrlFormat: `${process.env.SYSTEM_COLLECTIONURI}${process.env.SYSTEM_TEAMPROJECT}/_git/{{repository}}/commit/{{hash}}`
},
writerOpts: {
finalizeContext: function (context) {
return {
...context,
repository: process.env.BUILD_REPOSITORY_NAME,
repoUrl: process.env.BUILD_REPOSITORY_URI,
commit: `_git/<repository>/commit`,
issue: '_workitems/edit',
};
},
},
parserOpts: {
mergePattern:
'^Merged PR (\\d+): (\\w*)(?:\\(([\\w\\$\\.\\-\\* ]*)\\))?\\: (.*)$',
mergeCorrespondence: ['id', 'type', 'scope', 'subject'],
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
},
},
],
from release-notes-generator.
I would prefer to not add a new option and instead improve the algorithm to detect Azure URLs and generate changelogContext
properly.
from release-notes-generator.
That's fair. The only reason I suggested to do it through changelogContext, was because simply detecting and extending hosts-config.js
will not make it work correctly. It's still necessary to provide custom partials to conventional-commits-writer
in order to handle the non-standard URL format Azure DevOps is using. I believe this situation is an edge-case and changelogContext provides a needed "escape hatch".
from release-notes-generator.
Can you provide an example of the edge case you are talking about? Like in which case we won't be able to determine all the values for changelogContext
based on the repository URL?
from release-notes-generator.
Closing as no answer was provided
from release-notes-generator.
@pvdlg default issue link format isn't suitable for Azure DevOps, because issues there don't belong to repositories.
Here is the actual pattern: https://dev.azure.com/<owner>/<project>/_workitems/edit/<issue_number>/
I think it can be useful to add a property that can accept full issues path.
So could you please reopen this issue?
from release-notes-generator.
ronnetzer's solution didn't work for me. I also tried setting repository
and repoUrl
to different values which didn't work either:
writerOpts: {
finalizeContext: function (context) {
return {
...context,
repository: process.env.SYSTEM_TEAMPROJECT,
repoUrl: process.env.SYSTEM_COLLECTIONURI,
commit: '_git/<repository>/commit',
issue: '_workitems/edit',
};
},
},
This could be because I am using preset: 'conventionalcommits'
instead of preset: 'angular'
.
What did work was adding issueUrlFormat
and commitUrlFormat
to presetConfig
in configuration of @semantic-release/release-notes-generator
, as follows:
...,
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
presetConfig: {
...,
issueUrlFormat: `${process.env.SYSTEM_COLLECTIONURI}{{repository}}/_workitems/edit/{{id}}/`,
commitUrlFormat: `${process.env.SYSTEM_COLLECTIONURI}{{repository}}/_git/{{repository}}/commit/{{hash}}`,
},
writerOpts: {
finalizeContext: function (context) {
return {
...context,
repository: process.env.SYSTEM_TEAMPROJECT,
repoUrl: process.env.SYSTEM_COLLECTIONURI,
commit: '_git/<repository>/commit',
issue: '_workitems/edit',
};
},
},
//parserOpts really does need to be duplicated here
//(declaring it in the commitAnalyzer plugin once is not enough)
//probabaly because release-notes-generator too has to parse
//the commits
parserOpts: {
mergePattern:
'^Merged PR (\\d+): (\\w*)(?:\\(([\\w\\$\\.\\-\\*]*)\\))?\\: (.*)$',
mergeCorrespondence: ['id', 'type', 'scope', 'subject'],
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
},
},
],
Note that I still need that writerOpts
even if it doesn't work as if I take it out the generated release notes do not have commit link nor the issue link. This would happen even if I replace all references to {{repository}}
in issueUrlFormat
and commitUrlFormat
with actual value of repository (${process.env.SYSTEM_TEAMPROJECT}
).
By the way, expressions like process.env.SYSTEM_TEAMPROJECT
evaluate to Azure Pipelines predefined variables like System.TeamProject
. As the predefined variables page states:
In YAML pipelines, you can reference predefined variables as environment variables. For example, the variable
Build.ArtifactStagingDirectory
becomes the variableBUILD_ARTIFACTSTAGINGDIRECTORY
.
from release-notes-generator.
Related Issues (20)
- Looking for a way to print the generated snippet to a file other than changelog HOT 1
- Upgrade peer dependency semantic-release to version 19.0.3 or later to fix known vulnerability HOT 1
- Refactor & chore commits not getting includes in changelog HOT 3
- Release notes generation with Bitbucket
- question: link to both GH PR numbers and external issues
- Question: conventionalcommits preset with PR owner
- Defining the commitPartial voids other wirter and presetConfig options
- I need to include other commits than `feat` and `fix`. HOT 3
- Sort commit sections HOT 11
- An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM] HOT 5
- wrong Gitlab issue link in release notes HOT 20
- Plugin ends up abruptly without completition or error, making other plugins not to start HOT 12
- Wrong commit link for Bitbucket HOT 3
- `release skip`-ed commits still get into release notes
- Links to PRs and Contributors list HOT 2
- `MODULE_NOT_FOUND` when running with `npx` HOT 4
- Unexpected behavior for major updates with conventionalcommits preset HOT 2
- self-hosted GitLab - no issue links in release notes
- Question: Merging pre-release branches & generated changelog
- Question: Mirror release rules to release notes generator? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from release-notes-generator.