Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,7 @@ function extractReleaserConfig(
labels: config['label']?.split(','),
releaseLabels: config['release-label']?.split(','),
extraLabels: config['extra-label']?.split(','),
snapshotLabels: config['snapshot-label']?.split(','),
skipSnapshot: config['skip-snapshot'],
initialVersion: config['initial-version'],
excludePaths: config['exclude-paths'],
Expand Down Expand Up @@ -1790,6 +1791,7 @@ function mergeReleaserConfig(
skipSnapshot: pathConfig.skipSnapshot ?? defaultConfig.skipSnapshot,
initialVersion: pathConfig.initialVersion ?? defaultConfig.initialVersion,
extraLabels: pathConfig.extraLabels ?? defaultConfig.extraLabels,
snapshotLabels: pathConfig.snapshotLabels ?? defaultConfig.snapshotLabels,
excludePaths: pathConfig.excludePaths ?? defaultConfig.excludePaths,
dateFormat: pathConfig.dateFormat ?? defaultConfig.dateFormat,
};
Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/manifest/config/snapshot-labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"release-type": "java",
"snapshot-label": "global-snapshot",
"packages": {
".": {
"component": "root"
},
"node-lib": {
"component": "node-lib",
"snapshot-label": "per-package-snapshot"
}
}
}
32 changes: 32 additions & 0 deletions test/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,38 @@ describe('Manifest', () => {
'lang: nodejs',
]);
});
it('should read snapshot labels from manifest', async () => {
const getFileContentsStub = sandbox.stub(
github,
'getFileContentsOnBranch'
);
getFileContentsStub
.withArgs('release-please-config.json', 'main')
.resolves(
buildGitHubFileContent(
fixturesPath,
'manifest/config/snapshot-labels.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['snapshotLabels']).to.deep.equal(['global-snapshot']);
expect(manifest.repositoryConfig['.'].snapshotLabels).to.deep.equal([
'global-snapshot',
]);
expect(
manifest.repositoryConfig['node-lib'].snapshotLabels
).to.deep.equal(['per-package-snapshot']);
});
it('should read exclude paths from manifest', async () => {
const getFileContentsStub = sandbox.stub(
github,
Expand Down
Loading