release-please 17.4.1 → 17.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/bin/release-please.js +39 -10
- package/build/src/bootstrapper.d.ts +2 -2
- package/build/src/changelog-notes/default.js +9 -1
- package/build/src/changelog-notes/github.d.ts +2 -2
- package/build/src/changelog-notes.d.ts +1 -0
- package/build/src/commit.d.ts +6 -0
- package/build/src/factories/changelog-notes-factory.d.ts +2 -2
- package/build/src/factories/plugin-factory.d.ts +2 -2
- package/build/src/factories/versioning-strategy-factory.d.ts +2 -2
- package/build/src/factory.d.ts +2 -2
- package/build/src/github-api.d.ts +260 -0
- package/build/src/github-api.js +701 -0
- package/build/src/github.d.ts +21 -171
- package/build/src/github.js +154 -699
- package/build/src/index.d.ts +2 -2
- package/build/src/index.js +1 -1
- package/build/src/local-github.d.ts +271 -0
- package/build/src/local-github.js +778 -0
- package/build/src/manifest.d.ts +7 -5
- package/build/src/manifest.js +28 -26
- package/build/src/plugin.d.ts +3 -3
- package/build/src/plugins/group-priority.d.ts +2 -2
- package/build/src/plugins/linked-versions.d.ts +2 -2
- package/build/src/plugins/maven-workspace.d.ts +2 -2
- package/build/src/plugins/merge.d.ts +2 -2
- package/build/src/plugins/node-workspace.d.ts +2 -2
- package/build/src/plugins/sentence-case.d.ts +2 -2
- package/build/src/plugins/workspace.d.ts +2 -2
- package/build/src/scm.d.ts +80 -0
- package/build/src/scm.js +16 -0
- package/build/src/strategies/base.d.ts +5 -3
- package/build/src/strategies/base.js +2 -0
- package/build/src/util/pull-request-overflow-handler.d.ts +2 -2
- package/package.json +2 -2
package/build/src/manifest.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangelogSection } from './changelog-notes';
|
|
2
|
-
import {
|
|
2
|
+
import { Scm, ScmRelease } from './scm';
|
|
3
3
|
import { Version } from './version';
|
|
4
4
|
import { PullRequest } from './pull-request';
|
|
5
5
|
import { Logger } from './util/logger';
|
|
@@ -78,6 +78,7 @@ export interface ReleaserConfig {
|
|
|
78
78
|
changelogPath?: string;
|
|
79
79
|
changelogType?: ChangelogNotesType;
|
|
80
80
|
changelogHost?: string;
|
|
81
|
+
includeCommitAuthors?: boolean;
|
|
81
82
|
versionFile?: string;
|
|
82
83
|
extraFiles?: ExtraFile[];
|
|
83
84
|
snapshotLabels?: string[];
|
|
@@ -118,6 +119,7 @@ interface ReleaserConfigJson {
|
|
|
118
119
|
'include-v-in-release-name'?: boolean;
|
|
119
120
|
'changelog-type'?: ChangelogNotesType;
|
|
120
121
|
'changelog-host'?: string;
|
|
122
|
+
'include-commit-authors'?: boolean;
|
|
121
123
|
'pull-request-title-pattern'?: string;
|
|
122
124
|
'pull-request-header'?: string;
|
|
123
125
|
'pull-request-footer'?: string;
|
|
@@ -214,7 +216,7 @@ export declare const DEFAULT_RELEASE_LABELS: string[];
|
|
|
214
216
|
export declare const DEFAULT_SNAPSHOT_LABELS: string[];
|
|
215
217
|
export declare const SNOOZE_LABEL = "autorelease: snooze";
|
|
216
218
|
export declare const MANIFEST_PULL_REQUEST_TITLE_PATTERN = "chore: release ${branch}";
|
|
217
|
-
export interface CreatedRelease extends
|
|
219
|
+
export interface CreatedRelease extends ScmRelease {
|
|
218
220
|
id: number;
|
|
219
221
|
path: string;
|
|
220
222
|
version: string;
|
|
@@ -282,7 +284,7 @@ export declare class Manifest {
|
|
|
282
284
|
* @param {string[]} manifestOptions.releaseLabels Labels to apply to a tagged release
|
|
283
285
|
* pull request. Defaults to `[autorelease: tagged]`
|
|
284
286
|
*/
|
|
285
|
-
constructor(github:
|
|
287
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, releasedVersions: ReleasedVersions, manifestOptions?: ManifestOptions);
|
|
286
288
|
/**
|
|
287
289
|
* Create a Manifest from config files in the repository.
|
|
288
290
|
*
|
|
@@ -293,7 +295,7 @@ export declare class Manifest {
|
|
|
293
295
|
* @param {string} path The single path to check. Optional
|
|
294
296
|
* @returns {Manifest}
|
|
295
297
|
*/
|
|
296
|
-
static fromManifest(github:
|
|
298
|
+
static fromManifest(github: Scm, targetBranch: string, configFile?: string, manifestFile?: string, manifestOptionOverrides?: ManifestOptions, path?: string, releaseAs?: string): Promise<Manifest>;
|
|
297
299
|
/**
|
|
298
300
|
* Create a Manifest from explicit config in code. This assumes that the
|
|
299
301
|
* repository has a single component at the root path.
|
|
@@ -321,7 +323,7 @@ export declare class Manifest {
|
|
|
321
323
|
* pull request. Defaults to `[autorelease: tagged]`
|
|
322
324
|
* @returns {Manifest}
|
|
323
325
|
*/
|
|
324
|
-
static fromConfig(github:
|
|
326
|
+
static fromConfig(github: Scm, targetBranch: string, config: ReleaserConfig, manifestOptions?: ManifestOptions, path?: string): Promise<Manifest>;
|
|
325
327
|
/**
|
|
326
328
|
* Build all candidate pull requests for this repository.
|
|
327
329
|
*
|
package/build/src/manifest.js
CHANGED
|
@@ -821,6 +821,7 @@ function extractReleaserConfig(config) {
|
|
|
821
821
|
changelogSections: config['changelog-sections'],
|
|
822
822
|
changelogPath: config['changelog-path'],
|
|
823
823
|
changelogHost: config['changelog-host'],
|
|
824
|
+
includeCommitAuthors: config['include-commit-authors'],
|
|
824
825
|
releaseAs: config['release-as'],
|
|
825
826
|
skipGithubRelease: config['skip-github-release'],
|
|
826
827
|
skipChangelog: config['skip-changelog'],
|
|
@@ -1063,7 +1064,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|
|
1063
1064
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
1064
1065
|
}
|
|
1065
1066
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
1066
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
1067
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
1067
1068
|
return {
|
|
1068
1069
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
1069
1070
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
@@ -1074,31 +1075,32 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
|
1074
1075
|
changelogPath: (_h = pathConfig.changelogPath) !== null && _h !== void 0 ? _h : defaultConfig.changelogPath,
|
|
1075
1076
|
changelogHost: (_j = pathConfig.changelogHost) !== null && _j !== void 0 ? _j : defaultConfig.changelogHost,
|
|
1076
1077
|
changelogType: (_k = pathConfig.changelogType) !== null && _k !== void 0 ? _k : defaultConfig.changelogType,
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1078
|
+
includeCommitAuthors: (_l = pathConfig.includeCommitAuthors) !== null && _l !== void 0 ? _l : defaultConfig.includeCommitAuthors,
|
|
1079
|
+
releaseAs: (_m = pathConfig.releaseAs) !== null && _m !== void 0 ? _m : defaultConfig.releaseAs,
|
|
1080
|
+
skipGithubRelease: (_o = pathConfig.skipGithubRelease) !== null && _o !== void 0 ? _o : defaultConfig.skipGithubRelease,
|
|
1081
|
+
skipChangelog: (_p = pathConfig.skipChangelog) !== null && _p !== void 0 ? _p : defaultConfig.skipChangelog,
|
|
1082
|
+
draft: (_q = pathConfig.draft) !== null && _q !== void 0 ? _q : defaultConfig.draft,
|
|
1083
|
+
forceTag: (_r = pathConfig.forceTag) !== null && _r !== void 0 ? _r : defaultConfig.forceTag,
|
|
1084
|
+
draftPullRequest: (_s = pathConfig.draftPullRequest) !== null && _s !== void 0 ? _s : defaultConfig.draftPullRequest,
|
|
1085
|
+
prerelease: (_t = pathConfig.prerelease) !== null && _t !== void 0 ? _t : defaultConfig.prerelease,
|
|
1086
|
+
component: (_u = pathConfig.component) !== null && _u !== void 0 ? _u : defaultConfig.component,
|
|
1087
|
+
packageName: (_v = pathConfig.packageName) !== null && _v !== void 0 ? _v : defaultConfig.packageName,
|
|
1088
|
+
versionFile: (_w = pathConfig.versionFile) !== null && _w !== void 0 ? _w : defaultConfig.versionFile,
|
|
1089
|
+
extraFiles: (_x = pathConfig.extraFiles) !== null && _x !== void 0 ? _x : defaultConfig.extraFiles,
|
|
1090
|
+
includeComponentInTag: (_y = pathConfig.includeComponentInTag) !== null && _y !== void 0 ? _y : defaultConfig.includeComponentInTag,
|
|
1091
|
+
includeVInTag: (_z = pathConfig.includeVInTag) !== null && _z !== void 0 ? _z : defaultConfig.includeVInTag,
|
|
1092
|
+
includeVInReleaseName: (_0 = pathConfig.includeVInReleaseName) !== null && _0 !== void 0 ? _0 : defaultConfig.includeVInReleaseName,
|
|
1093
|
+
tagSeparator: (_1 = pathConfig.tagSeparator) !== null && _1 !== void 0 ? _1 : defaultConfig.tagSeparator,
|
|
1094
|
+
pullRequestTitlePattern: (_2 = pathConfig.pullRequestTitlePattern) !== null && _2 !== void 0 ? _2 : defaultConfig.pullRequestTitlePattern,
|
|
1095
|
+
pullRequestHeader: (_3 = pathConfig.pullRequestHeader) !== null && _3 !== void 0 ? _3 : defaultConfig.pullRequestHeader,
|
|
1096
|
+
pullRequestFooter: (_4 = pathConfig.pullRequestFooter) !== null && _4 !== void 0 ? _4 : defaultConfig.pullRequestFooter,
|
|
1097
|
+
componentNoSpace: (_5 = pathConfig.componentNoSpace) !== null && _5 !== void 0 ? _5 : defaultConfig.componentNoSpace,
|
|
1098
|
+
separatePullRequests: (_6 = pathConfig.separatePullRequests) !== null && _6 !== void 0 ? _6 : defaultConfig.separatePullRequests,
|
|
1099
|
+
skipSnapshot: (_7 = pathConfig.skipSnapshot) !== null && _7 !== void 0 ? _7 : defaultConfig.skipSnapshot,
|
|
1100
|
+
initialVersion: (_8 = pathConfig.initialVersion) !== null && _8 !== void 0 ? _8 : defaultConfig.initialVersion,
|
|
1101
|
+
extraLabels: (_9 = pathConfig.extraLabels) !== null && _9 !== void 0 ? _9 : defaultConfig.extraLabels,
|
|
1102
|
+
excludePaths: (_10 = pathConfig.excludePaths) !== null && _10 !== void 0 ? _10 : defaultConfig.excludePaths,
|
|
1103
|
+
dateFormat: (_11 = pathConfig.dateFormat) !== null && _11 !== void 0 ? _11 : defaultConfig.dateFormat,
|
|
1102
1104
|
};
|
|
1103
1105
|
}
|
|
1104
1106
|
/**
|
package/build/src/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Scm } from './scm';
|
|
2
2
|
import { CandidateReleasePullRequest, RepositoryConfig } from './manifest';
|
|
3
3
|
import { Strategy } from './strategy';
|
|
4
4
|
import { Commit, ConventionalCommit } from './commit';
|
|
@@ -11,11 +11,11 @@ import { Logger } from './util/logger';
|
|
|
11
11
|
* or update existing files.
|
|
12
12
|
*/
|
|
13
13
|
export declare abstract class ManifestPlugin {
|
|
14
|
-
readonly github:
|
|
14
|
+
readonly github: Scm;
|
|
15
15
|
readonly targetBranch: string;
|
|
16
16
|
readonly repositoryConfig: RepositoryConfig;
|
|
17
17
|
protected logger: Logger;
|
|
18
|
-
constructor(github:
|
|
18
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, logger?: Logger);
|
|
19
19
|
/**
|
|
20
20
|
* Perform post-processing on commits, e.g, sentence casing them.
|
|
21
21
|
* @param {Commit[]} commits The set of commits that will feed into release pull request.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ManifestPlugin } from '../plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { Scm } from '../scm';
|
|
3
3
|
import { RepositoryConfig, CandidateReleasePullRequest } from '../manifest';
|
|
4
4
|
/**
|
|
5
5
|
* This plugin allows configuring a priority of release groups. For example, you could
|
|
@@ -16,7 +16,7 @@ export declare class GroupPriority extends ManifestPlugin {
|
|
|
16
16
|
* repository. This allows plugins to know how components interact.
|
|
17
17
|
* @param {string[]} groups List of group names ordered with highest priority first
|
|
18
18
|
*/
|
|
19
|
-
constructor(github:
|
|
19
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, groups: string[]);
|
|
20
20
|
/**
|
|
21
21
|
* Group candidate release PRs by grouping and check our list of preferred
|
|
22
22
|
* groups in order. If a preferred group is found, only return pull requests for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManifestPlugin } from '../plugin';
|
|
2
2
|
import { RepositoryConfig, CandidateReleasePullRequest } from '../manifest';
|
|
3
|
-
import {
|
|
3
|
+
import { Scm } from '../scm';
|
|
4
4
|
import { Logger } from '../util/logger';
|
|
5
5
|
import { Strategy } from '../strategy';
|
|
6
6
|
import { Commit } from '../commit';
|
|
@@ -19,7 +19,7 @@ export declare class LinkedVersions extends ManifestPlugin {
|
|
|
19
19
|
readonly groupName: string;
|
|
20
20
|
readonly components: Set<string>;
|
|
21
21
|
readonly merge: boolean;
|
|
22
|
-
constructor(github:
|
|
22
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, groupName: string, components: string[], options?: LinkedVersionsPluginOptions);
|
|
23
23
|
/**
|
|
24
24
|
* Pre-configure strategies.
|
|
25
25
|
* @param {Record<string, Strategy>} strategiesByPath Strategies indexed by path
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WorkspacePlugin, AllPackages, DependencyGraph, WorkspacePluginOptions } from './workspace';
|
|
2
2
|
import { Version, VersionsMap } from '../version';
|
|
3
3
|
import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
|
|
4
|
-
import {
|
|
4
|
+
import { Scm } from '../scm';
|
|
5
5
|
interface Gav {
|
|
6
6
|
groupId: string;
|
|
7
7
|
artifactId: string;
|
|
@@ -20,7 +20,7 @@ interface MavenWorkspacePluginOptions extends WorkspacePluginOptions {
|
|
|
20
20
|
}
|
|
21
21
|
export declare class MavenWorkspace extends WorkspacePlugin<MavenArtifact> {
|
|
22
22
|
readonly considerAllArtifacts: boolean;
|
|
23
|
-
constructor(github:
|
|
23
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, options?: MavenWorkspacePluginOptions);
|
|
24
24
|
private fetchPom;
|
|
25
25
|
protected buildAllPackages(candidates: CandidateReleasePullRequest[]): Promise<AllPackages<MavenArtifact>>;
|
|
26
26
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManifestPlugin } from '../plugin';
|
|
2
2
|
import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
|
|
3
|
-
import {
|
|
3
|
+
import { Scm } from '../scm';
|
|
4
4
|
export interface MergeOptions {
|
|
5
5
|
pullRequestTitlePattern?: string;
|
|
6
6
|
pullRequestHeader?: string;
|
|
@@ -22,6 +22,6 @@ export declare class Merge extends ManifestPlugin {
|
|
|
22
22
|
private componentNoSpace?;
|
|
23
23
|
private headBranchName?;
|
|
24
24
|
private forceMerge;
|
|
25
|
-
constructor(github:
|
|
25
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, options?: MergeOptions);
|
|
26
26
|
run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Scm } from '../scm';
|
|
2
2
|
import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
|
|
3
3
|
import { Version, VersionsMap } from '../version';
|
|
4
4
|
import { WorkspacePlugin, DependencyGraph, WorkspacePluginOptions } from './workspace';
|
|
@@ -31,7 +31,7 @@ export declare class NodeWorkspace extends WorkspacePlugin<Package> {
|
|
|
31
31
|
private strategiesByPath;
|
|
32
32
|
private releasesByPath;
|
|
33
33
|
readonly updatePeerDependencies: boolean;
|
|
34
|
-
constructor(github:
|
|
34
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, options?: NodeWorkspaceOptions);
|
|
35
35
|
protected buildAllPackages(candidates: CandidateReleasePullRequest[]): Promise<{
|
|
36
36
|
allPackages: Package[];
|
|
37
37
|
candidatesByPackage: Record<string, CandidateReleasePullRequest>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ManifestPlugin } from '../plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { Scm } from '../scm';
|
|
3
3
|
import { RepositoryConfig } from '../manifest';
|
|
4
4
|
import { ConventionalCommit } from '../commit';
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ import { ConventionalCommit } from '../commit';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class SentenceCase extends ManifestPlugin {
|
|
10
10
|
specialWords: Set<string>;
|
|
11
|
-
constructor(github:
|
|
11
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, specialWords?: Array<string>);
|
|
12
12
|
/**
|
|
13
13
|
* Perform post-processing on commits, e.g, sentence casing them.
|
|
14
14
|
* @param {Commit[]} commits The set of commits that will feed into release pull request.
|
|
@@ -2,7 +2,7 @@ import { ManifestPlugin } from '../plugin';
|
|
|
2
2
|
import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
|
|
3
3
|
import { Logger } from '../util/logger';
|
|
4
4
|
import { VersionsMap, Version } from '../version';
|
|
5
|
-
import {
|
|
5
|
+
import { Scm } from '../scm';
|
|
6
6
|
export type DependencyGraph<T> = Map<string, DependencyNode<T>>;
|
|
7
7
|
export interface DependencyNode<T> {
|
|
8
8
|
deps: string[];
|
|
@@ -33,7 +33,7 @@ export declare abstract class WorkspacePlugin<T> extends ManifestPlugin {
|
|
|
33
33
|
private updateAllPackages;
|
|
34
34
|
private manifestPath;
|
|
35
35
|
private merge;
|
|
36
|
-
constructor(github:
|
|
36
|
+
constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, options?: WorkspacePluginOptions);
|
|
37
37
|
run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
|
|
38
38
|
/**
|
|
39
39
|
* Helper for finding a candidate release based on the package name.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Repository } from './repository';
|
|
2
|
+
import { Commit } from './commit';
|
|
3
|
+
import { PullRequest } from './pull-request';
|
|
4
|
+
import { ReleasePullRequest } from './release-pull-request';
|
|
5
|
+
import { Update } from './update';
|
|
6
|
+
import { Release } from './release';
|
|
7
|
+
import { GitHubFileContents } from '@google-automations/git-file-utils';
|
|
8
|
+
import { PullRequestOverflowHandler } from './util/pull-request-overflow-handler';
|
|
9
|
+
export interface ScmFileDiff {
|
|
10
|
+
readonly mode: '100644' | '100755' | '040000' | '160000' | '120000';
|
|
11
|
+
readonly content: string | null;
|
|
12
|
+
readonly originalContent: string | null;
|
|
13
|
+
}
|
|
14
|
+
export type ScmChangeSet = Map<string, ScmFileDiff>;
|
|
15
|
+
export interface ScmCommitIteratorOptions {
|
|
16
|
+
maxResults?: number;
|
|
17
|
+
backfillFiles?: boolean;
|
|
18
|
+
batchSize?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ScmReleaseIteratorOptions {
|
|
21
|
+
maxResults?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ScmTagIteratorOptions {
|
|
24
|
+
maxResults?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ScmCreatePullRequestOptions {
|
|
27
|
+
fork?: boolean;
|
|
28
|
+
draft?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ScmUpdatePullRequestOptions {
|
|
31
|
+
signoffUser?: string;
|
|
32
|
+
fork?: boolean;
|
|
33
|
+
pullRequestOverflowHandler?: PullRequestOverflowHandler;
|
|
34
|
+
}
|
|
35
|
+
export interface ScmReleaseOptions {
|
|
36
|
+
draft?: boolean;
|
|
37
|
+
prerelease?: boolean;
|
|
38
|
+
forceTag?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ScmRelease {
|
|
41
|
+
id: number;
|
|
42
|
+
name?: string;
|
|
43
|
+
tagName: string;
|
|
44
|
+
sha: string;
|
|
45
|
+
notes?: string;
|
|
46
|
+
url: string;
|
|
47
|
+
draft?: boolean;
|
|
48
|
+
uploadUrl?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ScmTag {
|
|
51
|
+
name: string;
|
|
52
|
+
sha: string;
|
|
53
|
+
}
|
|
54
|
+
export interface Scm {
|
|
55
|
+
readonly repository: Repository;
|
|
56
|
+
getFileContents(path: string): Promise<GitHubFileContents>;
|
|
57
|
+
getFileContentsOnBranch(path: string, branch: string): Promise<GitHubFileContents>;
|
|
58
|
+
getFileJson<T>(path: string, branch: string): Promise<T>;
|
|
59
|
+
findFilesByFilename(filename: string, prefix?: string): Promise<string[]>;
|
|
60
|
+
findFilesByFilenameAndRef(filename: string, ref: string, prefix?: string): Promise<string[]>;
|
|
61
|
+
findFilesByGlob(glob: string, prefix?: string): Promise<string[]>;
|
|
62
|
+
findFilesByGlobAndRef(glob: string, ref: string, prefix?: string): Promise<string[]>;
|
|
63
|
+
findFilesByExtension(extension: string, prefix?: string): Promise<string[]>;
|
|
64
|
+
findFilesByExtensionAndRef(extension: string, ref: string, prefix?: string): Promise<string[]>;
|
|
65
|
+
commitsSince(targetBranch: string, filter: (commit: Commit) => boolean, options?: ScmCommitIteratorOptions): Promise<Commit[]>;
|
|
66
|
+
mergeCommitIterator(targetBranch: string, options?: ScmCommitIteratorOptions): AsyncGenerator<Commit, void, void>;
|
|
67
|
+
pullRequestIterator(targetBranch: string, status?: 'OPEN' | 'CLOSED' | 'MERGED', maxResults?: number, includeFiles?: boolean): AsyncGenerator<PullRequest, void, void>;
|
|
68
|
+
releaseIterator(options?: ScmReleaseIteratorOptions): AsyncGenerator<ScmRelease, void, void>;
|
|
69
|
+
tagIterator(options?: ScmTagIteratorOptions): AsyncGenerator<ScmTag, void, void>;
|
|
70
|
+
createPullRequest(pullRequest: PullRequest, targetBranch: string, message: string, updates: Update[], options?: ScmCreatePullRequestOptions): Promise<PullRequest>;
|
|
71
|
+
updatePullRequest(number: number, pullRequest: ReleasePullRequest, targetBranch: string, options?: ScmUpdatePullRequestOptions): Promise<PullRequest>;
|
|
72
|
+
getPullRequest(number: number): Promise<PullRequest>;
|
|
73
|
+
createRelease(release: Release, options?: ScmReleaseOptions): Promise<ScmRelease>;
|
|
74
|
+
commentOnIssue(comment: string, number: number): Promise<string>;
|
|
75
|
+
removeIssueLabels(labels: string[], number: number): Promise<void>;
|
|
76
|
+
addIssueLabels(labels: string[], number: number): Promise<void>;
|
|
77
|
+
generateReleaseNotes(tagName: string, targetCommitish: string, previousTag?: string): Promise<string>;
|
|
78
|
+
createFileOnNewBranch(filename: string, contents: string, newBranchName: string, baseBranchName: string): Promise<string>;
|
|
79
|
+
buildChangeSet(updates: Update[], defaultBranch: string): Promise<ScmChangeSet>;
|
|
80
|
+
}
|
package/build/src/scm.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
//# sourceMappingURL=scm.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Strategy, BuildReleaseOptions, BumpReleaseOptions } from '../strategy';
|
|
2
|
-
import {
|
|
2
|
+
import { Scm } from '../scm';
|
|
3
3
|
import { VersioningStrategy } from '../versioning-strategy';
|
|
4
4
|
import { Repository } from '../repository';
|
|
5
5
|
import { ChangelogNotes, ChangelogSection } from '../changelog-notes';
|
|
@@ -25,7 +25,7 @@ export interface BaseStrategyOptions {
|
|
|
25
25
|
path?: string;
|
|
26
26
|
bumpMinorPreMajor?: boolean;
|
|
27
27
|
bumpPatchForMinorPreMajor?: boolean;
|
|
28
|
-
github:
|
|
28
|
+
github: Scm;
|
|
29
29
|
component?: string;
|
|
30
30
|
packageName?: string;
|
|
31
31
|
versioningStrategy?: VersioningStrategy;
|
|
@@ -56,6 +56,7 @@ export interface BaseStrategyOptions {
|
|
|
56
56
|
initialVersion?: string;
|
|
57
57
|
extraLabels?: string[];
|
|
58
58
|
dateFormat?: string;
|
|
59
|
+
includeCommitAuthors?: boolean;
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
62
|
* A strategy is responsible for determining which files are
|
|
@@ -63,7 +64,7 @@ export interface BaseStrategyOptions {
|
|
|
63
64
|
*/
|
|
64
65
|
export declare abstract class BaseStrategy implements Strategy {
|
|
65
66
|
readonly path: string;
|
|
66
|
-
protected github:
|
|
67
|
+
protected github: Scm;
|
|
67
68
|
protected logger: Logger;
|
|
68
69
|
protected component?: string;
|
|
69
70
|
private packageName?;
|
|
@@ -87,6 +88,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
87
88
|
readonly extraFiles: ExtraFile[];
|
|
88
89
|
readonly extraLabels: string[];
|
|
89
90
|
protected dateFormat: string;
|
|
91
|
+
protected includeCommitAuthors?: boolean;
|
|
90
92
|
readonly changelogNotes: ChangelogNotes;
|
|
91
93
|
protected changelogSections?: ChangelogSection[];
|
|
92
94
|
constructor(options: BaseStrategyOptions);
|
|
@@ -69,6 +69,7 @@ class BaseStrategy {
|
|
|
69
69
|
this.initialVersion = options.initialVersion;
|
|
70
70
|
this.extraLabels = options.extraLabels || [];
|
|
71
71
|
this.dateFormat = options.dateFormat || generic_1.DEFAULT_DATE_FORMAT;
|
|
72
|
+
this.includeCommitAuthors = options.includeCommitAuthors;
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* Return the component for this strategy. This may be a computed field.
|
|
@@ -121,6 +122,7 @@ class BaseStrategy {
|
|
|
121
122
|
targetBranch: this.targetBranch,
|
|
122
123
|
changelogSections: this.changelogSections,
|
|
123
124
|
commits: commits,
|
|
125
|
+
includeCommitAuthors: this.includeCommitAuthors,
|
|
124
126
|
});
|
|
125
127
|
}
|
|
126
128
|
async buildPullRequestBody(component, newVersion, releaseNotesBody, _conventionalCommits, _latestRelease, pullRequestHeader, pullRequestFooter) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PullRequestBody } from './pull-request-body';
|
|
2
|
-
import {
|
|
2
|
+
import { Scm } from '../scm';
|
|
3
3
|
import { PullRequest } from '../pull-request';
|
|
4
4
|
import { Logger } from './logger';
|
|
5
5
|
import { ReleasePullRequest } from '../release-pull-request';
|
|
@@ -32,7 +32,7 @@ export interface PullRequestOverflowHandler {
|
|
|
32
32
|
export declare class FilePullRequestOverflowHandler implements PullRequestOverflowHandler {
|
|
33
33
|
private github;
|
|
34
34
|
private logger;
|
|
35
|
-
constructor(github:
|
|
35
|
+
constructor(github: Scm, logger?: Logger);
|
|
36
36
|
/**
|
|
37
37
|
* Optionally store the full release notes into `release-notes.md` file
|
|
38
38
|
* on a new branch if they do not fit into the body of a pull request.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.5.1",
|
|
4
4
|
"description": "generate release PRs based on the conventionalcommits.org spec",
|
|
5
5
|
"main": "./build/src/index.js",
|
|
6
6
|
"bin": "./build/src/bin/release-please.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "cross-env ENVIRONMENT=test LC_ALL=en c8 mocha --
|
|
8
|
+
"test": "cross-env ENVIRONMENT=test LC_ALL=en c8 mocha --recursive --timeout=5000 build/test",
|
|
9
9
|
"docs": "echo add docs tests",
|
|
10
10
|
"test:snap": "cross-env SNAPSHOT_UPDATE=1 LC_ALL=en npm test",
|
|
11
11
|
"clean": "gts clean",
|