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,664 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const nock_1 = __importDefault(require("nock"));
|
|
7
|
-
const backport_error_1 = require("../../backport-error");
|
|
8
|
-
const logger_1 = require("../../logger");
|
|
9
|
-
const create_status_comment_1 = require("./create-status-comment");
|
|
10
|
-
jest.unmock('../../logger');
|
|
11
|
-
describe('createStatusComment', () => {
|
|
12
|
-
it('redacts accessToken if it is included in the error message', async () => {
|
|
13
|
-
const accessToken = 'ghp_abcdefg';
|
|
14
|
-
(0, logger_1.setAccessToken)(accessToken);
|
|
15
|
-
const scope = (0, nock_1.default)('https://api.github.com')
|
|
16
|
-
.post('/repos/elastic/kibana/issues/100/comments')
|
|
17
|
-
.reply(200, 'some response');
|
|
18
|
-
let postedCommentBody = '';
|
|
19
|
-
scope.on('request', (req, interceptor, body) => {
|
|
20
|
-
postedCommentBody = JSON.parse(body).body;
|
|
21
|
-
});
|
|
22
|
-
await (0, create_status_comment_1.createStatusComment)({
|
|
23
|
-
options: {
|
|
24
|
-
repoName: 'kibana',
|
|
25
|
-
repoOwner: 'elastic',
|
|
26
|
-
accessToken,
|
|
27
|
-
backportBinary: 'node scripts/backport',
|
|
28
|
-
publishStatusCommentOnSuccess: true,
|
|
29
|
-
publishStatusCommentOnFailure: true,
|
|
30
|
-
githubApiBaseUrlV3: 'https://api.github.com',
|
|
31
|
-
interactive: false,
|
|
32
|
-
},
|
|
33
|
-
backportResponse: {
|
|
34
|
-
commits: [{ sourcePullRequest: { number: 100 } }],
|
|
35
|
-
status: 'failure',
|
|
36
|
-
error: new Error(`Error message containing very secret access token: ${accessToken}.`),
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
expect(postedCommentBody).toContain('Error message containing very secret access token: <REDACTED>');
|
|
40
|
-
scope.done();
|
|
41
|
-
nock_1.default.cleanAll();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe('getCommentBody', () => {
|
|
45
|
-
describe('when an unknown error occurs', () => {
|
|
46
|
-
const getParams = (opts) => ({
|
|
47
|
-
options: {
|
|
48
|
-
backportBinary: 'node scripts/backport',
|
|
49
|
-
...opts,
|
|
50
|
-
},
|
|
51
|
-
pullNumber: 55,
|
|
52
|
-
backportResponse: {
|
|
53
|
-
status: 'failure',
|
|
54
|
-
error: new Error('A terrible error occured'),
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
58
|
-
const params = getParams({ publishStatusCommentOnFailure: true });
|
|
59
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
60
|
-
"## 💔 Backport failed
|
|
61
|
-
The pull request could not be backported due to the following error:
|
|
62
|
-
\`A terrible error occured\`
|
|
63
|
-
|
|
64
|
-
### Manual backport
|
|
65
|
-
To create the backport manually run:
|
|
66
|
-
\`\`\`
|
|
67
|
-
node scripts/backport --pr 55
|
|
68
|
-
\`\`\`
|
|
69
|
-
|
|
70
|
-
### Questions ?
|
|
71
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
72
|
-
|
|
73
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
74
|
-
`);
|
|
75
|
-
});
|
|
76
|
-
it('does not post a comment when `publishStatusCommentOnFailure = false`', () => {
|
|
77
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
78
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
describe('when all backports succeed', () => {
|
|
82
|
-
const getParams = (opts) => ({
|
|
83
|
-
options: {
|
|
84
|
-
repoName: 'kibana',
|
|
85
|
-
repoOwner: 'elastic',
|
|
86
|
-
autoMerge: true,
|
|
87
|
-
...opts,
|
|
88
|
-
},
|
|
89
|
-
pullNumber: 55,
|
|
90
|
-
backportResponse: {
|
|
91
|
-
status: 'success',
|
|
92
|
-
results: [
|
|
93
|
-
{
|
|
94
|
-
status: 'success',
|
|
95
|
-
targetBranch: '7.x',
|
|
96
|
-
pullRequestNumber: 55,
|
|
97
|
-
pullRequestUrl: 'url-to-pr',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
status: 'success',
|
|
101
|
-
targetBranch: '7.1',
|
|
102
|
-
pullRequestNumber: 66,
|
|
103
|
-
pullRequestUrl: 'url-to-pr',
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
it('posts a comment when `publishStatusCommentOnSuccess = true`', () => {
|
|
109
|
-
const params = getParams({ publishStatusCommentOnSuccess: true });
|
|
110
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
111
|
-
"## 💚 All backports created successfully
|
|
112
|
-
|
|
113
|
-
| Status | Branch | Result |
|
|
114
|
-
|:------:|:------:|:------|
|
|
115
|
-
|✅|7.x|[<img src="https://img.shields.io/github/pulls/detail/state/elastic/kibana/55">](url-to-pr)|
|
|
116
|
-
|✅|7.1|[<img src="https://img.shields.io/github/pulls/detail/state/elastic/kibana/66">](url-to-pr)|
|
|
117
|
-
|
|
118
|
-
Note: Successful backport PRs will be merged automatically after passing CI.
|
|
119
|
-
|
|
120
|
-
### Questions ?
|
|
121
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
122
|
-
|
|
123
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
124
|
-
`);
|
|
125
|
-
});
|
|
126
|
-
it('does not post a comment when `publishStatusCommentOnSuccess = false`', () => {
|
|
127
|
-
const params = getParams({ interactive: true });
|
|
128
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`undefined`);
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
describe('when all backports fail', () => {
|
|
132
|
-
const getParams = (opts) => ({
|
|
133
|
-
options: {
|
|
134
|
-
repoName: 'kibana',
|
|
135
|
-
repoOwner: 'elastic',
|
|
136
|
-
autoMerge: true,
|
|
137
|
-
backportBinary: 'node scripts/backport',
|
|
138
|
-
...opts,
|
|
139
|
-
},
|
|
140
|
-
pullNumber: 55,
|
|
141
|
-
backportResponse: {
|
|
142
|
-
status: 'success',
|
|
143
|
-
results: [
|
|
144
|
-
{
|
|
145
|
-
status: 'unhandled-error',
|
|
146
|
-
targetBranch: '7.x',
|
|
147
|
-
error: new Error('My boom error!'),
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
status: 'unhandled-error',
|
|
151
|
-
targetBranch: '7.1',
|
|
152
|
-
error: new Error('My boom error!'),
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
158
|
-
const params = getParams({ publishStatusCommentOnFailure: true });
|
|
159
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
160
|
-
"## 💔 All backports failed
|
|
161
|
-
|
|
162
|
-
| Status | Branch | Result |
|
|
163
|
-
|:------:|:------:|:------|
|
|
164
|
-
|❌|7.x|An unhandled error occurred. Please see the logs for details|
|
|
165
|
-
|❌|7.1|An unhandled error occurred. Please see the logs for details|
|
|
166
|
-
|
|
167
|
-
### Manual backport
|
|
168
|
-
To create the backport manually run:
|
|
169
|
-
\`\`\`
|
|
170
|
-
node scripts/backport --pr 55
|
|
171
|
-
\`\`\`
|
|
172
|
-
|
|
173
|
-
### Questions ?
|
|
174
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
175
|
-
|
|
176
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
177
|
-
`);
|
|
178
|
-
});
|
|
179
|
-
it('does not post a comment when `publishStatusCommentOnFailure = false`', () => {
|
|
180
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
181
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
describe('when some backports fail', () => {
|
|
185
|
-
const getParams = (opts) => ({
|
|
186
|
-
options: {
|
|
187
|
-
repoName: 'kibana',
|
|
188
|
-
repoOwner: 'elastic',
|
|
189
|
-
autoMerge: true,
|
|
190
|
-
backportBinary: 'node scripts/backport',
|
|
191
|
-
...opts,
|
|
192
|
-
},
|
|
193
|
-
pullNumber: 55,
|
|
194
|
-
backportResponse: {
|
|
195
|
-
status: 'success',
|
|
196
|
-
results: [
|
|
197
|
-
{
|
|
198
|
-
status: 'success',
|
|
199
|
-
targetBranch: '7.x',
|
|
200
|
-
pullRequestNumber: 55,
|
|
201
|
-
pullRequestUrl: 'url-to-pr-55',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
status: 'failure',
|
|
205
|
-
targetBranch: '7.1',
|
|
206
|
-
error: new Error('My boom error!'),
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
},
|
|
210
|
-
});
|
|
211
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
212
|
-
const params = getParams({ publishStatusCommentOnFailure: true });
|
|
213
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
214
|
-
"## 💔 Some backports could not be created
|
|
215
|
-
|
|
216
|
-
| Status | Branch | Result |
|
|
217
|
-
|:------:|:------:|:------|
|
|
218
|
-
|✅|7.x|[<img src="https://img.shields.io/github/pulls/detail/state/elastic/kibana/55">](url-to-pr-55)|
|
|
219
|
-
|❌|7.1|An unhandled error occurred. Please see the logs for details|
|
|
220
|
-
|
|
221
|
-
Note: Successful backport PRs will be merged automatically after passing CI.
|
|
222
|
-
|
|
223
|
-
### Manual backport
|
|
224
|
-
To create the backport manually run:
|
|
225
|
-
\`\`\`
|
|
226
|
-
node scripts/backport --pr 55
|
|
227
|
-
\`\`\`
|
|
228
|
-
|
|
229
|
-
### Questions ?
|
|
230
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
231
|
-
|
|
232
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
233
|
-
`);
|
|
234
|
-
});
|
|
235
|
-
it('does not post a comment when running `publishStatusCommentOnFailure = false`', () => {
|
|
236
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
237
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`undefined`);
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
describe('when some backports fail due to conflicts', () => {
|
|
241
|
-
const getParams = (opts) => ({
|
|
242
|
-
options: {
|
|
243
|
-
repoName: 'kibana',
|
|
244
|
-
repoOwner: 'elastic',
|
|
245
|
-
autoMerge: true,
|
|
246
|
-
backportBinary: 'node scripts/backport',
|
|
247
|
-
...opts,
|
|
248
|
-
},
|
|
249
|
-
pullNumber: 55,
|
|
250
|
-
backportResponse: {
|
|
251
|
-
status: 'success',
|
|
252
|
-
results: [
|
|
253
|
-
{
|
|
254
|
-
status: 'success',
|
|
255
|
-
targetBranch: '7.x',
|
|
256
|
-
pullRequestNumber: 55,
|
|
257
|
-
pullRequestUrl: 'url-to-pr-55',
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
status: 'failure',
|
|
261
|
-
targetBranch: '7.1',
|
|
262
|
-
error: new backport_error_1.BackportError({
|
|
263
|
-
code: 'merge-conflict-exception',
|
|
264
|
-
conflictingFiles: ['readme.md'],
|
|
265
|
-
commitsWithoutBackports: [
|
|
266
|
-
{
|
|
267
|
-
formatted: 'some-formatted-text',
|
|
268
|
-
commit: {
|
|
269
|
-
author: {
|
|
270
|
-
email: 'soren.louv@elastic.co',
|
|
271
|
-
name: 'Søren Louv-Jansen',
|
|
272
|
-
},
|
|
273
|
-
sourceBranch: 'master',
|
|
274
|
-
sourcePullRequest: {
|
|
275
|
-
labels: [],
|
|
276
|
-
number: 5,
|
|
277
|
-
url: 'url-to-pr-5',
|
|
278
|
-
title: 'New Zealand commit message',
|
|
279
|
-
mergeCommit: {
|
|
280
|
-
sha: '',
|
|
281
|
-
message: 'New Zealand commit message',
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
suggestedTargetBranches: [],
|
|
285
|
-
sourceCommit: {
|
|
286
|
-
branchLabelMapping: {},
|
|
287
|
-
committedDate: '',
|
|
288
|
-
sha: '',
|
|
289
|
-
message: 'New Zealand commit message',
|
|
290
|
-
},
|
|
291
|
-
targetPullRequestStates: [],
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
formatted: 'some-formatted-text',
|
|
296
|
-
commit: {
|
|
297
|
-
author: {
|
|
298
|
-
email: 'soren.louv@elastic.co',
|
|
299
|
-
name: 'Søren Louv-Jansen',
|
|
300
|
-
},
|
|
301
|
-
sourceBranch: 'master',
|
|
302
|
-
sourcePullRequest: {
|
|
303
|
-
labels: [],
|
|
304
|
-
number: 44,
|
|
305
|
-
title: 'Australia commit',
|
|
306
|
-
url: 'url-to-pr-44',
|
|
307
|
-
mergeCommit: {
|
|
308
|
-
sha: '',
|
|
309
|
-
message: 'Australia commit',
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
suggestedTargetBranches: [],
|
|
313
|
-
sourceCommit: {
|
|
314
|
-
branchLabelMapping: {},
|
|
315
|
-
committedDate: '',
|
|
316
|
-
sha: '',
|
|
317
|
-
message: 'Australia commit',
|
|
318
|
-
},
|
|
319
|
-
targetPullRequestStates: [],
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
formatted: 'some-formatted-text',
|
|
324
|
-
commit: {
|
|
325
|
-
author: {
|
|
326
|
-
email: 'matthias.wilhelm@elastic.co',
|
|
327
|
-
name: 'Matthias Polman-Wilhelm',
|
|
328
|
-
},
|
|
329
|
-
sourceBranch: 'master',
|
|
330
|
-
sourcePullRequest: {
|
|
331
|
-
labels: [],
|
|
332
|
-
number: 44,
|
|
333
|
-
title: 'Antarctica commit | with pipeline char',
|
|
334
|
-
url: 'url-to-pr-45',
|
|
335
|
-
mergeCommit: {
|
|
336
|
-
sha: '',
|
|
337
|
-
message: 'Antarctica commit | with pipeline char',
|
|
338
|
-
},
|
|
339
|
-
},
|
|
340
|
-
suggestedTargetBranches: [],
|
|
341
|
-
sourceCommit: {
|
|
342
|
-
branchLabelMapping: {},
|
|
343
|
-
committedDate: '',
|
|
344
|
-
sha: '',
|
|
345
|
-
message: 'Antarctica commit | with pipeline char',
|
|
346
|
-
},
|
|
347
|
-
targetPullRequestStates: [],
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
],
|
|
351
|
-
}),
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
status: 'failure',
|
|
355
|
-
targetBranch: '7.2',
|
|
356
|
-
error: new backport_error_1.BackportError({
|
|
357
|
-
code: 'merge-conflict-exception',
|
|
358
|
-
conflictingFiles: ['my-file.txt'],
|
|
359
|
-
commitsWithoutBackports: [],
|
|
360
|
-
}),
|
|
361
|
-
},
|
|
362
|
-
],
|
|
363
|
-
},
|
|
364
|
-
});
|
|
365
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
366
|
-
const params = getParams({ publishStatusCommentOnFailure: true });
|
|
367
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
368
|
-
"## 💔 Some backports could not be created
|
|
369
|
-
|
|
370
|
-
| Status | Branch | Result |
|
|
371
|
-
|:------:|:------:|:------|
|
|
372
|
-
|✅|7.x|[<img src="https://img.shields.io/github/pulls/detail/state/elastic/kibana/55">](url-to-pr-55)|
|
|
373
|
-
|❌|7.1|**Backport failed because of merge conflicts**<br><br>You might need to backport the following PRs to 7.1:<br> - [New Zealand commit message](url-to-pr-5)<br> - [Australia commit](url-to-pr-44)<br> - [Antarctica commit \\| with pipeline char](url-to-pr-45)|
|
|
374
|
-
|❌|7.2|Backport failed because of merge conflicts|
|
|
375
|
-
|
|
376
|
-
Note: Successful backport PRs will be merged automatically after passing CI.
|
|
377
|
-
|
|
378
|
-
### Manual backport
|
|
379
|
-
To create the backport manually run:
|
|
380
|
-
\`\`\`
|
|
381
|
-
node scripts/backport --pr 55
|
|
382
|
-
\`\`\`
|
|
383
|
-
|
|
384
|
-
### Questions ?
|
|
385
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
386
|
-
|
|
387
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
388
|
-
`);
|
|
389
|
-
});
|
|
390
|
-
it('does not post a comment when `publishStatusCommentOnFailure = false`', () => {
|
|
391
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
392
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
393
|
-
});
|
|
394
|
-
});
|
|
395
|
-
describe('when backport was aborted due to missing branches', () => {
|
|
396
|
-
const getParams = (opts) => ({
|
|
397
|
-
options: {
|
|
398
|
-
repoName: 'kibana',
|
|
399
|
-
repoOwner: 'elastic',
|
|
400
|
-
autoMerge: true,
|
|
401
|
-
backportBinary: 'node scripts/backport',
|
|
402
|
-
...opts,
|
|
403
|
-
},
|
|
404
|
-
pullNumber: 55,
|
|
405
|
-
backportResponse: {
|
|
406
|
-
status: 'aborted',
|
|
407
|
-
commits: [],
|
|
408
|
-
error: new backport_error_1.BackportError({ code: 'no-branches-exception' }),
|
|
409
|
-
errorMessage: 'my message',
|
|
410
|
-
},
|
|
411
|
-
});
|
|
412
|
-
it('posts a comment when `publishStatusCommentOnAbort = true`', () => {
|
|
413
|
-
const params = getParams({
|
|
414
|
-
publishStatusCommentOnAbort: true,
|
|
415
|
-
});
|
|
416
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
417
|
-
"## ⚪ Backport skipped
|
|
418
|
-
The pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually.
|
|
419
|
-
|
|
420
|
-
### Manual backport
|
|
421
|
-
To create the backport manually run:
|
|
422
|
-
\`\`\`
|
|
423
|
-
node scripts/backport --pr 55
|
|
424
|
-
\`\`\`
|
|
425
|
-
|
|
426
|
-
### Questions ?
|
|
427
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
428
|
-
|
|
429
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
430
|
-
`);
|
|
431
|
-
});
|
|
432
|
-
it('does not post a comment when `publishStatusCommentOnAbort = false`', () => {
|
|
433
|
-
const params = getParams({ publishStatusCommentOnAbort: false });
|
|
434
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
435
|
-
});
|
|
436
|
-
});
|
|
437
|
-
describe('when backport was aborted during conflict resolution', () => {
|
|
438
|
-
const getParams = (opts) => ({
|
|
439
|
-
options: {
|
|
440
|
-
interactive: true,
|
|
441
|
-
repoName: 'kibana',
|
|
442
|
-
repoOwner: 'elastic',
|
|
443
|
-
autoMerge: true,
|
|
444
|
-
backportBinary: 'node scripts/backport',
|
|
445
|
-
...opts,
|
|
446
|
-
},
|
|
447
|
-
pullNumber: 55,
|
|
448
|
-
backportResponse: {
|
|
449
|
-
status: 'success',
|
|
450
|
-
commits: [],
|
|
451
|
-
results: [
|
|
452
|
-
{
|
|
453
|
-
targetBranch: 'staging',
|
|
454
|
-
status: 'handled-error',
|
|
455
|
-
error: new backport_error_1.BackportError({
|
|
456
|
-
code: 'abort-conflict-resolution-exception',
|
|
457
|
-
}),
|
|
458
|
-
},
|
|
459
|
-
],
|
|
460
|
-
},
|
|
461
|
-
});
|
|
462
|
-
it('posts a comment when `publishStatusCommentOnAbort = true`', () => {
|
|
463
|
-
const params = getParams({
|
|
464
|
-
publishStatusCommentOnAbort: true,
|
|
465
|
-
});
|
|
466
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`undefined`);
|
|
467
|
-
});
|
|
468
|
-
it('does not post a comment when `publishStatusCommentOnAbort = false`', () => {
|
|
469
|
-
const params = getParams({ publishStatusCommentOnAbort: false });
|
|
470
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
471
|
-
});
|
|
472
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
473
|
-
const params = getParams({
|
|
474
|
-
publishStatusCommentOnFailure: true,
|
|
475
|
-
});
|
|
476
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
477
|
-
"## 💔 All backports failed
|
|
478
|
-
|
|
479
|
-
| Status | Branch | Result |
|
|
480
|
-
|:------:|:------:|:------|
|
|
481
|
-
|❌|staging|Conflict resolution was aborted by the user|
|
|
482
|
-
|
|
483
|
-
### Manual backport
|
|
484
|
-
To create the backport manually run:
|
|
485
|
-
\`\`\`
|
|
486
|
-
node scripts/backport --pr 55
|
|
487
|
-
\`\`\`
|
|
488
|
-
|
|
489
|
-
### Questions ?
|
|
490
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
491
|
-
|
|
492
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
493
|
-
`);
|
|
494
|
-
});
|
|
495
|
-
it('does not post a comment when `publishStatusCommentOnFailure = false`', () => {
|
|
496
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
497
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
498
|
-
});
|
|
499
|
-
});
|
|
500
|
-
describe("when target branch doesn't exist", () => {
|
|
501
|
-
const getParams = (opts) => ({
|
|
502
|
-
options: {
|
|
503
|
-
interactive: true,
|
|
504
|
-
repoName: 'kibana',
|
|
505
|
-
repoOwner: 'elastic',
|
|
506
|
-
autoMerge: true,
|
|
507
|
-
backportBinary: 'node scripts/backport',
|
|
508
|
-
...opts,
|
|
509
|
-
},
|
|
510
|
-
pullNumber: 55,
|
|
511
|
-
backportResponse: {
|
|
512
|
-
status: 'success',
|
|
513
|
-
commits: [],
|
|
514
|
-
results: [
|
|
515
|
-
{
|
|
516
|
-
targetBranch: 'main',
|
|
517
|
-
status: 'handled-error',
|
|
518
|
-
error: new backport_error_1.BackportError('The branch "main" is invalid or doesn\'t exist'),
|
|
519
|
-
},
|
|
520
|
-
],
|
|
521
|
-
},
|
|
522
|
-
});
|
|
523
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
524
|
-
const params = getParams({
|
|
525
|
-
publishStatusCommentOnFailure: true,
|
|
526
|
-
});
|
|
527
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
528
|
-
"## 💔 All backports failed
|
|
529
|
-
|
|
530
|
-
| Status | Branch | Result |
|
|
531
|
-
|:------:|:------:|:------|
|
|
532
|
-
|❌|main|The branch "main" is invalid or doesn't exist|
|
|
533
|
-
|
|
534
|
-
### Manual backport
|
|
535
|
-
To create the backport manually run:
|
|
536
|
-
\`\`\`
|
|
537
|
-
node scripts/backport --pr 55
|
|
538
|
-
\`\`\`
|
|
539
|
-
|
|
540
|
-
### Questions ?
|
|
541
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
542
|
-
|
|
543
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
544
|
-
`);
|
|
545
|
-
});
|
|
546
|
-
it('does not post a comment when `publishStatusCommentOnFailure = false`', () => {
|
|
547
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
548
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
549
|
-
});
|
|
550
|
-
});
|
|
551
|
-
describe('when target branch is invalid', () => {
|
|
552
|
-
const getParams = (opts) => ({
|
|
553
|
-
options: {
|
|
554
|
-
interactive: true,
|
|
555
|
-
repoName: 'kibana',
|
|
556
|
-
repoOwner: 'elastic',
|
|
557
|
-
autoMerge: true,
|
|
558
|
-
backportBinary: 'node scripts/backport',
|
|
559
|
-
...opts,
|
|
560
|
-
},
|
|
561
|
-
pullNumber: 55,
|
|
562
|
-
backportResponse: {
|
|
563
|
-
status: 'success',
|
|
564
|
-
commits: [],
|
|
565
|
-
results: [
|
|
566
|
-
{
|
|
567
|
-
targetBranch: '--foo',
|
|
568
|
-
status: 'unhandled-error',
|
|
569
|
-
error: new backport_error_1.BackportError('The branch "--foo" does not exist'),
|
|
570
|
-
},
|
|
571
|
-
],
|
|
572
|
-
},
|
|
573
|
-
});
|
|
574
|
-
it('posts a comment when `publishStatusCommentOnFailure = true`', () => {
|
|
575
|
-
const params = getParams({
|
|
576
|
-
publishStatusCommentOnFailure: true,
|
|
577
|
-
});
|
|
578
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
579
|
-
"## 💔 All backports failed
|
|
580
|
-
|
|
581
|
-
| Status | Branch | Result |
|
|
582
|
-
|:------:|:------:|:------|
|
|
583
|
-
|❌|--foo|An unhandled error occurred. Please see the logs for details|
|
|
584
|
-
|
|
585
|
-
### Manual backport
|
|
586
|
-
To create the backport manually run:
|
|
587
|
-
\`\`\`
|
|
588
|
-
node scripts/backport --pr 55
|
|
589
|
-
\`\`\`
|
|
590
|
-
|
|
591
|
-
### Questions ?
|
|
592
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
593
|
-
|
|
594
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
595
|
-
`);
|
|
596
|
-
});
|
|
597
|
-
it('does not post a comment when `publishStatusCommentOnFailure = false`', () => {
|
|
598
|
-
const params = getParams({ publishStatusCommentOnFailure: false });
|
|
599
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toBe(undefined);
|
|
600
|
-
});
|
|
601
|
-
});
|
|
602
|
-
describe('shield.io badges', () => {
|
|
603
|
-
const getParams = (opts) => ({
|
|
604
|
-
options: {
|
|
605
|
-
interactive: true,
|
|
606
|
-
repoName: 'kibana',
|
|
607
|
-
repoOwner: 'elastic',
|
|
608
|
-
autoMerge: true,
|
|
609
|
-
backportBinary: 'node scripts/backport',
|
|
610
|
-
publishStatusCommentOnSuccess: true,
|
|
611
|
-
...opts,
|
|
612
|
-
},
|
|
613
|
-
pullNumber: 55,
|
|
614
|
-
backportResponse: {
|
|
615
|
-
status: 'success',
|
|
616
|
-
results: [
|
|
617
|
-
{
|
|
618
|
-
status: 'success',
|
|
619
|
-
targetBranch: '7.x',
|
|
620
|
-
pullRequestNumber: 55,
|
|
621
|
-
pullRequestUrl: 'url-to-pr',
|
|
622
|
-
},
|
|
623
|
-
],
|
|
624
|
-
},
|
|
625
|
-
});
|
|
626
|
-
it('posts a comment without shields.io badge when repo is private`', () => {
|
|
627
|
-
const params = getParams({ isRepoPrivate: true });
|
|
628
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).not.toContain('img.shields.io');
|
|
629
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
630
|
-
"## 💚 All backports created successfully
|
|
631
|
-
|
|
632
|
-
| Status | Branch | Result |
|
|
633
|
-
|:------:|:------:|:------|
|
|
634
|
-
|✅|7.x|url-to-pr|
|
|
635
|
-
|
|
636
|
-
Note: Successful backport PRs will be merged automatically after passing CI.
|
|
637
|
-
|
|
638
|
-
### Questions ?
|
|
639
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
640
|
-
|
|
641
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
642
|
-
`);
|
|
643
|
-
});
|
|
644
|
-
it('posts a comment with shields.io badge when repo is public`', () => {
|
|
645
|
-
const params = getParams({ isRepoPrivate: false });
|
|
646
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toContain('img.shields.io');
|
|
647
|
-
expect((0, create_status_comment_1.getCommentBody)(params)).toMatchInlineSnapshot(`
|
|
648
|
-
"## 💚 All backports created successfully
|
|
649
|
-
|
|
650
|
-
| Status | Branch | Result |
|
|
651
|
-
|:------:|:------:|:------|
|
|
652
|
-
|✅|7.x|[<img src="https://img.shields.io/github/pulls/detail/state/elastic/kibana/55">](url-to-pr)|
|
|
653
|
-
|
|
654
|
-
Note: Successful backport PRs will be merged automatically after passing CI.
|
|
655
|
-
|
|
656
|
-
### Questions ?
|
|
657
|
-
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
658
|
-
|
|
659
|
-
<!--- Backport version: 1.2.3-mocked -->"
|
|
660
|
-
`);
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
});
|
|
664
|
-
//# sourceMappingURL=create-status-comment.test.js.map
|