backport 10.4.0 → 11.0.0-beta.0
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/bin/backport +1 -1
- package/dist/src/backport-run.d.ts +5 -22
- package/dist/src/backport-run.js +76 -130
- package/dist/src/backport-run.js.map +1 -1
- package/dist/src/entrypoint.api.d.ts +17 -22
- package/dist/src/entrypoint.api.js +55 -88
- package/dist/src/entrypoint.api.js.map +1 -1
- package/dist/src/entrypoint.cli.d.ts +1 -1
- package/dist/src/entrypoint.cli.js +17 -13
- package/dist/src/entrypoint.cli.js.map +1 -1
- package/dist/src/graphql/generated/gql.d.ts +1 -1
- package/dist/src/graphql/generated/gql.js +4 -38
- package/dist/src/graphql/generated/gql.js.map +1 -1
- package/dist/src/graphql/generated/graphql.d.ts +2000 -1619
- package/dist/src/graphql/generated/graphql.js +659 -581
- package/dist/src/graphql/generated/graphql.js.map +1 -1
- package/dist/src/graphql/generated/index.d.ts +1 -1
- package/dist/src/graphql/generated/index.js +1 -17
- package/dist/src/graphql/generated/index.js.map +1 -1
- package/dist/src/lib/author.d.ts +2 -2
- package/dist/src/lib/author.js +1 -4
- package/dist/src/lib/author.js.map +1 -1
- package/dist/src/lib/backport-error.d.ts +53 -7
- package/dist/src/lib/backport-error.js +39 -15
- package/dist/src/lib/backport-error.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.d.ts +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.js +19 -23
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.d.ts +2 -3
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.js +53 -57
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.d.ts +2 -2
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.js +7 -10
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.d.ts +2 -2
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.js +6 -12
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.d.ts +2 -2
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.js +10 -16
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-merge-commit.d.ts +2 -2
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-merge-commit.js +6 -9
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-merge-commit.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-configured-target-pr-labels.d.ts +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-configured-target-pr-labels.js +7 -10
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-configured-target-pr-labels.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-source-pr-labels-to-copy.d.ts +2 -2
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-source-pr-labels-to-copy.js +3 -6
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-source-pr-labels-to-copy.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-target-prlabels.d.ts +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-target-prlabels.js +7 -10
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-target-prlabels.js.map +1 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/list-conflicting-and-unstaged-files.d.ts +7 -0
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/list-conflicting-and-unstaged-files.js +44 -0
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/list-conflicting-and-unstaged-files.js.map +1 -0
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.d.ts +2 -2
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.js +40 -84
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.js.map +1 -1
- package/dist/src/lib/child-process-promisified.d.ts +1 -1
- package/dist/src/lib/child-process-promisified.js +27 -48
- package/dist/src/lib/child-process-promisified.js.map +1 -1
- package/dist/src/lib/env.d.ts +3 -3
- package/dist/src/lib/env.js +12 -21
- package/dist/src/lib/env.js.map +1 -1
- package/dist/src/lib/get-commits.d.ts +2 -2
- package/dist/src/lib/get-commits.js +30 -32
- package/dist/src/lib/get-commits.js.map +1 -1
- package/dist/src/lib/get-source-branch-from-commits.d.ts +1 -1
- package/dist/src/lib/get-source-branch-from-commits.js +6 -6
- package/dist/src/lib/get-source-branch-from-commits.js.map +1 -1
- package/dist/src/lib/get-target-branches.d.ts +3 -3
- package/dist/src/lib/get-target-branches.js +20 -20
- package/dist/src/lib/get-target-branches.js.map +1 -1
- package/dist/src/lib/git/branch.d.ts +12 -0
- package/dist/src/lib/git/branch.js +83 -0
- package/dist/src/lib/git/branch.js.map +1 -0
- package/dist/src/lib/git/cherrypick.d.ts +27 -0
- package/dist/src/lib/git/cherrypick.js +106 -0
- package/dist/src/lib/git/cherrypick.js.map +1 -0
- package/dist/src/lib/git/clone.d.ts +4 -0
- package/dist/src/lib/git/clone.js +47 -0
- package/dist/src/lib/git/clone.js.map +1 -0
- package/dist/src/lib/git/commit.d.ts +19 -0
- package/dist/src/lib/git/commit.js +86 -0
- package/dist/src/lib/git/commit.js.map +1 -0
- package/dist/src/lib/git/config-file-status.d.ts +9 -0
- package/dist/src/lib/git/config-file-status.js +37 -0
- package/dist/src/lib/git/config-file-status.js.map +1 -0
- package/dist/src/lib/git/diff.d.ts +12 -0
- package/dist/src/lib/git/diff.js +73 -0
- package/dist/src/lib/git/diff.js.map +1 -0
- package/dist/src/lib/git/index.d.ts +8 -0
- package/dist/src/lib/git/index.js +9 -0
- package/dist/src/lib/git/index.js.map +1 -0
- package/dist/src/lib/git/push.d.ts +10 -0
- package/dist/src/lib/git/push.js +36 -0
- package/dist/src/lib/git/push.js.map +1 -0
- package/dist/src/lib/git/remote.d.ts +13 -0
- package/dist/src/lib/git/remote.js +85 -0
- package/dist/src/lib/git/remote.js.map +1 -0
- package/dist/src/lib/github/commit-formatters.js +4 -9
- package/dist/src/lib/github/commit-formatters.js.map +1 -1
- package/dist/src/lib/github/v3/add-assignees-to-pull-request.js +11 -26
- package/dist/src/lib/github/v3/add-assignees-to-pull-request.js.map +1 -1
- package/dist/src/lib/github/v3/add-labels-to-pull-request.js +11 -26
- package/dist/src/lib/github/v3/add-labels-to-pull-request.js.map +1 -1
- package/dist/src/lib/github/v3/add-reviewers-to-pull-request.d.ts +10 -2
- package/dist/src/lib/github/v3/add-reviewers-to-pull-request.js +12 -32
- package/dist/src/lib/github/v3/add-reviewers-to-pull-request.js.map +1 -1
- package/dist/src/lib/github/v3/{getPullRequest → create-pull-request}/create-pull-request.d.ts +1 -2
- package/dist/src/lib/github/v3/create-pull-request/create-pull-request.js +57 -0
- package/dist/src/lib/github/v3/create-pull-request/create-pull-request.js.map +1 -0
- package/dist/src/lib/github/v3/{getPullRequest → create-pull-request}/get-pull-request-body.d.ts +2 -2
- package/dist/src/lib/github/v3/{getPullRequest → create-pull-request}/get-pull-request-body.js +15 -21
- package/dist/src/lib/github/v3/create-pull-request/get-pull-request-body.js.map +1 -0
- package/dist/src/lib/github/v3/{getPullRequest → create-pull-request}/get-title.d.ts +2 -2
- package/dist/src/lib/github/v3/create-pull-request/get-title.js +27 -0
- package/dist/src/lib/github/v3/create-pull-request/get-title.js.map +1 -0
- package/dist/src/lib/github/v3/create-status-comment.d.ts +2 -2
- package/dist/src/lib/github/v3/create-status-comment.js +54 -84
- package/dist/src/lib/github/v3/create-status-comment.js.map +1 -1
- package/dist/src/lib/github/v3/get-github-v3-error-message.d.ts +2 -14
- package/dist/src/lib/github/v3/get-github-v3-error-message.js +4 -6
- package/dist/src/lib/github/v3/get-github-v3-error-message.js.map +1 -1
- package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.js +14 -21
- package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.js.map +1 -1
- package/dist/src/lib/github/v3/index.d.ts +13 -0
- package/dist/src/lib/github/v3/index.js +13 -0
- package/dist/src/lib/github/v3/index.js.map +1 -0
- package/dist/src/lib/github/v3/merge-pull-request.d.ts +1 -1
- package/dist/src/lib/github/v3/merge-pull-request.js +5 -13
- package/dist/src/lib/github/v3/merge-pull-request.js.map +1 -1
- package/dist/src/lib/github/v3/octokit-client.d.ts +10 -0
- package/dist/src/lib/github/v3/octokit-client.js +30 -0
- package/dist/src/lib/github/v3/octokit-client.js.map +1 -0
- package/dist/src/lib/github/v4/client/graphql-client.d.ts +17 -12
- package/dist/src/lib/github/v4/client/graphql-client.js +69 -23
- package/dist/src/lib/github/v4/client/graphql-client.js.map +1 -1
- package/dist/src/lib/github/v4/disable-pull-request-auto-merge.d.ts +1 -1
- package/dist/src/lib/github/v4/disable-pull-request-auto-merge.js +12 -12
- package/dist/src/lib/github/v4/disable-pull-request-auto-merge.js.map +1 -1
- package/dist/src/lib/github/v4/enable-pull-request-auto-merge.d.ts +1 -3
- package/dist/src/lib/github/v4/enable-pull-request-auto-merge.js +27 -16
- package/dist/src/lib/github/v4/enable-pull-request-auto-merge.js.map +1 -1
- package/dist/src/lib/github/v4/fetch-author-id.js +10 -10
- package/dist/src/lib/github/v4/fetch-author-id.js.map +1 -1
- package/dist/src/lib/github/v4/fetch-existing-pull-request.d.ts +2 -2
- package/dist/src/lib/github/v4/fetch-existing-pull-request.js +12 -12
- package/dist/src/lib/github/v4/fetch-existing-pull-request.js.map +1 -1
- package/dist/src/lib/github/v4/fetch-pull-request-auto-merge-method.d.ts +2 -2
- package/dist/src/lib/github/v4/fetch-pull-request-auto-merge-method.js +10 -10
- package/dist/src/lib/github/v4/fetch-pull-request-auto-merge-method.js.map +1 -1
- package/dist/src/lib/github/v4/{fetch-pull-request-id2.d.ts → fetch-pull-request-id.d.ts} +1 -1
- package/dist/src/lib/github/v4/fetch-pull-request-id.js +36 -0
- package/dist/src/lib/github/v4/fetch-pull-request-id.js.map +1 -0
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.d.ts +2 -2
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.js +26 -21
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.js.map +1 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.d.ts +2 -2
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.js +19 -16
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.js.map +1 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.d.ts +2 -2
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.js +41 -33
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.js.map +1 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.d.ts +1 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.js +16 -16
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.js.map +1 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-pull-requests-by-search-query.d.ts +1 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-pull-requests-by-search-query.js +24 -22
- package/dist/src/lib/github/v4/fetchCommits/fetch-pull-requests-by-search-query.js.map +1 -1
- package/dist/src/lib/github/v4/get-invalid-access-token-message.d.ts +1 -1
- package/dist/src/lib/github/v4/get-invalid-access-token-message.js +18 -17
- package/dist/src/lib/github/v4/get-invalid-access-token-message.js.map +1 -1
- package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.js +18 -19
- package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.js.map +1 -1
- package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.d.ts +3 -8
- package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.js +48 -42
- package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.js.map +1 -1
- package/dist/src/lib/github/v4/index.d.ts +20 -0
- package/dist/src/lib/github/v4/index.js +23 -0
- package/dist/src/lib/github/v4/index.js.map +1 -0
- package/dist/src/lib/github/v4/mocks/commits-by-author-mock.d.ts +1 -1
- package/dist/src/lib/github/v4/mocks/commits-by-author-mock.js +3 -6
- package/dist/src/lib/github/v4/mocks/commits-by-author-mock.js.map +1 -1
- package/dist/src/lib/github/v4/validate-target-branch.js +13 -14
- package/dist/src/lib/github/v4/validate-target-branch.js.map +1 -1
- package/dist/src/lib/logger.js +15 -56
- package/dist/src/lib/logger.js.map +1 -1
- package/dist/src/lib/ora.d.ts +4 -4
- package/dist/src/lib/ora.js +5 -12
- package/dist/src/lib/ora.js.map +1 -1
- package/dist/src/lib/prompts.d.ts +2 -2
- package/dist/src/lib/prompts.js +56 -59
- package/dist/src/lib/prompts.js.map +1 -1
- package/dist/src/lib/register-handlebars-helpers.js +5 -11
- package/dist/src/lib/register-handlebars-helpers.js.map +1 -1
- package/dist/src/lib/remote-config.d.ts +6 -3
- package/dist/src/lib/remote-config.js +14 -14
- package/dist/src/lib/remote-config.js.map +1 -1
- package/dist/src/lib/run-sequentially.d.ts +11 -14
- package/dist/src/lib/run-sequentially.js +27 -52
- package/dist/src/lib/run-sequentially.js.map +1 -1
- package/dist/src/lib/sequential-helper.d.ts +2 -0
- package/dist/src/lib/sequential-helper.js +9 -0
- package/dist/src/lib/sequential-helper.js.map +1 -0
- package/dist/src/lib/setup-repo.d.ts +1 -1
- package/dist/src/lib/setup-repo.js +31 -37
- package/dist/src/lib/setup-repo.js.map +1 -1
- package/dist/src/lib/sourceCommit/get-mock-source-commit.d.ts +1 -1
- package/dist/src/lib/sourceCommit/get-mock-source-commit.js +2 -5
- package/dist/src/lib/sourceCommit/get-mock-source-commit.js.map +1 -1
- package/dist/src/lib/sourceCommit/get-pull-request-states.d.ts +2 -2
- package/dist/src/lib/sourceCommit/get-pull-request-states.js +18 -22
- package/dist/src/lib/sourceCommit/get-pull-request-states.js.map +1 -1
- package/dist/src/lib/sourceCommit/get-source-pull-request.d.ts +22 -2
- package/dist/src/lib/sourceCommit/get-source-pull-request.js +2 -5
- package/dist/src/lib/sourceCommit/get-source-pull-request.js.map +1 -1
- package/dist/src/lib/sourceCommit/is-pull-request-cross-referenced-event.d.ts +1 -1
- package/dist/src/lib/sourceCommit/is-pull-request-cross-referenced-event.js +1 -4
- package/dist/src/lib/sourceCommit/is-pull-request-cross-referenced-event.js.map +1 -1
- package/dist/src/lib/sourceCommit/parse-source-commit.d.ts +3 -3
- package/dist/src/lib/sourceCommit/parse-source-commit.js +17 -21
- package/dist/src/lib/sourceCommit/parse-source-commit.js.map +1 -1
- package/dist/src/options/cli-args.d.ts +18 -19
- package/dist/src/options/cli-args.js +23 -25
- package/dist/src/options/cli-args.js.map +1 -1
- package/dist/src/options/config/config.d.ts +5 -10
- package/dist/src/options/config/config.js +5 -8
- package/dist/src/options/config/config.js.map +1 -1
- package/dist/src/options/config/global-config.d.ts +1 -1
- package/dist/src/options/config/global-config.js +22 -28
- package/dist/src/options/config/global-config.js.map +1 -1
- package/dist/src/options/config/project-config.d.ts +1 -1
- package/dist/src/options/config/project-config.js +7 -13
- package/dist/src/options/config/project-config.js.map +1 -1
- package/dist/src/options/config/read-config-file.d.ts +1 -1
- package/dist/src/options/config/read-config-file.js +16 -20
- package/dist/src/options/config/read-config-file.js.map +1 -1
- package/dist/src/options/config-options.d.ts +2 -1
- package/dist/src/options/config-options.js +1 -2
- package/dist/src/options/option-schema.d.ts +189 -0
- package/dist/src/options/option-schema.js +123 -0
- package/dist/src/options/option-schema.js.map +1 -0
- package/dist/src/options/options.d.ts +6 -121
- package/dist/src/options/options.js +65 -109
- package/dist/src/options/options.js.map +1 -1
- package/dist/src/scripts/postinstall.js +10 -13
- package/dist/src/scripts/postinstall.js.map +1 -1
- package/dist/src/scripts/run-postinstall.js +2 -4
- package/dist/src/scripts/run-postinstall.js.map +1 -1
- package/dist/src/types/index.d.ts +10 -0
- package/dist/src/types/index.js +6 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utils/exclude-undefined.js +1 -4
- package/dist/src/utils/exclude-undefined.js.map +1 -1
- package/dist/src/utils/filter-empty.js +1 -4
- package/dist/src/utils/filter-empty.js.map +1 -1
- package/dist/src/utils/filter-unmerged-commits.d.ts +1 -1
- package/dist/src/utils/filter-unmerged-commits.js +1 -4
- package/dist/src/utils/filter-unmerged-commits.js.map +1 -1
- package/dist/src/utils/is-errno-error.js +1 -4
- package/dist/src/utils/is-errno-error.js.map +1 -1
- package/dist/src/utils/package-version.d.ts +1 -1
- package/dist/src/utils/package-version.js +20 -9
- package/dist/src/utils/package-version.js.map +1 -1
- package/package.json +66 -71
- package/dist/package.json +0 -125
- package/dist/src/entrypoint.module.private.test.d.ts +0 -1
- package/dist/src/entrypoint.module.private.test.js +0 -531
- package/dist/src/entrypoint.module.private.test.js.map +0 -1
- package/dist/src/lib/apm.d.ts +0 -1
- package/dist/src/lib/apm.js +0 -33
- package/dist/src/lib/apm.js.map +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.test.d.ts +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.test.js +0 -371
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.test.js.map +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.test.d.ts +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.test.js +0 -74
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.test.js.map +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.test.d.ts +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.test.js +0 -382
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.test.js.map +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-configured-target-pr-labels.test.d.ts +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-configured-target-pr-labels.test.js +0 -126
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-configured-target-pr-labels.test.js.map +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-source-pr-labels-to-copy.test.d.ts +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-source-pr-labels-to-copy.test.js +0 -85
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/getTargetPRLabels/get-source-pr-labels-to-copy.test.js.map +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.test.d.ts +0 -1
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.test.js +0 -146
- package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.test.js.map +0 -1
- package/dist/src/lib/env.test.d.ts +0 -1
- package/dist/src/lib/env.test.js +0 -27
- package/dist/src/lib/env.test.js.map +0 -1
- package/dist/src/lib/get-target-branches.test.d.ts +0 -1
- package/dist/src/lib/get-target-branches.test.js +0 -263
- package/dist/src/lib/get-target-branches.test.js.map +0 -1
- package/dist/src/lib/git.d.ts +0 -98
- package/dist/src/lib/git.js +0 -549
- package/dist/src/lib/git.js.map +0 -1
- package/dist/src/lib/git.private.test.d.ts +0 -1
- package/dist/src/lib/git.private.test.js +0 -617
- package/dist/src/lib/git.private.test.js.map +0 -1
- package/dist/src/lib/git.test.d.ts +0 -1
- package/dist/src/lib/git.test.js +0 -1117
- package/dist/src/lib/git.test.js.map +0 -1
- package/dist/src/lib/github/commit-formatters.test.d.ts +0 -1
- package/dist/src/lib/github/commit-formatters.test.js +0 -12
- package/dist/src/lib/github/commit-formatters.test.js.map +0 -1
- package/dist/src/lib/github/v3/add-assignees-to-pull-request.test.d.ts +0 -1
- package/dist/src/lib/github/v3/add-assignees-to-pull-request.test.js +0 -31
- package/dist/src/lib/github/v3/add-assignees-to-pull-request.test.js.map +0 -1
- package/dist/src/lib/github/v3/create-status-comment.test.d.ts +0 -1
- package/dist/src/lib/github/v3/create-status-comment.test.js +0 -664
- package/dist/src/lib/github/v3/create-status-comment.test.js.map +0 -1
- package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.ts.private.test.d.ts +0 -1
- package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.ts.private.test.js +0 -34
- package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.ts.private.test.js.map +0 -1
- package/dist/src/lib/github/v3/getPullRequest/create-pull-request.js +0 -67
- package/dist/src/lib/github/v3/getPullRequest/create-pull-request.js.map +0 -1
- package/dist/src/lib/github/v3/getPullRequest/get-pull-request-body.js.map +0 -1
- package/dist/src/lib/github/v3/getPullRequest/get-pull-request-body.test.d.ts +0 -1
- package/dist/src/lib/github/v3/getPullRequest/get-pull-request-body.test.js +0 -482
- package/dist/src/lib/github/v3/getPullRequest/get-pull-request-body.test.js.map +0 -1
- package/dist/src/lib/github/v3/getPullRequest/get-title.js +0 -33
- package/dist/src/lib/github/v3/getPullRequest/get-title.js.map +0 -1
- package/dist/src/lib/github/v3/getPullRequest/get-title.test.d.ts +0 -1
- package/dist/src/lib/github/v3/getPullRequest/get-title.test.js +0 -111
- package/dist/src/lib/github/v3/getPullRequest/get-title.test.js.map +0 -1
- package/dist/src/lib/github/v4/client/graphql-client.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/client/graphql-client.private.test.js +0 -93
- package/dist/src/lib/github/v4/client/graphql-client.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/client/logging-exchange.d.ts +0 -2
- package/dist/src/lib/github/v4/client/logging-exchange.js +0 -21
- package/dist/src/lib/github/v4/client/logging-exchange.js.map +0 -1
- package/dist/src/lib/github/v4/client/response-meta-interceptor-exchange.d.ts +0 -2
- package/dist/src/lib/github/v4/client/response-meta-interceptor-exchange.js +0 -45
- package/dist/src/lib/github/v4/client/response-meta-interceptor-exchange.js.map +0 -1
- package/dist/src/lib/github/v4/enable-pull-request-auto-merge.mutation.test.d.ts +0 -1
- package/dist/src/lib/github/v4/enable-pull-request-auto-merge.mutation.test.js +0 -245
- package/dist/src/lib/github/v4/enable-pull-request-auto-merge.mutation.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetch-author-id.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetch-author-id.private.test.js +0 -26
- package/dist/src/lib/github/v4/fetch-author-id.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetch-existing-pull-request.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetch-existing-pull-request.private.test.js +0 -47
- package/dist/src/lib/github/v4/fetch-existing-pull-request.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetch-pull-request-id2.js +0 -33
- package/dist/src/lib/github/v4/fetch-pull-request-id2.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/all-fetchers.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/all-fetchers.private.test.js +0 -126
- package/dist/src/lib/github/v4/fetchCommits/all-fetchers.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.private.test.js +0 -110
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.private.test.js +0 -76
- package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.private.test.js +0 -179
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.test.js +0 -168
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.private.test.js +0 -30
- package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-pull-request-by-search-query.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/fetchCommits/fetch-pull-request-by-search-query.private.test.js +0 -150
- package/dist/src/lib/github/v4/fetchCommits/fetch-pull-request-by-search-query.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/get-invalid-access-token-message.test.d.ts +0 -1
- package/dist/src/lib/github/v4/get-invalid-access-token-message.test.js +0 -99
- package/dist/src/lib/github/v4/get-invalid-access-token-message.test.js.map +0 -1
- package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.private.test.js +0 -50
- package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.private.test.js +0 -119
- package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.private.test.js.map +0 -1
- package/dist/src/lib/github/v4/validate-target-branch.private.test.d.ts +0 -1
- package/dist/src/lib/github/v4/validate-target-branch.private.test.js +0 -24
- package/dist/src/lib/github/v4/validate-target-branch.private.test.js.map +0 -1
- package/dist/src/lib/prompt.test.d.ts +0 -1
- package/dist/src/lib/prompt.test.js +0 -181
- package/dist/src/lib/prompt.test.js.map +0 -1
- package/dist/src/lib/sequentially.d.ts +0 -1
- package/dist/src/lib/sequentially.js +0 -11
- package/dist/src/lib/sequentially.js.map +0 -1
- package/dist/src/lib/setup-repo.test.d.ts +0 -1
- package/dist/src/lib/setup-repo.test.js +0 -283
- package/dist/src/lib/setup-repo.test.js.map +0 -1
- package/dist/src/lib/sourceCommit/get-pull-request-states.test.d.ts +0 -1
- package/dist/src/lib/sourceCommit/get-pull-request-states.test.js +0 -706
- package/dist/src/lib/sourceCommit/get-pull-request-states.test.js.map +0 -1
- package/dist/src/lib/sourceCommit/parse-source-commit.test.d.ts +0 -1
- package/dist/src/lib/sourceCommit/parse-source-commit.test.js +0 -295
- package/dist/src/lib/sourceCommit/parse-source-commit.test.js.map +0 -1
- package/dist/src/options/cli-args.test.d.ts +0 -1
- package/dist/src/options/cli-args.test.js +0 -307
- package/dist/src/options/cli-args.test.js.map +0 -1
- package/dist/src/options/config/config.test.d.ts +0 -1
- package/dist/src/options/config/config.test.js +0 -32
- package/dist/src/options/config/config.test.js.map +0 -1
- package/dist/src/options/config/global-config.test.d.ts +0 -1
- package/dist/src/options/config/global-config.test.js +0 -62
- package/dist/src/options/config/global-config.test.js.map +0 -1
- package/dist/src/options/config/project-config.test.d.ts +0 -1
- package/dist/src/options/config/project-config.test.js +0 -110
- package/dist/src/options/config/project-config.test.js.map +0 -1
- package/dist/src/options/options.test.d.ts +0 -1
- package/dist/src/options/options.test.js +0 -506
- package/dist/src/options/options.test.js.map +0 -1
- package/dist/src/scripts/binary.integration.test.d.ts +0 -1
- package/dist/src/scripts/binary.integration.test.js +0 -93
- package/dist/src/scripts/binary.integration.test.js.map +0 -1
- package/dist/src/scripts/postinstall.integration.test.d.ts +0 -1
- package/dist/src/scripts/postinstall.integration.test.js +0 -97
- package/dist/src/scripts/postinstall.integration.test.js.map +0 -1
- package/dist/src/scripts/postinstall.test.d.ts +0 -1
- package/dist/src/scripts/postinstall.test.js +0 -68
- package/dist/src/scripts/postinstall.test.js.map +0 -1
- package/dist/src/test/child-process-helper.d.ts +0 -7
- package/dist/src/test/child-process-helper.js +0 -19
- package/dist/src/test/child-process-helper.js.map +0 -1
- package/dist/src/test/e2e/cli/binary.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/binary.private.test.js +0 -53
- package/dist/src/test/e2e/cli/binary.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/commit-author.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/commit-author.private.test.js +0 -79
- package/dist/src/test/e2e/cli/commit-author.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/copy-reviewers-to-target-pull-request.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/copy-reviewers-to-target-pull-request.private.test.js +0 -63
- package/dist/src/test/e2e/cli/copy-reviewers-to-target-pull-request.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/date-filters.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/date-filters.private.test.js +0 -56
- package/dist/src/test/e2e/cli/date-filters.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/different-merge-strategies.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/different-merge-strategies.private.test.js +0 -260
- package/dist/src/test/e2e/cli/different-merge-strategies.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/entrypoint.cli.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/entrypoint.cli.private.test.js +0 -232
- package/dist/src/test/e2e/cli/entrypoint.cli.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/error-handling-interactive-mode.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/error-handling-interactive-mode.private.test.js +0 -91
- package/dist/src/test/e2e/cli/error-handling-interactive-mode.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/error-handling-non-interactive-mode.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/error-handling-non-interactive-mode.private.test.js +0 -203
- package/dist/src/test/e2e/cli/error-handling-non-interactive-mode.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/gracefully-handles-corrupt-repo.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/gracefully-handles-corrupt-repo.private.test.js +0 -57
- package/dist/src/test/e2e/cli/gracefully-handles-corrupt-repo.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/repo-with-backportrc-removed.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/repo-with-backportrc-removed.private.test.js +0 -51
- package/dist/src/test/e2e/cli/repo-with-backportrc-removed.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/repo-with-changing-branch-label-mapping.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/repo-with-changing-branch-label-mapping.private.test.js +0 -98
- package/dist/src/test/e2e/cli/repo-with-changing-branch-label-mapping.private.test.js.map +0 -1
- package/dist/src/test/e2e/cli/repo-with-programatically-added-commits.mutation.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/repo-with-programatically-added-commits.mutation.test.js +0 -114
- package/dist/src/test/e2e/cli/repo-with-programatically-added-commits.mutation.test.js.map +0 -1
- package/dist/src/test/e2e/cli/run-backport-via-cli.d.ts +0 -21
- package/dist/src/test/e2e/cli/run-backport-via-cli.js +0 -104
- package/dist/src/test/e2e/cli/run-backport-via-cli.js.map +0 -1
- package/dist/src/test/e2e/cli/test-that-repo-can-be-cloned.private.test.d.ts +0 -1
- package/dist/src/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js +0 -91
- package/dist/src/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js.map +0 -1
- package/dist/src/test/e2e/module/entrypoint.module.mutation.test.d.ts +0 -1
- package/dist/src/test/e2e/module/entrypoint.module.mutation.test.js +0 -378
- package/dist/src/test/e2e/module/entrypoint.module.mutation.test.js.map +0 -1
- package/dist/src/test/handle-unbackported-pull-requests.private.test.d.ts +0 -1
- package/dist/src/test/handle-unbackported-pull-requests.private.test.js +0 -71
- package/dist/src/test/handle-unbackported-pull-requests.private.test.js.map +0 -1
- package/dist/src/test/integration-test-helpers.d.ts +0 -11
- package/dist/src/test/integration-test-helpers.js +0 -68
- package/dist/src/test/integration-test-helpers.js.map +0 -1
- package/dist/src/test/mock-config-files.d.ts +0 -5
- package/dist/src/test/mock-config-files.js +0 -21
- package/dist/src/test/mock-config-files.js.map +0 -1
- package/dist/src/test/nock-helpers.d.ts +0 -18
- package/dist/src/test/nock-helpers.js +0 -33
- package/dist/src/test/nock-helpers.js.map +0 -1
- package/dist/src/test/private/get-dev-access-token.d.ts +0 -2
- package/dist/src/test/private/get-dev-access-token.js +0 -12
- package/dist/src/test/private/get-dev-access-token.js.map +0 -1
- package/dist/src/test/replace-string-and-linebreaks.d.ts +0 -6
- package/dist/src/test/replace-string-and-linebreaks.js +0 -14
- package/dist/src/test/replace-string-and-linebreaks.js.map +0 -1
- package/dist/src/test/sandbox.d.ts +0 -6
- package/dist/src/test/sandbox.js +0 -63
- package/dist/src/test/sandbox.js.map +0 -1
- package/dist/src/test/setupFiles/automatic-mocks.d.ts +0 -1
- package/dist/src/test/setupFiles/automatic-mocks.js +0 -79
- package/dist/src/test/setupFiles/automatic-mocks.js.map +0 -1
- package/dist/src/test/setupFiles/jest-retry.d.ts +0 -0
- package/dist/src/test/setupFiles/jest-retry.js +0 -3
- package/dist/src/test/setupFiles/jest-retry.js.map +0 -1
- package/dist/src/test/setupFiles/nock-cleanup.d.ts +0 -1
- package/dist/src/test/setupFiles/nock-cleanup.js +0 -16
- package/dist/src/test/setupFiles/nock-cleanup.js.map +0 -1
- package/dist/src/utils/exclude-undefined.test.d.ts +0 -1
- package/dist/src/utils/exclude-undefined.test.js +0 -25
- package/dist/src/utils/exclude-undefined.test.js.map +0 -1
- package/dist/src/utils/maybe.d.ts +0 -1
- package/dist/src/utils/maybe.js +0 -7
- package/dist/src/utils/maybe.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./gql";
|
|
1
|
+
export * from "./gql.js";
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./gql"), exports);
|
|
1
|
+
export * from "./gql.js";
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/graphql/generated/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/graphql/generated/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
package/dist/src/lib/author.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Commit } from '../entrypoint.api';
|
|
2
|
-
import type { ValidConfigOptions } from '../options/options';
|
|
1
|
+
import type { Commit } from '../entrypoint.api.js';
|
|
2
|
+
import type { ValidConfigOptions } from '../options/options.js';
|
|
3
3
|
export type CommitAuthor = {
|
|
4
4
|
name: string;
|
|
5
5
|
email: string;
|
package/dist/src/lib/author.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCommitAuthor = getCommitAuthor;
|
|
4
|
-
function getCommitAuthor({ options, commit, }) {
|
|
1
|
+
export function getCommitAuthor({ options, commit, }) {
|
|
5
2
|
if (options.resetAuthor) {
|
|
6
3
|
return {
|
|
7
4
|
name: options.authenticatedUsername,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"author.js","sourceRoot":"","sources":["../../../src/lib/author.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"author.js","sourceRoot":"","sources":["../../../src/lib/author.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAC,EAC9B,OAAO,EACP,MAAM,GAIP;IACC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,qBAAqB;YACnC,KAAK,EAAE,IAAI,OAAO,CAAC,qBAAqB,4BAA4B;SACrE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,aAAa,IAAI,MAAM,CAAC,MAAO,CAAC,IAAK;QACnD,KAAK,EAAE,OAAO,CAAC,cAAc,IAAI,MAAM,CAAC,MAAO,CAAC,KAAM;KACvD,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Commit } from './sourceCommit/parse-source-commit';
|
|
2
|
-
type ErrorContext = {
|
|
1
|
+
import type { Commit } from './sourceCommit/parse-source-commit.js';
|
|
2
|
+
export type ErrorContext = {
|
|
3
3
|
code: 'merge-conflict-exception';
|
|
4
4
|
conflictingFiles: string[];
|
|
5
5
|
commitsWithoutBackports: {
|
|
@@ -7,16 +7,62 @@ type ErrorContext = {
|
|
|
7
7
|
commit: Commit;
|
|
8
8
|
}[];
|
|
9
9
|
} | {
|
|
10
|
-
code: '
|
|
10
|
+
code: 'invalid-branch-exception';
|
|
11
|
+
branchName: string;
|
|
12
|
+
} | {
|
|
13
|
+
code: 'no-branches-exception';
|
|
14
|
+
} | {
|
|
15
|
+
code: 'abort-conflict-resolution-exception';
|
|
16
|
+
} | {
|
|
17
|
+
code: 'pr-not-found-exception';
|
|
18
|
+
pullNumber: number;
|
|
19
|
+
} | {
|
|
20
|
+
code: 'pr-not-merged-exception';
|
|
21
|
+
pullNumber: number;
|
|
22
|
+
} | {
|
|
23
|
+
code: 'commit-not-found-exception';
|
|
24
|
+
sha: string;
|
|
25
|
+
sourceBranch: string;
|
|
26
|
+
} | {
|
|
27
|
+
code: 'no-commits-found-exception';
|
|
11
28
|
message: string;
|
|
12
29
|
} | {
|
|
13
|
-
code: 'invalid-
|
|
30
|
+
code: 'invalid-credentials-exception';
|
|
31
|
+
message: string;
|
|
32
|
+
} | {
|
|
33
|
+
code: 'repo-not-found-exception';
|
|
34
|
+
repoOwner: string;
|
|
35
|
+
repoName: string;
|
|
36
|
+
repoForkOwner: string;
|
|
37
|
+
} | {
|
|
38
|
+
code: 'config-error-exception';
|
|
39
|
+
message: string;
|
|
40
|
+
} | {
|
|
41
|
+
code: 'pr-creation-exception';
|
|
42
|
+
message: string;
|
|
43
|
+
} | {
|
|
44
|
+
code: 'cherrypick-exception';
|
|
45
|
+
message: string;
|
|
46
|
+
} | {
|
|
47
|
+
code: 'clone-exception';
|
|
48
|
+
message: string;
|
|
49
|
+
} | {
|
|
50
|
+
code: 'buffer-overflow-exception';
|
|
51
|
+
message: string;
|
|
52
|
+
} | {
|
|
53
|
+
code: 'branch-not-found-exception';
|
|
14
54
|
branchName: string;
|
|
15
55
|
} | {
|
|
16
|
-
code: '
|
|
56
|
+
code: 'max-retries-exception';
|
|
57
|
+
} | {
|
|
58
|
+
code: 'github-api-exception';
|
|
59
|
+
message: string;
|
|
60
|
+
} | {
|
|
61
|
+
code: 'auto-merge-not-available-exception';
|
|
62
|
+
message: string;
|
|
17
63
|
};
|
|
64
|
+
export type BackportErrorCode = ErrorContext['code'];
|
|
18
65
|
export declare class BackportError extends Error {
|
|
19
66
|
errorContext: ErrorContext;
|
|
20
|
-
constructor(
|
|
67
|
+
constructor(errorContext: ErrorContext);
|
|
21
68
|
}
|
|
22
|
-
export {};
|
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BackportError = void 0;
|
|
4
1
|
function getMessage(errorContext) {
|
|
5
2
|
switch (errorContext.code) {
|
|
6
|
-
case 'merge-conflict-exception':
|
|
3
|
+
case 'merge-conflict-exception': {
|
|
7
4
|
return `Commit could not be cherrypicked due to conflicts in: ${errorContext.conflictingFiles.join(',')}`;
|
|
8
|
-
|
|
5
|
+
}
|
|
6
|
+
case 'no-branches-exception': {
|
|
9
7
|
return 'There are no branches to backport to. Aborting.';
|
|
10
|
-
|
|
8
|
+
}
|
|
9
|
+
case 'abort-conflict-resolution-exception': {
|
|
11
10
|
return 'Conflict resolution was aborted by the user';
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
case 'invalid-branch-exception': {
|
|
13
13
|
return `The branch "${errorContext.branchName}" does not exist`;
|
|
14
|
-
|
|
14
|
+
}
|
|
15
|
+
case 'pr-not-found-exception': {
|
|
16
|
+
return `The PR #${errorContext.pullNumber} does not exist`;
|
|
17
|
+
}
|
|
18
|
+
case 'pr-not-merged-exception': {
|
|
19
|
+
return `The PR #${errorContext.pullNumber} is not merged`;
|
|
20
|
+
}
|
|
21
|
+
case 'commit-not-found-exception': {
|
|
22
|
+
return `No commit found on branch "${errorContext.sourceBranch}" with sha "${errorContext.sha}"`;
|
|
23
|
+
}
|
|
24
|
+
case 'no-commits-found-exception':
|
|
25
|
+
case 'invalid-credentials-exception':
|
|
26
|
+
case 'config-error-exception':
|
|
27
|
+
case 'pr-creation-exception':
|
|
28
|
+
case 'cherrypick-exception':
|
|
29
|
+
case 'clone-exception':
|
|
30
|
+
case 'buffer-overflow-exception':
|
|
31
|
+
case 'github-api-exception':
|
|
32
|
+
case 'auto-merge-not-available-exception': {
|
|
15
33
|
return errorContext.message;
|
|
34
|
+
}
|
|
35
|
+
case 'repo-not-found-exception': {
|
|
36
|
+
return `Error pushing to https://github.com/${errorContext.repoForkOwner}/${errorContext.repoName}. Repository does not exist. Either fork the repository (https://github.com/${errorContext.repoOwner}/${errorContext.repoName}) or disable fork mode via "--no-fork".\nRead more about fork mode in the docs: https://github.com/sorenlouv/backport/blob/main/docs/config-file-options.md#fork`;
|
|
37
|
+
}
|
|
38
|
+
case 'branch-not-found-exception': {
|
|
39
|
+
return `The branch "${errorContext.branchName}" is invalid or doesn't exist`;
|
|
40
|
+
}
|
|
41
|
+
case 'max-retries-exception': {
|
|
42
|
+
return 'Maximum number of retries exceeded';
|
|
43
|
+
}
|
|
16
44
|
}
|
|
17
45
|
}
|
|
18
|
-
class BackportError extends Error {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
? { code: 'message-only-exception', message: errorContextOrString }
|
|
22
|
-
: errorContextOrString;
|
|
46
|
+
export class BackportError extends Error {
|
|
47
|
+
errorContext;
|
|
48
|
+
constructor(errorContext) {
|
|
23
49
|
const message = getMessage(errorContext);
|
|
24
50
|
super(message);
|
|
25
|
-
Error.captureStackTrace(this, BackportError);
|
|
26
51
|
this.name = 'BackportError';
|
|
27
52
|
this.message = message;
|
|
28
53
|
this.errorContext = errorContext;
|
|
29
54
|
}
|
|
30
55
|
}
|
|
31
|
-
exports.BackportError = BackportError;
|
|
32
56
|
//# sourceMappingURL=backport-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backport-error.js","sourceRoot":"","sources":["../../../src/lib/backport-error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backport-error.js","sourceRoot":"","sources":["../../../src/lib/backport-error.ts"],"names":[],"mappings":"AAqCA,SAAS,UAAU,CAAC,YAA0B;IAC5C,QAAQ,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,KAAK,0BAA0B,CAAC,CAAC,CAAC;YAChC,OAAO,yDAAyD,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5G,CAAC;QACD,KAAK,uBAAuB,CAAC,CAAC,CAAC;YAC7B,OAAO,iDAAiD,CAAC;QAC3D,CAAC;QACD,KAAK,qCAAqC,CAAC,CAAC,CAAC;YAC3C,OAAO,6CAA6C,CAAC;QACvD,CAAC;QACD,KAAK,0BAA0B,CAAC,CAAC,CAAC;YAChC,OAAO,eAAe,YAAY,CAAC,UAAU,kBAAkB,CAAC;QAClE,CAAC;QACD,KAAK,wBAAwB,CAAC,CAAC,CAAC;YAC9B,OAAO,WAAW,YAAY,CAAC,UAAU,iBAAiB,CAAC;QAC7D,CAAC;QACD,KAAK,yBAAyB,CAAC,CAAC,CAAC;YAC/B,OAAO,WAAW,YAAY,CAAC,UAAU,gBAAgB,CAAC;QAC5D,CAAC;QACD,KAAK,4BAA4B,CAAC,CAAC,CAAC;YAClC,OAAO,8BAA8B,YAAY,CAAC,YAAY,eAAe,YAAY,CAAC,GAAG,GAAG,CAAC;QACnG,CAAC;QACD,KAAK,4BAA4B,CAAC;QAClC,KAAK,+BAA+B,CAAC;QACrC,KAAK,wBAAwB,CAAC;QAC9B,KAAK,uBAAuB,CAAC;QAC7B,KAAK,sBAAsB,CAAC;QAC5B,KAAK,iBAAiB,CAAC;QACvB,KAAK,2BAA2B,CAAC;QACjC,KAAK,sBAAsB,CAAC;QAC5B,KAAK,oCAAoC,CAAC,CAAC,CAAC;YAC1C,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,CAAC;QACD,KAAK,0BAA0B,CAAC,CAAC,CAAC;YAChC,OAAO,uCAAuC,YAAY,CAAC,aAAa,IAAI,YAAY,CAAC,QAAQ,+EAA+E,YAAY,CAAC,SAAS,IAAI,YAAY,CAAC,QAAQ,kKAAkK,CAAC;QACpY,CAAC;QACD,KAAK,4BAA4B,CAAC,CAAC,CAAC;YAClC,OAAO,eAAe,YAAY,CAAC,UAAU,+BAA+B,CAAC;QAC/E,CAAC;QACD,KAAK,uBAAuB,CAAC,CAAC,CAAC;YAC7B,OAAO,oCAAoC,CAAC;QAC9C,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,CAAe;IAC3B,YAAY,YAA0B;QACpC,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ValidConfigOptions } from '../../options/options';
|
|
1
|
+
import type { ValidConfigOptions } from '../../options/options.js';
|
|
2
2
|
export declare function autoMergeNowOrLater(options: ValidConfigOptions, pullNumber: number): Promise<void>;
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const logger_1 = require("../logger");
|
|
8
|
-
const ora_1 = require("../ora");
|
|
9
|
-
async function autoMergeNowOrLater(options, pullNumber) {
|
|
1
|
+
import { BackportError } from '../backport-error.js';
|
|
2
|
+
import { mergePullRequest } from '../github/v3/merge-pull-request.js';
|
|
3
|
+
import { enablePullRequestAutoMerge } from '../github/v4/enable-pull-request-auto-merge.js';
|
|
4
|
+
import { logger } from '../logger.js';
|
|
5
|
+
import { ora } from '../ora.js';
|
|
6
|
+
export async function autoMergeNowOrLater(options, pullNumber) {
|
|
10
7
|
const text = `Auto-merge: Enabling via "${options.autoMergeMethod}"`;
|
|
11
|
-
|
|
12
|
-
const spinner =
|
|
8
|
+
logger.info(text);
|
|
9
|
+
const spinner = ora(options.interactive, text).start();
|
|
13
10
|
if (options.dryRun) {
|
|
14
11
|
spinner.succeed();
|
|
15
12
|
return;
|
|
16
13
|
}
|
|
17
14
|
try {
|
|
18
15
|
try {
|
|
19
|
-
await
|
|
16
|
+
await enablePullRequestAutoMerge(options, pullNumber);
|
|
20
17
|
}
|
|
21
|
-
catch (
|
|
22
|
-
if (!(
|
|
23
|
-
throw
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (!(error instanceof BackportError)) {
|
|
20
|
+
throw error;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
throw
|
|
22
|
+
logger.info(`Auto merge: Failed to enable auto merge for PR "#${pullNumber}" due to ${error.message}`);
|
|
23
|
+
if (error.errorContext.code !== 'auto-merge-not-available-exception') {
|
|
24
|
+
throw error;
|
|
28
25
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
await (0, merge_pull_request_1.mergePullRequest)(options, pullNumber);
|
|
26
|
+
logger.info('Auto merge: Attempting to merge immediately');
|
|
27
|
+
await mergePullRequest(options, pullNumber);
|
|
32
28
|
spinner.text = 'Auto-merge: Pull request was merged immediately';
|
|
33
29
|
}
|
|
34
30
|
spinner.succeed();
|
|
35
31
|
}
|
|
36
|
-
catch (
|
|
37
|
-
|
|
32
|
+
catch (error) {
|
|
33
|
+
logger.warn(`Auto merge: An error occurred ${error}`);
|
|
38
34
|
spinner.fail();
|
|
39
35
|
}
|
|
40
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-merge-now-or-later.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auto-merge-now-or-later.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAA2B,EAC3B,UAAkB;IAElB,MAAM,IAAI,GAAG,6BAA6B,OAAO,CAAC,eAAe,GAAG,CAAC;IACrE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IAEvD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,IAAI,CAAC;YACH,MAAM,0BAA0B,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,KAAK,YAAY,aAAa,CAAC,EAAE,CAAC;gBACtC,MAAM,KAAK,CAAC;YACd,CAAC;YAED,MAAM,CAAC,IAAI,CACT,oDAAoD,UAAU,YAAY,KAAK,CAAC,OAAO,EAAE,CAC1F,CAAC;YAEF,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,KAAK,oCAAoC,EAAE,CAAC;gBACrE,MAAM,KAAK,CAAC;YACd,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;YAC3D,MAAM,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,GAAG,iDAAiD,CAAC;QACnE,CAAC;QAED,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ValidConfigOptions } from '../../options/options';
|
|
2
|
-
import type { Commit } from '../sourceCommit/parse-source-commit';
|
|
1
|
+
import type { ValidConfigOptions } from '../../options/options.js';
|
|
2
|
+
import type { Commit } from '../sourceCommit/parse-source-commit.js';
|
|
3
3
|
export declare function cherrypickAndCreateTargetPullRequest({ options, commits, targetBranch, }: {
|
|
4
4
|
options: ValidConfigOptions;
|
|
5
5
|
commits: Commit[];
|
|
@@ -7,5 +7,4 @@ export declare function cherrypickAndCreateTargetPullRequest({ options, commits,
|
|
|
7
7
|
}): Promise<{
|
|
8
8
|
url: string;
|
|
9
9
|
number: number;
|
|
10
|
-
didUpdate: boolean;
|
|
11
10
|
}>;
|
|
@@ -1,56 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const get_merge_commit_1 = require("./get-merge-commit");
|
|
24
|
-
const get_target_prlabels_1 = require("./getTargetPRLabels/get-target-prlabels");
|
|
25
|
-
const wait_for_cherrypick_1 = require("./wait-for-cherrypick");
|
|
26
|
-
async function cherrypickAndCreateTargetPullRequest({ options, commits, targetBranch, }) {
|
|
27
|
-
const backportBranch = (0, get_backport_branch_name_1.getBackportBranchName)({
|
|
1
|
+
/** Per-branch backport: cherry-pick commits, resolve conflicts, create target PR, add labels/assignees/reviewers. */
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { flatten } from 'lodash-es';
|
|
4
|
+
import { getSourceBranchFromCommits } from '../get-source-branch-from-commits.js';
|
|
5
|
+
import { createBackportBranch, deleteBackportBranch, pushBackportBranch, getRepoForkOwner, } from '../git/index.js';
|
|
6
|
+
import { addAssigneesToPullRequest } from '../github/v3/add-assignees-to-pull-request.js';
|
|
7
|
+
import { addLabelsToPullRequest } from '../github/v3/add-labels-to-pull-request.js';
|
|
8
|
+
import { addReviewersToPullRequest } from '../github/v3/add-reviewers-to-pull-request.js';
|
|
9
|
+
import { createPullRequest } from '../github/v3/create-pull-request/create-pull-request.js';
|
|
10
|
+
import { getPullRequestBody } from '../github/v3/create-pull-request/get-pull-request-body.js';
|
|
11
|
+
import { getTitle } from '../github/v3/create-pull-request/get-title.js';
|
|
12
|
+
import { validateTargetBranch } from '../github/v4/validate-target-branch.js';
|
|
13
|
+
import { consoleLog } from '../logger.js';
|
|
14
|
+
import { sequentially } from '../sequential-helper.js';
|
|
15
|
+
import { autoMergeNowOrLater } from './auto-merge-now-or-later.js';
|
|
16
|
+
import { copySourcePullRequestReviewersToTargetPullRequest } from './copy-source-pull-request-reviewers-to-target-pull-request.js';
|
|
17
|
+
import { getBackportBranchName } from './get-backport-branch-name.js';
|
|
18
|
+
import { getMergeCommits } from './get-merge-commit.js';
|
|
19
|
+
import { getTargetPRLabels } from './getTargetPRLabels/get-target-prlabels.js';
|
|
20
|
+
import { waitForCherrypick } from './wait-for-cherrypick.js';
|
|
21
|
+
export async function cherrypickAndCreateTargetPullRequest({ options, commits, targetBranch, }) {
|
|
22
|
+
const backportBranch = getBackportBranchName({
|
|
28
23
|
options,
|
|
29
24
|
targetBranch,
|
|
30
25
|
commits,
|
|
31
26
|
});
|
|
32
|
-
const repoForkOwner =
|
|
33
|
-
|
|
34
|
-
await
|
|
35
|
-
await
|
|
27
|
+
const repoForkOwner = getRepoForkOwner(options);
|
|
28
|
+
consoleLog(`\n${chalk.bold(`Backporting to ${targetBranch}:`)}`);
|
|
29
|
+
await validateTargetBranch({ ...options, branchName: targetBranch });
|
|
30
|
+
await createBackportBranch({
|
|
36
31
|
options,
|
|
37
|
-
sourceBranch:
|
|
32
|
+
sourceBranch: getSourceBranchFromCommits(commits),
|
|
38
33
|
targetBranch,
|
|
39
34
|
backportBranch,
|
|
40
35
|
});
|
|
41
|
-
const commitsFlattened =
|
|
42
|
-
const cherrypickResults = await
|
|
36
|
+
const commitsFlattened = flatten(await Promise.all(commits.map((c) => getMergeCommits(options, c))));
|
|
37
|
+
const cherrypickResults = await sequentially(commitsFlattened, (commit) => waitForCherrypick(options, commit, targetBranch));
|
|
43
38
|
const hasAnyCommitWithConflicts = cherrypickResults.some((r) => r.hasCommitsWithConflicts);
|
|
44
39
|
const unresolvedFiles = cherrypickResults.flatMap((r) => r.unresolvedFiles);
|
|
45
40
|
if (!options.dryRun) {
|
|
46
|
-
await
|
|
47
|
-
await
|
|
41
|
+
await pushBackportBranch({ options, backportBranch });
|
|
42
|
+
await deleteBackportBranch({ options, backportBranch });
|
|
48
43
|
}
|
|
49
44
|
const prPayload = {
|
|
50
45
|
owner: options.repoOwner,
|
|
51
46
|
repo: options.repoName,
|
|
52
|
-
title:
|
|
53
|
-
body:
|
|
47
|
+
title: getTitle({ options, commits, targetBranch }),
|
|
48
|
+
body: getPullRequestBody({
|
|
54
49
|
options,
|
|
55
50
|
commits,
|
|
56
51
|
targetBranch,
|
|
@@ -61,13 +56,13 @@ async function cherrypickAndCreateTargetPullRequest({ options, commits, targetBr
|
|
|
61
56
|
base: targetBranch, // eg. 7.x
|
|
62
57
|
draft: options.draft,
|
|
63
58
|
};
|
|
64
|
-
const targetPullRequest = await
|
|
59
|
+
const targetPullRequest = await createPullRequest({ options, prPayload });
|
|
65
60
|
// add assignees to target pull request
|
|
66
61
|
const assignees = options.autoAssign
|
|
67
62
|
? [options.authenticatedUsername]
|
|
68
63
|
: options.assignees;
|
|
69
|
-
if (
|
|
70
|
-
await
|
|
64
|
+
if (assignees.length > 0) {
|
|
65
|
+
await addAssigneesToPullRequest({
|
|
71
66
|
...options,
|
|
72
67
|
pullNumber: targetPullRequest.number,
|
|
73
68
|
assignees,
|
|
@@ -75,13 +70,17 @@ async function cherrypickAndCreateTargetPullRequest({ options, commits, targetBr
|
|
|
75
70
|
}
|
|
76
71
|
// add reviewers to target pull request
|
|
77
72
|
if (options.reviewers.length > 0) {
|
|
78
|
-
await
|
|
73
|
+
await addReviewersToPullRequest({
|
|
74
|
+
...options,
|
|
75
|
+
pullNumber: targetPullRequest.number,
|
|
76
|
+
reviewers: options.reviewers,
|
|
77
|
+
});
|
|
79
78
|
}
|
|
80
79
|
// add reviewers of the original PRs to the target pull request
|
|
81
80
|
if (options.copySourcePRReviewers) {
|
|
82
|
-
await
|
|
81
|
+
await copySourcePullRequestReviewersToTargetPullRequest(options, commits, targetPullRequest.number);
|
|
83
82
|
}
|
|
84
|
-
const targetPRLabels =
|
|
83
|
+
const targetPRLabels = getTargetPRLabels({
|
|
85
84
|
interactive: options.interactive,
|
|
86
85
|
targetPRLabels: options.targetPRLabels,
|
|
87
86
|
copySourcePRLabels: options.copySourcePRLabels,
|
|
@@ -90,7 +89,7 @@ async function cherrypickAndCreateTargetPullRequest({ options, commits, targetBr
|
|
|
90
89
|
});
|
|
91
90
|
// add labels to target pull request
|
|
92
91
|
if (targetPRLabels.length > 0) {
|
|
93
|
-
await
|
|
92
|
+
await addLabelsToPullRequest({
|
|
94
93
|
...options,
|
|
95
94
|
pullNumber: targetPullRequest.number,
|
|
96
95
|
labels: targetPRLabels,
|
|
@@ -98,22 +97,19 @@ async function cherrypickAndCreateTargetPullRequest({ options, commits, targetBr
|
|
|
98
97
|
}
|
|
99
98
|
// make PR auto mergable
|
|
100
99
|
if (options.autoMerge && !hasAnyCommitWithConflicts) {
|
|
101
|
-
await
|
|
100
|
+
await autoMergeNowOrLater(options, targetPullRequest.number);
|
|
102
101
|
}
|
|
103
102
|
// add labels to source pull requests
|
|
104
103
|
if (options.sourcePRLabels.length > 0) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
await Promise.all(promises);
|
|
104
|
+
await Promise.all(commits
|
|
105
|
+
.filter((commit) => commit.sourcePullRequest)
|
|
106
|
+
.map((commit) => addLabelsToPullRequest({
|
|
107
|
+
...options,
|
|
108
|
+
pullNumber: commit.sourcePullRequest.number,
|
|
109
|
+
labels: options.sourcePRLabels,
|
|
110
|
+
})));
|
|
115
111
|
}
|
|
116
|
-
|
|
112
|
+
consoleLog(`View pull request: ${targetPullRequest.url}`);
|
|
117
113
|
return targetPullRequest;
|
|
118
114
|
}
|
|
119
115
|
//# sourceMappingURL=cherrypick-and-create-target-pull-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cherrypick-and-create-target-pull-request.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cherrypick-and-create-target-pull-request.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/cherrypick-and-create-target-pull-request.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ValidConfigOptions } from '../../options/options';
|
|
2
|
-
import type { Commit } from '../sourceCommit/parse-source-commit';
|
|
1
|
+
import type { ValidConfigOptions } from '../../options/options.js';
|
|
2
|
+
import type { Commit } from '../sourceCommit/parse-source-commit.js';
|
|
3
3
|
export declare function copySourcePullRequestReviewersToTargetPullRequest(options: ValidConfigOptions, commits: Commit[], pullNumber: number): Promise<void>;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const add_reviewers_to_pull_request_1 = require("../github/v3/add-reviewers-to-pull-request");
|
|
6
|
-
const get_reviewers_from_pull_requests_1 = require("../github/v3/get-reviewers-from-pull-requests");
|
|
7
|
-
async function copySourcePullRequestReviewersToTargetPullRequest(options, commits, pullNumber) {
|
|
1
|
+
import { filterNil } from '../../utils/filter-empty.js';
|
|
2
|
+
import { addReviewersToPullRequest } from '../github/v3/add-reviewers-to-pull-request.js';
|
|
3
|
+
import { getReviewersFromPullRequests } from '../github/v3/get-reviewers-from-pull-requests.js';
|
|
4
|
+
export async function copySourcePullRequestReviewersToTargetPullRequest(options, commits, pullNumber) {
|
|
8
5
|
const pullNumbers = commits
|
|
9
6
|
.map((commit) => commit.sourcePullRequest?.number)
|
|
10
|
-
.filter(
|
|
11
|
-
const reviewers = await
|
|
7
|
+
.filter(filterNil);
|
|
8
|
+
const reviewers = await getReviewersFromPullRequests({
|
|
12
9
|
options,
|
|
13
10
|
pullNumbers,
|
|
14
11
|
});
|
|
15
12
|
if (reviewers) {
|
|
16
|
-
await (
|
|
13
|
+
await addReviewersToPullRequest({ ...options, pullNumber, reviewers });
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
16
|
//# sourceMappingURL=copy-source-pull-request-reviewers-to-target-pull-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-source-pull-request-reviewers-to-target-pull-request.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-source-pull-request-reviewers-to-target-pull-request.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAGhG,MAAM,CAAC,KAAK,UAAU,iDAAiD,CACrE,OAA2B,EAC3B,OAAiB,EACjB,UAAkB;IAElB,MAAM,WAAW,GAAG,OAAO;SACxB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC;SACjD,MAAM,CAAC,SAAS,CAAC,CAAC;IAErB,MAAM,SAAS,GAAG,MAAM,4BAA4B,CAAC;QACnD,OAAO;QACP,WAAW;KACZ,CAAC,CAAC;IACH,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,yBAAyB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Commit } from '../../entrypoint.api';
|
|
2
|
-
import type { ValidConfigOptions } from '../../options/options';
|
|
1
|
+
import type { Commit } from '../../entrypoint.api.js';
|
|
2
|
+
import type { ValidConfigOptions } from '../../options/options.js';
|
|
3
3
|
export declare function getBackportBranchName({ options, targetBranch, commits, }: {
|
|
4
4
|
options: ValidConfigOptions;
|
|
5
5
|
targetBranch: string;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getBackportBranchName = getBackportBranchName;
|
|
7
|
-
const handlebars_1 = __importDefault(require("handlebars"));
|
|
8
|
-
const commit_formatters_1 = require("../github/commit-formatters");
|
|
1
|
+
import Handlebars from 'handlebars';
|
|
2
|
+
import { getShortSha } from '../github/commit-formatters.js';
|
|
9
3
|
/*
|
|
10
4
|
* Returns the name of the backport branch without remote name
|
|
11
5
|
*
|
|
@@ -14,17 +8,17 @@ const commit_formatters_1 = require("../github/commit-formatters");
|
|
|
14
8
|
* For a single commit: `backport/7.x/commit-abcdef`
|
|
15
9
|
* For multiple: `backport/7.x/pr-1234_commit-abcdef`
|
|
16
10
|
*/
|
|
17
|
-
function getBackportBranchName({ options, targetBranch, commits, }) {
|
|
11
|
+
export function getBackportBranchName({ options, targetBranch, commits, }) {
|
|
18
12
|
const refValues = commits
|
|
19
13
|
.map((commit) => commit.sourcePullRequest
|
|
20
14
|
? `pr-${commit.sourcePullRequest.number}`
|
|
21
|
-
: `commit-${
|
|
15
|
+
: `commit-${getShortSha(commit.sourceCommit.sha)}`)
|
|
22
16
|
.join('_')
|
|
23
17
|
.slice(0, 200);
|
|
24
|
-
const sourcePullRequest = commits
|
|
18
|
+
const sourcePullRequest = commits.at(0)?.sourcePullRequest; // assume that all commits are from the same PR
|
|
25
19
|
const defaultBackportBranchName = 'backport/{{targetBranch}}/{{refValues}}';
|
|
26
20
|
const backportBranchName = options.backportBranchName ?? defaultBackportBranchName;
|
|
27
|
-
const template =
|
|
21
|
+
const template = Handlebars.compile(backportBranchName);
|
|
28
22
|
return template({
|
|
29
23
|
sourcePullRequest,
|
|
30
24
|
targetBranch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-backport-branch-name.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-backport-branch-name.js","sourceRoot":"","sources":["../../../../src/lib/cherrypickAndCreateTargetPullRequest/get-backport-branch-name.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,OAAO,EACP,YAAY,EACZ,OAAO,GAKR;IACC,MAAM,SAAS,GAAG,OAAO;SACtB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACd,MAAM,CAAC,iBAAiB;QACtB,CAAC,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE;QACzC,CAAC,CAAC,UAAU,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CACrD;SACA,IAAI,CAAC,GAAG,CAAC;SACT,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEjB,MAAM,iBAAiB,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,+CAA+C;IAC3G,MAAM,yBAAyB,GAAG,yCAAyC,CAAC;IAE5E,MAAM,kBAAkB,GACtB,OAAO,CAAC,kBAAkB,IAAI,yBAAyB,CAAC;IAE1D,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxD,OAAO,QAAQ,CAAC;QACd,iBAAiB;QACjB,YAAY;QACZ,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Commit } from '../../entrypoint.api';
|
|
2
|
-
import type { ValidConfigOptions } from '../../options/options';
|
|
1
|
+
import type { Commit } from '../../entrypoint.api.js';
|
|
2
|
+
import type { ValidConfigOptions } from '../../options/options.js';
|
|
3
3
|
export declare function getCommitsWithoutBackports({ options, commit, targetBranch, conflictingFiles, }: {
|
|
4
4
|
options: ValidConfigOptions;
|
|
5
5
|
commit: Commit;
|