@auto-canary/core
Advanced tools
Comparing version 8.1.2-canary.797.10492.0 to 8.1.3-canary.796.10511.0
@@ -16,3 +16,4 @@ "use strict"; | ||
labels: release_1.defaultLabels, | ||
baseBranch: 'master' | ||
baseBranch: 'master', | ||
prereleaseBranches: ['next'] | ||
}); | ||
@@ -27,3 +28,4 @@ const logParse = new log_parse_1.default(); | ||
labels: release_1.defaultLabels, | ||
baseBranch: 'master' | ||
baseBranch: 'master', | ||
prereleaseBranches: ['next'] | ||
}); | ||
@@ -59,3 +61,4 @@ changelog.loadDefaultHooks(); | ||
labels: release_1.defaultLabels, | ||
baseBranch: 'master' | ||
baseBranch: 'master', | ||
prereleaseBranches: ['next'] | ||
}); | ||
@@ -361,2 +364,25 @@ changelog.loadDefaultHooks(); | ||
}); | ||
test('should omit changelog item for next branches', async () => { | ||
const options = testOptions(); | ||
const changelog = new changelog_1.default(logger_1.dummyLog(), options); | ||
changelog.loadDefaultHooks(); | ||
const commits = await logParse.normalizeCommits([ | ||
{ | ||
hash: '2', | ||
files: [], | ||
authorName: 'Adam Dierkens', | ||
authorEmail: 'adam@dierkens.com', | ||
subject: 'First Feature (#1235)', | ||
labels: ['minor'] | ||
} | ||
]); | ||
expect(await changelog.generateReleaseNotes([ | ||
Object.assign(Object.assign({}, commits[0]), { hash: '1', files: [], authorName: 'Adam Dierkens', authorEmail: 'adam@dierkens.com', subject: 'V8\n\n', labels: [''], pullRequest: { | ||
base: 'intuit/next', | ||
number: 123, | ||
body: '# Release Notes\n\nfoobar' | ||
} }), | ||
...commits | ||
])).toMatchSnapshot(); | ||
}); | ||
test('should be able to customize titles', async () => { | ||
@@ -363,0 +389,0 @@ const options = testOptions(); |
@@ -253,3 +253,3 @@ "use strict"; | ||
])); | ||
getUserByUsername.mockImplementationOnce(username => { | ||
getUserByUsername.mockImplementationOnce(() => { | ||
return { | ||
@@ -256,0 +256,0 @@ login: 'adam', |
@@ -25,3 +25,2 @@ "use strict"; | ||
expect(semver_1.calculateSemVerBump([['none', 'major']], semverMap)).toBe(semver_1.default.major); | ||
expect(semver_1.calculateSemVerBump([['none'], ['unknown'], ['documentation']], semverMap)).toBe(semver_1.default.noVersion); | ||
}); | ||
@@ -28,0 +27,0 @@ test('should not skip things before none', () => { |
@@ -107,3 +107,3 @@ "use strict"; | ||
const configLoader = new config_1.default(this.logger); | ||
const config = Object.assign(Object.assign({}, (await configLoader.loadConfig(this.options))), { baseBranch: this.baseBranch }); | ||
const config = this.hooks.modifyConfig.call(Object.assign(Object.assign({}, (await configLoader.loadConfig(this.options))), { baseBranch: this.baseBranch })); | ||
this.logger.verbose.success('Loaded `auto` with config:', config); | ||
@@ -114,3 +114,2 @@ this.config = config; | ||
this.loadPlugins(config); | ||
this.config = this.hooks.modifyConfig.call(config); | ||
this.hooks.beforeRun.call(config); | ||
@@ -117,0 +116,0 @@ const repository = await this.getRepo(config); |
@@ -16,2 +16,4 @@ import { AsyncSeriesBailHook, AsyncSeriesWaterfallHook } from 'tapable'; | ||
baseBranch: string; | ||
/** The branches that is used as prerelease branches. defaults to next */ | ||
prereleaseBranches: string[]; | ||
} | ||
@@ -18,0 +20,0 @@ export interface IChangelogHooks { |
@@ -191,2 +191,10 @@ "use strict"; | ||
await Promise.all(labelCommits.map(async (commit) => { | ||
var _a; | ||
const base = ((_a = commit.pullRequest) === null || _a === void 0 ? void 0 : _a.base) || ''; | ||
const branch = base.includes('/') ? base.split('/')[1] : base; | ||
// We want to keep the release notes for a prerelease branch but | ||
// omit the changelog item | ||
if (branch && this.options.prereleaseBranches.includes(branch)) { | ||
return true; | ||
} | ||
const [, line] = await this.hooks.renderChangelogLine.promise([ | ||
@@ -193,0 +201,0 @@ commit, |
@@ -174,3 +174,4 @@ "use strict"; | ||
labels: this.config.labels, | ||
baseBranch: this.config.baseBranch | ||
baseBranch: this.config.baseBranch, | ||
prereleaseBranches: this.config.prereleaseBranches | ||
}); | ||
@@ -177,0 +178,0 @@ this.hooks.onCreateChangelog.call(changelog, version); |
@@ -33,8 +33,7 @@ "use strict"; | ||
const skipReleaseLabels = labelMap.get('skip') || []; | ||
const noReleaseLabels = labelMap.get('none') || []; | ||
labels.forEach(pr => { | ||
pr.forEach(label => { | ||
const userLabel = [...labelMap.entries()].find(pair => pair[1].includes(label)); | ||
if (userLabel) { | ||
labelSet.add(userLabel[0]); | ||
} | ||
labelSet.add(userLabel ? userLabel[0] : label); | ||
}); | ||
@@ -50,3 +49,4 @@ }); | ||
// If PRs only have none or skip labels, skip the release | ||
const onlyNoReleaseLabels = [...labelSet].reduce((condition, releaseType) => condition && (releaseType === 'none' || releaseType === 'skip'), true); | ||
const onlyNoReleaseLabels = [...labelSet].reduce((condition, label) => condition && | ||
(noReleaseLabels.includes(label) || skipReleaseLabels.includes(label)), true); | ||
if (labelSet.size > 0 && onlyNoReleaseLabels) { | ||
@@ -53,0 +53,0 @@ return SEMVER.noVersion; |
{ | ||
"name": "@auto-canary/core", | ||
"version": "8.1.2-canary.797.10492.0", | ||
"version": "8.1.3-canary.796.10511.0", | ||
"description": "Node API for using auto.", | ||
@@ -78,3 +78,3 @@ "main": "dist/auto.js", | ||
}, | ||
"gitHead": "73a38151753ae8c4c8fbcd0490099d1aac18f826" | ||
"gitHead": "5971c8ae2e8295f14bf075b293aba695847320ee" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
586716
7342
14