Skip to content

Commit

Permalink
fix: add changelog-path to valid config schema (#1612)
Browse files Browse the repository at this point in the history
* test: add test for changelog-path config parsing

* fix: add changelog-path to valid config schema
  • Loading branch information
chingor13 committed Aug 31, 2022
1 parent 414eb5f commit c2937ba
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"description": "Generate changelog links to this GitHub host. Useful for running against GitHub Enterprise.",
"type": "string"
},
"changelog-path": {
"description": "Path to the file that tracks release note changes. Defaults to `CHANGELOG.md`.",
"type": "string"
},
"pull-request-title-pattern": {
"description": "Customize the release pull request title.",
"type": "string"
Expand Down Expand Up @@ -339,6 +343,7 @@
"include-v-in-tag": true,
"changelog-type": true,
"changelog-host": true,
"changelog-path": true,
"pull-request-title-pattern": true,
"pull-request-header": true,
"separate-pull-requests": true,
Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/manifest/config/changelog-path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"release-type": "simple",
"changelog-path": "docs/foo.md",
"packages": {
".": {
"component": "root"
},
"packages/bot-config-utils": {
"component": "bot-config-utils",
"changelog-path": "docs/bar.md"
}
}
}
32 changes: 32 additions & 0 deletions test/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,38 @@ describe('Manifest', () => {
).to.eql('default');
});

it('should read changelog path from manifest', async () => {
const getFileContentsStub = sandbox.stub(
github,
'getFileContentsOnBranch'
);
getFileContentsStub
.withArgs('release-please-config.json', 'main')
.resolves(
buildGitHubFileContent(
fixturesPath,
'manifest/config/changelog-path.json'
)
)
.withArgs('.release-please-manifest.json', 'main')
.resolves(
buildGitHubFileContent(
fixturesPath,
'manifest/versions/versions.json'
)
);
const manifest = await Manifest.fromManifest(
github,
github.repository.defaultBranch
);
expect(manifest.repositoryConfig['.'].changelogPath).to.eql(
'docs/foo.md'
);
expect(
manifest.repositoryConfig['packages/bot-config-utils'].changelogPath
).to.eql('docs/bar.md');
});

it('should read versioning type from manifest', async () => {
const getFileContentsStub = sandbox.stub(
github,
Expand Down

0 comments on commit c2937ba

Please sign in to comment.