pr-merge-queue 0.0.0-stage → 0.0.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/LICENSE +201 -0
- package/README.md +125 -2
- package/dist/claim-pr/claim-pr.d.mts +45 -0
- package/dist/claim-pr/claim-pr.d.mts.map +1 -0
- package/dist/claim-pr/claim-pr.mjs +217 -0
- package/dist/claim-pr/claim-pr.mjs.map +1 -0
- package/dist/claim-pr/index.d.mts +2 -0
- package/dist/claim-pr/index.d.mts.map +1 -0
- package/dist/claim-pr/index.mjs +2 -0
- package/dist/claim-pr/index.mjs.map +1 -0
- package/dist/cmd/claim-pr.d.mts +3 -0
- package/dist/cmd/claim-pr.d.mts.map +1 -0
- package/dist/cmd/claim-pr.mjs +20 -0
- package/dist/cmd/claim-pr.mjs.map +1 -0
- package/dist/cmd/open-pr.d.mts +3 -0
- package/dist/cmd/open-pr.d.mts.map +1 -0
- package/dist/cmd/open-pr.mjs +20 -0
- package/dist/cmd/open-pr.mjs.map +1 -0
- package/dist/cmd/pr-report.d.mts +3 -0
- package/dist/cmd/pr-report.d.mts.map +1 -0
- package/dist/cmd/pr-report.mjs +20 -0
- package/dist/cmd/pr-report.mjs.map +1 -0
- package/dist/cmd/push-fixed-pr.d.mts +3 -0
- package/dist/cmd/push-fixed-pr.d.mts.map +1 -0
- package/dist/cmd/push-fixed-pr.mjs +20 -0
- package/dist/cmd/push-fixed-pr.mjs.map +1 -0
- package/dist/cmd/report-unowned-prs.d.mts +3 -0
- package/dist/cmd/report-unowned-prs.d.mts.map +1 -0
- package/dist/cmd/report-unowned-prs.mjs +20 -0
- package/dist/cmd/report-unowned-prs.mjs.map +1 -0
- package/dist/cmd/unblock-prs.d.mts +3 -0
- package/dist/cmd/unblock-prs.d.mts.map +1 -0
- package/dist/cmd/unblock-prs.mjs +19 -0
- package/dist/cmd/unblock-prs.mjs.map +1 -0
- package/dist/entry-point.d.mts +3 -0
- package/dist/entry-point.d.mts.map +1 -0
- package/dist/entry-point.mjs +3 -0
- package/dist/entry-point.mjs.map +1 -0
- package/dist/lib/cli-args.d.mts +27 -0
- package/dist/lib/cli-args.d.mts.map +1 -0
- package/dist/lib/cli-args.mjs +55 -0
- package/dist/lib/cli-args.mjs.map +1 -0
- package/dist/lib/github-api.d.mts +153 -0
- package/dist/lib/github-api.d.mts.map +1 -0
- package/dist/lib/github-api.mjs +291 -0
- package/dist/lib/github-api.mjs.map +1 -0
- package/dist/lib/index.d.mts +7 -0
- package/dist/lib/index.d.mts.map +1 -0
- package/dist/lib/index.mjs +7 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/json.d.mts +12 -0
- package/dist/lib/json.d.mts.map +1 -0
- package/dist/lib/json.mjs +28 -0
- package/dist/lib/json.mjs.map +1 -0
- package/dist/lib/log.d.mts +10 -0
- package/dist/lib/log.d.mts.map +1 -0
- package/dist/lib/log.mjs +13 -0
- package/dist/lib/log.mjs.map +1 -0
- package/dist/lib/shell.d.mts +18 -0
- package/dist/lib/shell.d.mts.map +1 -0
- package/dist/lib/shell.mjs +42 -0
- package/dist/lib/shell.mjs.map +1 -0
- package/dist/lib/time.d.mts +17 -0
- package/dist/lib/time.d.mts.map +1 -0
- package/dist/lib/time.mjs +35 -0
- package/dist/lib/time.mjs.map +1 -0
- package/dist/open-pr/github.d.mts +72 -0
- package/dist/open-pr/github.d.mts.map +1 -0
- package/dist/open-pr/github.mjs +249 -0
- package/dist/open-pr/github.mjs.map +1 -0
- package/dist/open-pr/index.d.mts +6 -0
- package/dist/open-pr/index.d.mts.map +1 -0
- package/dist/open-pr/index.mjs +6 -0
- package/dist/open-pr/index.mjs.map +1 -0
- package/dist/open-pr/main.d.mts +36 -0
- package/dist/open-pr/main.d.mts.map +1 -0
- package/dist/open-pr/main.mjs +204 -0
- package/dist/open-pr/main.mjs.map +1 -0
- package/dist/open-pr/options.d.mts +20 -0
- package/dist/open-pr/options.d.mts.map +1 -0
- package/dist/open-pr/options.mjs +66 -0
- package/dist/open-pr/options.mjs.map +1 -0
- package/dist/open-pr/steps.d.mts +23 -0
- package/dist/open-pr/steps.d.mts.map +1 -0
- package/dist/open-pr/steps.mjs +38 -0
- package/dist/open-pr/steps.mjs.map +1 -0
- package/dist/open-pr/types.d.mts +179 -0
- package/dist/open-pr/types.d.mts.map +1 -0
- package/dist/open-pr/types.mjs +20 -0
- package/dist/open-pr/types.mjs.map +1 -0
- package/dist/pr-report/github.d.mts +59 -0
- package/dist/pr-report/github.d.mts.map +1 -0
- package/dist/pr-report/github.mjs +561 -0
- package/dist/pr-report/github.mjs.map +1 -0
- package/dist/pr-report/index.d.mts +8 -0
- package/dist/pr-report/index.d.mts.map +1 -0
- package/dist/pr-report/index.mjs +8 -0
- package/dist/pr-report/index.mjs.map +1 -0
- package/dist/pr-report/linked-issues.d.mts +15 -0
- package/dist/pr-report/linked-issues.d.mts.map +1 -0
- package/dist/pr-report/linked-issues.mjs +39 -0
- package/dist/pr-report/linked-issues.mjs.map +1 -0
- package/dist/pr-report/main.d.mts +42 -0
- package/dist/pr-report/main.d.mts.map +1 -0
- package/dist/pr-report/main.mjs +163 -0
- package/dist/pr-report/main.mjs.map +1 -0
- package/dist/pr-report/options.d.mts +36 -0
- package/dist/pr-report/options.d.mts.map +1 -0
- package/dist/pr-report/options.mjs +90 -0
- package/dist/pr-report/options.mjs.map +1 -0
- package/dist/pr-report/queue.d.mts +28 -0
- package/dist/pr-report/queue.d.mts.map +1 -0
- package/dist/pr-report/queue.mjs +74 -0
- package/dist/pr-report/queue.mjs.map +1 -0
- package/dist/pr-report/render.d.mts +14 -0
- package/dist/pr-report/render.d.mts.map +1 -0
- package/dist/pr-report/render.mjs +318 -0
- package/dist/pr-report/render.mjs.map +1 -0
- package/dist/pr-report/repo-settings.d.mts +12 -0
- package/dist/pr-report/repo-settings.d.mts.map +1 -0
- package/dist/pr-report/repo-settings.mjs +22 -0
- package/dist/pr-report/repo-settings.mjs.map +1 -0
- package/dist/push-fixed-pr/index.d.mts +2 -0
- package/dist/push-fixed-pr/index.d.mts.map +1 -0
- package/dist/push-fixed-pr/index.mjs +2 -0
- package/dist/push-fixed-pr/index.mjs.map +1 -0
- package/dist/push-fixed-pr/push-fixed-pr.d.mts +54 -0
- package/dist/push-fixed-pr/push-fixed-pr.d.mts.map +1 -0
- package/dist/push-fixed-pr/push-fixed-pr.mjs +172 -0
- package/dist/push-fixed-pr/push-fixed-pr.mjs.map +1 -0
- package/dist/report-unowned-prs/index.d.mts +2 -0
- package/dist/report-unowned-prs/index.d.mts.map +1 -0
- package/dist/report-unowned-prs/index.mjs +2 -0
- package/dist/report-unowned-prs/index.mjs.map +1 -0
- package/dist/report-unowned-prs/report-unowned-prs.d.mts +49 -0
- package/dist/report-unowned-prs/report-unowned-prs.d.mts.map +1 -0
- package/dist/report-unowned-prs/report-unowned-prs.mjs +127 -0
- package/dist/report-unowned-prs/report-unowned-prs.mjs.map +1 -0
- package/dist/tsconfig.json +1 -0
- package/dist/unblock-prs/auto-fix.d.mts +45 -0
- package/dist/unblock-prs/auto-fix.d.mts.map +1 -0
- package/dist/unblock-prs/auto-fix.mjs +207 -0
- package/dist/unblock-prs/auto-fix.mjs.map +1 -0
- package/dist/unblock-prs/checks.d.mts +307 -0
- package/dist/unblock-prs/checks.d.mts.map +1 -0
- package/dist/unblock-prs/checks.mjs +372 -0
- package/dist/unblock-prs/checks.mjs.map +1 -0
- package/dist/unblock-prs/claims.d.mts +21 -0
- package/dist/unblock-prs/claims.d.mts.map +1 -0
- package/dist/unblock-prs/claims.mjs +23 -0
- package/dist/unblock-prs/claims.mjs.map +1 -0
- package/dist/unblock-prs/config.d.mts +487 -0
- package/dist/unblock-prs/config.d.mts.map +1 -0
- package/dist/unblock-prs/config.mjs +119 -0
- package/dist/unblock-prs/config.mjs.map +1 -0
- package/dist/unblock-prs/constants.d.mts +28 -0
- package/dist/unblock-prs/constants.d.mts.map +1 -0
- package/dist/unblock-prs/constants.mjs +28 -0
- package/dist/unblock-prs/constants.mjs.map +1 -0
- package/dist/unblock-prs/demotions.d.mts +42 -0
- package/dist/unblock-prs/demotions.d.mts.map +1 -0
- package/dist/unblock-prs/demotions.mjs +50 -0
- package/dist/unblock-prs/demotions.mjs.map +1 -0
- package/dist/unblock-prs/github.d.mts +739 -0
- package/dist/unblock-prs/github.d.mts.map +1 -0
- package/dist/unblock-prs/github.mjs +626 -0
- package/dist/unblock-prs/github.mjs.map +1 -0
- package/dist/unblock-prs/index.d.mts +25 -0
- package/dist/unblock-prs/index.d.mts.map +1 -0
- package/dist/unblock-prs/index.mjs +25 -0
- package/dist/unblock-prs/index.mjs.map +1 -0
- package/dist/unblock-prs/labels.d.mts +49 -0
- package/dist/unblock-prs/labels.d.mts.map +1 -0
- package/dist/unblock-prs/labels.mjs +49 -0
- package/dist/unblock-prs/labels.mjs.map +1 -0
- package/dist/unblock-prs/main.d.mts +179 -0
- package/dist/unblock-prs/main.d.mts.map +1 -0
- package/dist/unblock-prs/main.mjs +640 -0
- package/dist/unblock-prs/main.mjs.map +1 -0
- package/dist/unblock-prs/merge-after.d.mts +46 -0
- package/dist/unblock-prs/merge-after.d.mts.map +1 -0
- package/dist/unblock-prs/merge-after.mjs +65 -0
- package/dist/unblock-prs/merge-after.mjs.map +1 -0
- package/dist/unblock-prs/options.d.mts +35 -0
- package/dist/unblock-prs/options.d.mts.map +1 -0
- package/dist/unblock-prs/options.mjs +88 -0
- package/dist/unblock-prs/options.mjs.map +1 -0
- package/dist/unblock-prs/owner.d.mts +32 -0
- package/dist/unblock-prs/owner.d.mts.map +1 -0
- package/dist/unblock-prs/owner.mjs +63 -0
- package/dist/unblock-prs/owner.mjs.map +1 -0
- package/dist/unblock-prs/quiet.d.mts +21 -0
- package/dist/unblock-prs/quiet.d.mts.map +1 -0
- package/dist/unblock-prs/quiet.mjs +42 -0
- package/dist/unblock-prs/quiet.mjs.map +1 -0
- package/dist/unblock-prs/rebase.d.mts +120 -0
- package/dist/unblock-prs/rebase.d.mts.map +1 -0
- package/dist/unblock-prs/rebase.mjs +576 -0
- package/dist/unblock-prs/rebase.mjs.map +1 -0
- package/dist/unblock-prs/release.d.mts +62 -0
- package/dist/unblock-prs/release.d.mts.map +1 -0
- package/dist/unblock-prs/release.mjs +94 -0
- package/dist/unblock-prs/release.mjs.map +1 -0
- package/dist/unblock-prs/set-aside-comment.d.mts +20 -0
- package/dist/unblock-prs/set-aside-comment.d.mts.map +1 -0
- package/dist/unblock-prs/set-aside-comment.mjs +93 -0
- package/dist/unblock-prs/set-aside-comment.mjs.map +1 -0
- package/dist/unblock-prs/set-aside-detail.d.mts +41 -0
- package/dist/unblock-prs/set-aside-detail.d.mts.map +1 -0
- package/dist/unblock-prs/set-aside-detail.mjs +56 -0
- package/dist/unblock-prs/set-aside-detail.mjs.map +1 -0
- package/dist/unblock-prs/skips.d.mts +85 -0
- package/dist/unblock-prs/skips.d.mts.map +1 -0
- package/dist/unblock-prs/skips.mjs +141 -0
- package/dist/unblock-prs/skips.mjs.map +1 -0
- package/dist/unblock-prs/stack.d.mts +98 -0
- package/dist/unblock-prs/stack.d.mts.map +1 -0
- package/dist/unblock-prs/stack.mjs +141 -0
- package/dist/unblock-prs/stack.mjs.map +1 -0
- package/dist/unblock-prs/triage.d.mts +28 -0
- package/dist/unblock-prs/triage.d.mts.map +1 -0
- package/dist/unblock-prs/triage.mjs +396 -0
- package/dist/unblock-prs/triage.mjs.map +1 -0
- package/dist/unblock-prs/types.d.mts +793 -0
- package/dist/unblock-prs/types.d.mts.map +1 -0
- package/dist/unblock-prs/types.mjs +26 -0
- package/dist/unblock-prs/types.mjs.map +1 -0
- package/dist/unblock-prs/util.d.mts +23 -0
- package/dist/unblock-prs/util.d.mts.map +1 -0
- package/dist/unblock-prs/util.mjs +60 -0
- package/dist/unblock-prs/util.mjs.map +1 -0
- package/dist/unblock-prs/version-pr.d.mts +57 -0
- package/dist/unblock-prs/version-pr.d.mts.map +1 -0
- package/dist/unblock-prs/version-pr.mjs +79 -0
- package/dist/unblock-prs/version-pr.mjs.map +1 -0
- package/dist/unblock-prs/watch.d.mts +17 -0
- package/dist/unblock-prs/watch.d.mts.map +1 -0
- package/dist/unblock-prs/watch.mjs +128 -0
- package/dist/unblock-prs/watch.mjs.map +1 -0
- package/package.json +118 -3
- package/src/claim-pr/claim-pr.mts +380 -0
- package/src/claim-pr/claim-pr.test.mts +176 -0
- package/src/claim-pr/index.mts +1 -0
- package/src/cmd/claim-pr.mts +32 -0
- package/src/cmd/open-pr.mts +28 -0
- package/src/cmd/pr-report.mts +28 -0
- package/src/cmd/push-fixed-pr.mts +36 -0
- package/src/cmd/report-unowned-prs.mts +37 -0
- package/src/cmd/unblock-prs.mts +24 -0
- package/src/entry-point.mts +3 -0
- package/src/lib/cli-args.mts +86 -0
- package/src/lib/cli-args.test.mts +92 -0
- package/src/lib/github-api.mts +463 -0
- package/src/lib/github-api.test.mts +40 -0
- package/src/lib/index.mts +6 -0
- package/src/lib/json.mts +43 -0
- package/src/lib/json.test.mts +34 -0
- package/src/lib/log.mts +19 -0
- package/src/lib/log.test.mts +45 -0
- package/src/lib/shell.mts +52 -0
- package/src/lib/time.mts +49 -0
- package/src/open-pr/README.md +237 -0
- package/src/open-pr/github.mts +444 -0
- package/src/open-pr/index.mts +5 -0
- package/src/open-pr/main.mts +327 -0
- package/src/open-pr/options.mts +101 -0
- package/src/open-pr/options.test.mts +67 -0
- package/src/open-pr/steps.mts +57 -0
- package/src/open-pr/steps.test.mts +59 -0
- package/src/open-pr/types.mts +42 -0
- package/src/pr-report/README.md +244 -0
- package/src/pr-report/github.mts +911 -0
- package/src/pr-report/index.mts +7 -0
- package/src/pr-report/linked-issues.mts +51 -0
- package/src/pr-report/linked-issues.test.mts +65 -0
- package/src/pr-report/main.mts +257 -0
- package/src/pr-report/options.mts +140 -0
- package/src/pr-report/queue.mts +125 -0
- package/src/pr-report/render.mts +428 -0
- package/src/pr-report/render.test.mts +379 -0
- package/src/pr-report/repo-settings.mts +34 -0
- package/src/push-fixed-pr/index.mts +1 -0
- package/src/push-fixed-pr/push-fixed-pr.mts +276 -0
- package/src/push-fixed-pr/push-fixed-pr.test.mts +228 -0
- package/src/report-unowned-prs/index.mts +1 -0
- package/src/report-unowned-prs/report-unowned-prs.mts +190 -0
- package/src/report-unowned-prs/report-unowned-prs.test.mts +87 -0
- package/src/unblock-prs/README.md +1616 -0
- package/src/unblock-prs/auto-fix.mts +334 -0
- package/src/unblock-prs/auto-fix.test.mts +159 -0
- package/src/unblock-prs/checks.mts +538 -0
- package/src/unblock-prs/checks.test.mts +507 -0
- package/src/unblock-prs/claims.mts +33 -0
- package/src/unblock-prs/claims.test.mts +64 -0
- package/src/unblock-prs/config.mts +187 -0
- package/src/unblock-prs/config.schema.json +71 -0
- package/src/unblock-prs/config.test.mts +139 -0
- package/src/unblock-prs/constants.mts +33 -0
- package/src/unblock-prs/demotions.mts +73 -0
- package/src/unblock-prs/demotions.test.mts +100 -0
- package/src/unblock-prs/github.mts +1042 -0
- package/src/unblock-prs/github.test.mts +84 -0
- package/src/unblock-prs/index.mts +24 -0
- package/src/unblock-prs/labels.mts +70 -0
- package/src/unblock-prs/main.mts +1051 -0
- package/src/unblock-prs/merge-after.mts +117 -0
- package/src/unblock-prs/merge-after.test.mts +120 -0
- package/src/unblock-prs/options.mts +157 -0
- package/src/unblock-prs/owner.mts +91 -0
- package/src/unblock-prs/owner.test.mts +114 -0
- package/src/unblock-prs/quiet.mts +62 -0
- package/src/unblock-prs/quiet.test.mts +175 -0
- package/src/unblock-prs/rebase.mts +962 -0
- package/src/unblock-prs/release.mts +149 -0
- package/src/unblock-prs/release.test.mts +209 -0
- package/src/unblock-prs/set-aside-comment.mts +143 -0
- package/src/unblock-prs/set-aside-comment.test.mts +148 -0
- package/src/unblock-prs/set-aside-detail.mts +82 -0
- package/src/unblock-prs/set-aside-detail.test.mts +131 -0
- package/src/unblock-prs/skips.mts +215 -0
- package/src/unblock-prs/skips.test.mts +280 -0
- package/src/unblock-prs/stack.mts +220 -0
- package/src/unblock-prs/stack.test.mts +449 -0
- package/src/unblock-prs/triage.mts +669 -0
- package/src/unblock-prs/triage.test.mts +100 -0
- package/src/unblock-prs/types.mts +358 -0
- package/src/unblock-prs/util.mts +78 -0
- package/src/unblock-prs/util.test.mts +26 -0
- package/src/unblock-prs/version-pr.mts +112 -0
- package/src/unblock-prs/version-pr.test.mts +78 -0
- package/src/unblock-prs/watch.mts +219 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `pr-merge-queue`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A merge queue run by labels and `Merge-After:` trailers, as command-line
|
|
4
|
+
tools: open a pull request into the queue, land the queued ones one at a time,
|
|
5
|
+
and report where every open one stands. What the queue decides is
|
|
6
|
+
[`pr-report-core`](../pr-report-core/README.md); this package reads GitHub,
|
|
7
|
+
runs git and acts on it.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm add --save-dev pr-merge-queue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The commands read the repository from `origin` in the current directory and
|
|
14
|
+
authenticate with `GH_TOKEN` or `GITHUB_TOKEN`, falling back to `gh auth token`
|
|
15
|
+
when neither is set.
|
|
16
|
+
|
|
17
|
+
| command | what it does |
|
|
18
|
+
| :------------------- | :--------------------------------------------------------------------------------- |
|
|
19
|
+
| `open-pr` | pushes the current branch and opens its pull request, held by `skip-ci` |
|
|
20
|
+
| `unblock-prs` | lands the `merge-queued` pull requests one at a time, in the order they declare |
|
|
21
|
+
| `pr-report` | reports every open pull request: merge order, required checks, how far behind |
|
|
22
|
+
| `claim-pr` | claims a pull request `unblock-prs` set aside, so that nothing else touches it |
|
|
23
|
+
| `push-fixed-pr` | pushes the fix to a pull request you claimed and hands it back to the queue |
|
|
24
|
+
| `report-unowned-prs` | files an issue for each queued pull request that everyone is waiting on others for |
|
|
25
|
+
|
|
26
|
+
Each one prints its options with `--help`. How the queue reads a pull request
|
|
27
|
+
(the labels, `Merge-After:`, stacks) and what `unblock-prs` does at each step
|
|
28
|
+
are in [`src/unblock-prs/README.md`](./src/unblock-prs/README.md);
|
|
29
|
+
`open-pr` and `pr-report` have their own in
|
|
30
|
+
[`src/open-pr/README.md`](./src/open-pr/README.md) and
|
|
31
|
+
[`src/pr-report/README.md`](./src/pr-report/README.md).
|
|
32
|
+
|
|
33
|
+
## Setting up a repository
|
|
34
|
+
|
|
35
|
+
### What the repository needs
|
|
36
|
+
|
|
37
|
+
- **Labels.** `merge-queued` (queue this pull request), `skip-ci` (run no
|
|
38
|
+
checks on it yet) and `auto-rebase` (keep it on the default branch while it
|
|
39
|
+
waits). `blocks-release` is needed only with a changesets version pull
|
|
40
|
+
request: the release waits for every open pull request carrying it.
|
|
41
|
+
`priority:high` and `priority:low` order the queue and are optional.
|
|
42
|
+
- **Merging.** Squash merging and auto-merge allowed in the repository's
|
|
43
|
+
settings, and a ruleset (or branch protection rule) on the default branch
|
|
44
|
+
that requires status checks with "Require branches to be up to date before
|
|
45
|
+
merging". The queue rebases each pull request onto the tip, arms its
|
|
46
|
+
auto-merge, and lets GitHub merge it once those checks pass; it never
|
|
47
|
+
merges by itself.
|
|
48
|
+
- **Workflows that `skip-ci` holds.** Every workflow that runs a check skips
|
|
49
|
+
its jobs while the pull request carries `skip-ci`
|
|
50
|
+
(`!contains(github.event.pull_request.labels.*.name, 'skip-ci')`) and
|
|
51
|
+
triggers on `labeled` and `unlabeled`, so taking the label off is what
|
|
52
|
+
starts them. A skipped job satisfies a required check, so something has to
|
|
53
|
+
hold the merge while the label is on: a required commit status that is
|
|
54
|
+
`pending` while the label is there, as this repository's
|
|
55
|
+
[`skip-ci-label.yml`](https://github.com/noshiro-pf/mono/blob/main/.github/workflows/skip-ci-label.yml) writes.
|
|
56
|
+
- **A token** whose account can push to the repository, label and comment on
|
|
57
|
+
pull requests, file issues and re-run workflows, in `GH_TOKEN` or
|
|
58
|
+
`GITHUB_TOKEN` (or `gh auth token`). `unblock-prs` arms auto-merge through
|
|
59
|
+
GitHub's GraphQL API, so run it where that is reachable.
|
|
60
|
+
- **Optionally, `.github/unblock-prs.json`**, which tells `unblock-prs`
|
|
61
|
+
which failing checks it may fix by itself, and how: the commands that
|
|
62
|
+
regenerate or reformat what a check found stale, run and pushed without a
|
|
63
|
+
person. Its schema is
|
|
64
|
+
[`src/unblock-prs/config.schema.json`](./src/unblock-prs/config.schema.json).
|
|
65
|
+
Without it, every failing check is set aside for the skill or a person.
|
|
66
|
+
|
|
67
|
+
The checks a pull request has to pass are what GitHub's rules require on the
|
|
68
|
+
default branch, or what `repo-settings/rulesets/main.json` declares where a
|
|
69
|
+
repository keeps its rulesets as code.
|
|
70
|
+
|
|
71
|
+
### How a pull request goes through
|
|
72
|
+
|
|
73
|
+
1. **`open-pr`** pushes the branch and opens the pull request ready for
|
|
74
|
+
review, with `skip-ci` and `auto-rebase` on. `--base <branch>` stacks it
|
|
75
|
+
on another open pull request; `--merge-after <n>` writes `Merge-After: #n`
|
|
76
|
+
into the description. While `skip-ci` is on, the checks you ran locally
|
|
77
|
+
are the only ones it gets, so say in the description which.
|
|
78
|
+
2. **`merge-queued`**, added by whoever decides it is ready, queues it.
|
|
79
|
+
3. **`unblock-prs`**, left running, picks one queued pull request at a time
|
|
80
|
+
in the declared order: rebases it onto the tip, arms auto-merge, takes
|
|
81
|
+
`skip-ci` off so the checks run once, and watches them. GitHub merges it
|
|
82
|
+
when they pass. A failure it cannot fix by itself — or a rebase that
|
|
83
|
+
conflicts — is **set aside** with a comment saying why, and the queue
|
|
84
|
+
moves on.
|
|
85
|
+
4. **The skill** (below) or a person fixes what was set aside: `claim-pr`
|
|
86
|
+
first, then `push-fixed-pr`, which hands it back to the queue.
|
|
87
|
+
|
|
88
|
+
[GitHub Pull Requests Manager](https://noshiro-pf.github.io/mono/pr-manager/)
|
|
89
|
+
shows all of it on one page, on any repository that has a `merge-queued`
|
|
90
|
+
label: the queue in its order, what was set aside and why, who claimed what,
|
|
91
|
+
and whose turn each pull request is. `pr-report --format json` prints the same
|
|
92
|
+
in a terminal.
|
|
93
|
+
|
|
94
|
+
## The Claude Code plugin
|
|
95
|
+
|
|
96
|
+
`unblock-prs` sets aside what it cannot land by itself — a failing check, a
|
|
97
|
+
rebase that conflicted — for the `unblock-prs` skill to fix. The skill ships as
|
|
98
|
+
a Claude Code plugin from this repository's marketplace:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
/plugin marketplace add noshiro-pf/mono
|
|
102
|
+
/plugin install pr-merge-queue@noshiro-pf
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Then run `/pr-merge-queue:unblock-prs` beside the worker, or under `/loop`.
|
|
106
|
+
The skill reads the repository's own instructions first, and
|
|
107
|
+
`.github/unblock-prs.md` if there is one: how its checks are reproduced, and
|
|
108
|
+
which branches it generates rather than writes. The plugin's version is the
|
|
109
|
+
package's, so the skill matches the commands of the same version.
|
|
110
|
+
|
|
111
|
+
## As a library
|
|
112
|
+
|
|
113
|
+
What the commands share is exported too, for scripts that talk to the same
|
|
114
|
+
repository the same way.
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
import { sh } from 'pr-merge-queue';
|
|
118
|
+
|
|
119
|
+
// Every branch name and path the commands hand to git is quoted for a
|
|
120
|
+
// POSIX shell, a single quote included.
|
|
121
|
+
assert.strictEqual(sh("it's"), String.raw`'it'\''s'`);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
Apache-2.0
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type QueueComments, type QueueOwner } from 'pr-report-core';
|
|
2
|
+
import { Result } from 'ts-data-forge';
|
|
3
|
+
/** What `claim-pr --help` prints. */
|
|
4
|
+
export declare const CLAIM_PR_HELP: string;
|
|
5
|
+
/**
|
|
6
|
+
* Claims a pull request `unblock-prs` set aside, before fixing it, so that the
|
|
7
|
+
* script and every other session leave it alone meanwhile
|
|
8
|
+
* (`pr-report-core`'s `claim.mts` says what a claim is and how long it lasts).
|
|
9
|
+
*
|
|
10
|
+
* ```sh
|
|
11
|
+
* claim-pr 2154 --by <session URL> # claim, or renew
|
|
12
|
+
* claim-pr 2154 --by <session URL> --release # give it up
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* A claim is refused for a pull request whose owner (`pr-report-core`'s
|
|
16
|
+
* `queue-owner.mts`, read through `pr-report/queue.mts` as every other
|
|
17
|
+
* command reads it) is not a skill — the worker is about to act on it, or a
|
|
18
|
+
* person has to — and for one someone else holds. A push to the branch ends the claim by itself;
|
|
19
|
+
* `--release` is for giving up without one. It prints what it did, and exits
|
|
20
|
+
* 1 when it did not get the claim.
|
|
21
|
+
*
|
|
22
|
+
* It writes as the token's account, which has to be the one `unblock-prs`
|
|
23
|
+
* runs as: both trust only comments their own account wrote.
|
|
24
|
+
*/
|
|
25
|
+
export declare const claimPr: (args: ClaimArgs) => Promise<Result<string, string>>;
|
|
26
|
+
/**
|
|
27
|
+
* What to do about a claim by `by`, given who owns the pull request and what
|
|
28
|
+
* its comments say now: write it (over `commentId` when there is one to edit
|
|
29
|
+
* in place), or refuse and why.
|
|
30
|
+
*/
|
|
31
|
+
export declare const decideClaim: (owner: QueueOwner | undefined, queue: QueueComments, by: string) => Readonly<{
|
|
32
|
+
kind: 'write';
|
|
33
|
+
commentId: number | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'refuse';
|
|
36
|
+
reason: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** The command line, or what is wrong with it. */
|
|
39
|
+
export declare const parseClaimArgs: (args: readonly string[]) => ClaimArgs | string;
|
|
40
|
+
export type ClaimArgs = Readonly<{
|
|
41
|
+
number: number;
|
|
42
|
+
by: string;
|
|
43
|
+
release: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
//# sourceMappingURL=claim-pr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-pr.d.mts","sourceRoot":"","sources":["../../src/claim-pr/claim-pr.mts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAO,MAAM,EAAE,MAAM,eAAe,CAAC;AAc5C,qCAAqC;AACrC,eAAO,MAAM,aAAa,QAcd,CAAC;AAEb;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,SACZ,SAAS,KACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,UACf,UAAU,GAAG,SAAS,SACtB,aAAa,MAChB,MAAM,KACT,QAAQ,CACP;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA0BrC,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,cAAc,SAAU,SAAS,MAAM,EAAE,KAAG,SAAS,GAAG,MAuBpE,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { CLAIM_LIFETIME_MINUTES, isClaimant, readQueueComments, writeClaimComment, writeReleasedClaimComment, } from 'pr-report-core';
|
|
2
|
+
import { Arr, Result } from 'ts-data-forge';
|
|
3
|
+
import * as t from 'ts-fortress';
|
|
4
|
+
import { currentEpochMs, isoSeconds, pullRequestNumber, resolveRepo, resolveToken, rest, viewerLogin, } from '../lib/index.mjs';
|
|
5
|
+
import { readQueueState } from '../pr-report/index.mjs';
|
|
6
|
+
|
|
7
|
+
export const CLAIM_PR_HELP = [
|
|
8
|
+
'Usage: claim-pr <number> --by <claimant> [--release]',
|
|
9
|
+
'',
|
|
10
|
+
'Claims a pull request unblock-prs set aside, before fixing it, so that',
|
|
11
|
+
'unblock-prs and every other session leave it alone meanwhile. A push to',
|
|
12
|
+
'the branch ends the claim; --release gives it up without one.',
|
|
13
|
+
'',
|
|
14
|
+
'Options:',
|
|
15
|
+
' --by <claimant> who claims it: a session URL, or any word unique to you',
|
|
16
|
+
' --release give the claim up',
|
|
17
|
+
' -h, --help show this help',
|
|
18
|
+
'',
|
|
19
|
+
'It writes as the token (GH_TOKEN or GITHUB_TOKEN) account, which has to',
|
|
20
|
+
'be the one unblock-prs runs as.',
|
|
21
|
+
].join('\n');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export const claimPr = async (args) => {
|
|
43
|
+
const token = await resolveToken();
|
|
44
|
+
if (Result.isErr(token)) {
|
|
45
|
+
return token;
|
|
46
|
+
}
|
|
47
|
+
const repo = await resolveRepo();
|
|
48
|
+
if (Result.isErr(repo)) {
|
|
49
|
+
return repo;
|
|
50
|
+
}
|
|
51
|
+
const viewer = await viewerLogin(token.value);
|
|
52
|
+
if (Result.isErr(viewer)) {
|
|
53
|
+
return Result.err(`cannot read who the token is: ${viewer.value}`);
|
|
54
|
+
}
|
|
55
|
+
const context = { repo: repo.value, token: token.value };
|
|
56
|
+
const before = await readPullRequest(context, args.number, viewer.value);
|
|
57
|
+
return Result.isErr(before)
|
|
58
|
+
? before
|
|
59
|
+
: args.release
|
|
60
|
+
? release(context, args, before.value)
|
|
61
|
+
: claim(context, args, viewer.value, before.value);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export const decideClaim = (owner, queue, by) => {
|
|
69
|
+
if (owner?.owner !== 'skill') {
|
|
70
|
+
return {
|
|
71
|
+
kind: 'refuse',
|
|
72
|
+
reason: owner === undefined
|
|
73
|
+
? 'who owns it could not be read'
|
|
74
|
+
: `it is the ${owner.owner}'s (${owner.reason}), not a skill's`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const held = queue.claim;
|
|
78
|
+
if (held?.applies === true &&
|
|
79
|
+
held.says.kind === 'standing' &&
|
|
80
|
+
held.says.claim.by !== by) {
|
|
81
|
+
return {
|
|
82
|
+
kind: 'refuse',
|
|
83
|
+
reason: `${held.says.claim.by} claimed it at ${held.says.claim.at}`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return { kind: 'write', commentId: held?.commentId };
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const parseClaimArgs = (args) => {
|
|
90
|
+
const byAt = args.indexOf('--by');
|
|
91
|
+
const by = byAt === -1 ? undefined : args[byAt + 1];
|
|
92
|
+
const positional = args.filter((arg, index) => arg !== '--' &&
|
|
93
|
+
arg !== '--release' &&
|
|
94
|
+
(byAt === -1 || (index !== byAt && index !== byAt + 1)));
|
|
95
|
+
const [first] = positional;
|
|
96
|
+
const number = first === undefined ? undefined : pullRequestNumber(first);
|
|
97
|
+
return positional.length > 1
|
|
98
|
+
? `unexpected argument: ${Arr.tail(positional).join(' ')}`
|
|
99
|
+
: number === undefined
|
|
100
|
+
? 'name the pull request by its number'
|
|
101
|
+
: by === undefined || !isClaimant(by)
|
|
102
|
+
? '--by names the claimant: a session URL, or any other word unique to you'
|
|
103
|
+
: { number, by, release: args.includes('--release') };
|
|
104
|
+
};
|
|
105
|
+
const claim = async (context, args, viewer, before) => {
|
|
106
|
+
const state = await readQueueState();
|
|
107
|
+
if (Result.isErr(state)) {
|
|
108
|
+
return Result.err(`cannot read the queue: ${state.value}`);
|
|
109
|
+
}
|
|
110
|
+
const decided = decideClaim(state.value.owners.get(args.number), before.queue, args.by);
|
|
111
|
+
if (decided.kind === 'refuse') {
|
|
112
|
+
return Result.err(`#${args.number} not claimed: ${decided.reason}.`);
|
|
113
|
+
}
|
|
114
|
+
const atEpochMs = currentEpochMs();
|
|
115
|
+
const reason = before.queue.setAside?.says.kind === 'standing'
|
|
116
|
+
? before.queue.setAside.says.setAside.reason
|
|
117
|
+
: 'set aside';
|
|
118
|
+
const written = await writeComment(context, args.number, decided.commentId, writeClaimComment({ headSha: before.headSha, by: args.by, at: isoSeconds(atEpochMs) }, [
|
|
119
|
+
`Being fixed by ${args.by}, after \`unblock-prs\` set it aside (\`${reason}\`).`,
|
|
120
|
+
`\`unblock-prs\` and other sessions leave it alone until the branch is pushed, or until ${isoSeconds(atEpochMs + CLAIM_LIFETIME_MINUTES * 60_000)}.`,
|
|
121
|
+
].join(' ')));
|
|
122
|
+
if (Result.isErr(written)) {
|
|
123
|
+
return written;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
await new Promise((resolve) => {
|
|
129
|
+
setTimeout(resolve, READ_BACK_DELAY_MS);
|
|
130
|
+
});
|
|
131
|
+
const after = await readPullRequest(context, args.number, viewer);
|
|
132
|
+
if (Result.isErr(after)) {
|
|
133
|
+
return after;
|
|
134
|
+
}
|
|
135
|
+
const held = after.value.queue.claim;
|
|
136
|
+
return held?.applies === true &&
|
|
137
|
+
held.says.kind === 'standing' &&
|
|
138
|
+
held.says.claim.by === args.by
|
|
139
|
+
? Result.ok(`#${args.number} claimed by ${args.by} at ${before.headSha}, until it is pushed or ${isoSeconds(atEpochMs + CLAIM_LIFETIME_MINUTES * 60_000)}.`)
|
|
140
|
+
: Result.err(`#${args.number} not claimed: ${held?.says.kind === 'standing' ? `${held.says.claim.by} claimed it at the same time` : 'the claim did not read back'}.`);
|
|
141
|
+
};
|
|
142
|
+
const release = async (context, args, before) => {
|
|
143
|
+
const held = before.queue.claim;
|
|
144
|
+
if (held?.says.kind !== 'standing' || held.says.claim.by !== args.by) {
|
|
145
|
+
return Result.ok(`#${args.number}: ${args.by} holds no claim on it.`);
|
|
146
|
+
}
|
|
147
|
+
const written = await writeComment(context, args.number, held.commentId, writeReleasedClaimComment(`${args.by} gave up the claim; \`unblock-prs\` and other sessions may take it up again.`));
|
|
148
|
+
return Result.isErr(written)
|
|
149
|
+
? written
|
|
150
|
+
: Result.ok(`#${args.number}: claim released.`);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
const readPullRequest = async (context, number, viewer) => {
|
|
157
|
+
const pr = await rest(context, 'GET', `/pulls/${number}`, PullRequestSchema);
|
|
158
|
+
if (Result.isErr(pr)) {
|
|
159
|
+
return Result.err(`cannot read #${number}: ${pr.value}`);
|
|
160
|
+
}
|
|
161
|
+
if (pr.value.state !== 'open') {
|
|
162
|
+
return Result.err(`#${number} is ${pr.value.state}.`);
|
|
163
|
+
}
|
|
164
|
+
const repo = await rest(context, 'GET', '', RepositorySchema);
|
|
165
|
+
if (Result.isErr(repo)) {
|
|
166
|
+
return repo;
|
|
167
|
+
}
|
|
168
|
+
const tip = await rest(context, 'GET', `/git/ref/heads/${repo.value.default_branch}`, RefSchema);
|
|
169
|
+
if (Result.isErr(tip)) {
|
|
170
|
+
return tip;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
const comments = await rest(context, 'GET', `/issues/${number}/comments`, CommentListSchema, { query: { per_page: '100' } });
|
|
175
|
+
if (Result.isErr(comments)) {
|
|
176
|
+
return comments;
|
|
177
|
+
}
|
|
178
|
+
return Result.ok({
|
|
179
|
+
headSha: pr.value.head.sha,
|
|
180
|
+
queue: readQueueComments(Arr.generate(function* () {
|
|
181
|
+
for (const { id, body, user } of comments.value) {
|
|
182
|
+
if (user?.login === viewer) {
|
|
183
|
+
yield { id, body: body ?? '' };
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}), {
|
|
187
|
+
headSha: pr.value.head.sha,
|
|
188
|
+
baseTip: tip.value.object.sha,
|
|
189
|
+
nowEpochMs: currentEpochMs(),
|
|
190
|
+
}),
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
const writeComment = async (context, number, commentId, body) => {
|
|
194
|
+
const written = commentId === undefined
|
|
195
|
+
? await rest(context, 'POST', `/issues/${number}/comments`, CommentSchema, {
|
|
196
|
+
body: { body },
|
|
197
|
+
})
|
|
198
|
+
: await rest(context, 'PATCH', `/issues/comments/${commentId}`, CommentSchema, { body: { body } });
|
|
199
|
+
return Result.isErr(written)
|
|
200
|
+
? Result.err(`cannot write the claim on #${number}: ${written.value}`)
|
|
201
|
+
: Result.ok(undefined);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const READ_BACK_DELAY_MS = 3000;
|
|
205
|
+
const PullRequestSchema = t.record({
|
|
206
|
+
state: t.string(),
|
|
207
|
+
head: t.record({ sha: t.string() }),
|
|
208
|
+
});
|
|
209
|
+
const RepositorySchema = t.record({ default_branch: t.string() });
|
|
210
|
+
const RefSchema = t.record({ object: t.record({ sha: t.string() }) });
|
|
211
|
+
const CommentSchema = t.record({
|
|
212
|
+
id: t.number(),
|
|
213
|
+
body: t.union([t.string(), t.nullType]),
|
|
214
|
+
user: t.union([t.record({ login: t.string() }), t.nullType]),
|
|
215
|
+
});
|
|
216
|
+
const CommentListSchema = t.array(CommentSchema);
|
|
217
|
+
//# sourceMapp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MAAM,EAAE,EAAE,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAElE,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AAEtE,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/claim-pr/index.mts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/claim-pr/index.mts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-pr.d.mts","sourceRoot":"","sources":["../../src/cmd/claim-pr.mts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Arr, Result, unknownToString } from 'ts-data-forge';
|
|
3
|
+
import { CLAIM_PR_HELP, claimPr, parseClaimArgs } from '../claim-pr/index.mjs';
|
|
4
|
+
const argv = Arr.skip(process.argv, 2);
|
|
5
|
+
if (argv.includes('--help') || argv.includes('-h')) {
|
|
6
|
+
console.info(CLAIM_PR_HELP);
|
|
7
|
+
process.exit(0);
|
|
8
|
+
}
|
|
9
|
+
const args = parseClaimArgs(argv);
|
|
10
|
+
if (typeof args === 'string') {
|
|
11
|
+
console.error(`${args}\n\n${CLAIM_PR_HELP}`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const result = await claimPr(args).catch((error) => Result.err(unknownToString(error)));
|
|
15
|
+
if (Result.isErr(result)) {
|
|
16
|
+
console.error(result.value);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
console.info(result.value);
|
|
20
|
+
//# sourceMappingURL=claim-pr.mjs.map
|