@link-assistant/hive-mind 1.22.0 → 1.22.2
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/CHANGELOG.md +38 -0
- package/package.json +1 -1
- package/src/config.lib.mjs +5 -0
- package/src/github-merge.lib.mjs +15 -3
- package/src/telegram-merge-queue.lib.mjs +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.22.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5b018dc: fix: prevent CI/CD release blocking by enabling cancel-in-progress for main branch (Issue #1274)
|
|
8
|
+
|
|
9
|
+
When multiple commits are pushed to main quickly (e.g., multiple PRs merged in succession),
|
|
10
|
+
the old concurrency configuration would queue newer runs indefinitely until older runs complete.
|
|
11
|
+
This caused releases to be blocked when Docker ARM64 builds took too long.
|
|
12
|
+
|
|
13
|
+
Changes:
|
|
14
|
+
- Add `cancel-in-progress: true` for main branch to allow newer releases to proceed
|
|
15
|
+
- PR branches still queue runs to avoid cancelling checks during development
|
|
16
|
+
- Document the issue and solution in docs/case-studies/issue-1274/
|
|
17
|
+
|
|
18
|
+
## 1.22.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- fix: add --merge flag to gh pr merge command to prevent "not running interactively" error (Issue #1269)
|
|
23
|
+
|
|
24
|
+
The merge queue was stuck because `gh pr merge` requires an explicit merge method flag
|
|
25
|
+
(`--merge`, `--squash`, or `--rebase`) when running in a non-interactive context.
|
|
26
|
+
Without a merge method, the command would fail with:
|
|
27
|
+
"--merge, --rebase, or --squash required when not running interactively"
|
|
28
|
+
|
|
29
|
+
This fix:
|
|
30
|
+
- Adds `--merge` flag by default to the `mergePullRequest()` function
|
|
31
|
+
- Adds `mergeMethod` option to configure the merge strategy ('merge', 'squash', 'rebase')
|
|
32
|
+
- Adds `HIVE_MIND_MERGE_QUEUE_MERGE_METHOD` environment variable for configuration
|
|
33
|
+
|
|
34
|
+
Fix release notes to show ALL related pull requests when multiple PRs are merged before a release (Issue #1271)
|
|
35
|
+
- Extract ALL commit hashes from changelog entry (not just the first one)
|
|
36
|
+
- Look up PRs for each commit hash via GitHub API
|
|
37
|
+
- Display all unique PR numbers in release notes (e.g., "Related Pull Requests: #1268, #1270")
|
|
38
|
+
- Use plural "Pull Requests" label when multiple PRs are found
|
|
39
|
+
- Add comprehensive case study documentation in docs/case-studies/issue-1271/
|
|
40
|
+
|
|
3
41
|
## 1.22.0
|
|
4
42
|
|
|
5
43
|
### Minor Changes
|
package/package.json
CHANGED
package/src/config.lib.mjs
CHANGED
|
@@ -396,6 +396,7 @@ export const version = {
|
|
|
396
396
|
|
|
397
397
|
// Merge queue configurations
|
|
398
398
|
// See: https://github.com/link-assistant/hive-mind/issues/1143
|
|
399
|
+
// See: https://github.com/link-assistant/hive-mind/issues/1269
|
|
399
400
|
export const mergeQueue = {
|
|
400
401
|
// Maximum PRs to process in one merge session
|
|
401
402
|
// Default: 10 PRs per session
|
|
@@ -409,6 +410,10 @@ export const mergeQueue = {
|
|
|
409
410
|
// Wait time after merge before processing next PR
|
|
410
411
|
// Default: 1 minute (60000ms) - allows CI to stabilize
|
|
411
412
|
postMergeWaitMs: parseIntWithDefault('HIVE_MIND_MERGE_QUEUE_POST_MERGE_WAIT_MS', 60 * 1000),
|
|
413
|
+
// Default merge method: 'merge', 'squash', or 'rebase'
|
|
414
|
+
// Issue #1269: gh pr merge requires explicit method when running non-interactively
|
|
415
|
+
// Default: 'merge' - creates a merge commit
|
|
416
|
+
mergeMethod: getenv('HIVE_MIND_MERGE_QUEUE_MERGE_METHOD', 'merge'),
|
|
412
417
|
};
|
|
413
418
|
|
|
414
419
|
// Helper function to validate configuration values
|
package/src/github-merge.lib.mjs
CHANGED
|
@@ -439,19 +439,31 @@ export async function checkPRMergeable(owner, repo, prNumber, verbose = false) {
|
|
|
439
439
|
* @param {string} repo - Repository name
|
|
440
440
|
* @param {number} prNumber - Pull request number
|
|
441
441
|
* @param {Object} options - Merge options
|
|
442
|
-
* @param {
|
|
442
|
+
* @param {string} options.mergeMethod - Merge method: 'merge', 'squash', or 'rebase' (default: 'merge')
|
|
443
|
+
* Note: Must specify one method when running non-interactively.
|
|
444
|
+
* See Issue #1269 for details.
|
|
445
|
+
* @param {boolean} options.squash - DEPRECATED: Use mergeMethod: 'squash' instead
|
|
443
446
|
* @param {boolean} options.deleteAfter - Whether to delete branch after merge (default: false)
|
|
444
447
|
* @param {boolean} verbose - Whether to log verbose output
|
|
445
448
|
* @returns {Promise<{success: boolean, error: string|null}>}
|
|
446
449
|
*/
|
|
447
450
|
export async function mergePullRequest(owner, repo, prNumber, options = {}, verbose = false) {
|
|
448
|
-
const { squash = false, deleteAfter = false } = options;
|
|
451
|
+
const { mergeMethod = 'merge', squash = false, deleteAfter = false } = options;
|
|
449
452
|
|
|
450
453
|
try {
|
|
451
454
|
let mergeArgs = `--repo ${owner}/${repo}`;
|
|
452
|
-
|
|
455
|
+
|
|
456
|
+
// Issue #1269: gh pr merge requires --merge, --squash, or --rebase when running non-interactively
|
|
457
|
+
// We must always specify a merge method to prevent the command from hanging or failing
|
|
458
|
+
if (squash || mergeMethod === 'squash') {
|
|
453
459
|
mergeArgs += ' --squash';
|
|
460
|
+
} else if (mergeMethod === 'rebase') {
|
|
461
|
+
mergeArgs += ' --rebase';
|
|
462
|
+
} else {
|
|
463
|
+
// Default to --merge for standard merge commits
|
|
464
|
+
mergeArgs += ' --merge';
|
|
454
465
|
}
|
|
466
|
+
|
|
455
467
|
if (deleteAfter) {
|
|
456
468
|
mergeArgs += ' --delete-branch';
|
|
457
469
|
}
|
|
@@ -55,6 +55,7 @@ export const MergeItemStatus = {
|
|
|
55
55
|
* - HIVE_MIND_MERGE_QUEUE_CI_POLL_INTERVAL_MS: CI polling interval (default: 300000 = 5 minutes)
|
|
56
56
|
* - HIVE_MIND_MERGE_QUEUE_CI_TIMEOUT_MS: CI timeout (default: 1800000 = 30 minutes)
|
|
57
57
|
* - HIVE_MIND_MERGE_QUEUE_POST_MERGE_WAIT_MS: Post-merge wait (default: 10000 = 10 seconds)
|
|
58
|
+
* - HIVE_MIND_MERGE_QUEUE_MERGE_METHOD: Merge method (default: 'merge', options: 'merge', 'squash', 'rebase')
|
|
58
59
|
*/
|
|
59
60
|
export const MERGE_QUEUE_CONFIG = {
|
|
60
61
|
// CI/CD wait settings - check every 5 minutes per issue #1143 feedback
|
|
@@ -69,6 +70,10 @@ export const MERGE_QUEUE_CONFIG = {
|
|
|
69
70
|
|
|
70
71
|
// Maximum PRs to process in one session (configurable, default 10)
|
|
71
72
|
MAX_PRS_PER_SESSION: mergeQueueConfig.maxPrsPerSession,
|
|
73
|
+
|
|
74
|
+
// Merge method: 'merge', 'squash', or 'rebase' (Issue #1269)
|
|
75
|
+
// gh pr merge requires explicit method when running non-interactively
|
|
76
|
+
MERGE_METHOD: mergeQueueConfig.mergeMethod,
|
|
72
77
|
};
|
|
73
78
|
|
|
74
79
|
/**
|
|
@@ -339,8 +344,9 @@ export class MergeQueueProcessor {
|
|
|
339
344
|
}
|
|
340
345
|
|
|
341
346
|
// Step 4: Merge the PR
|
|
347
|
+
// Issue #1269: Pass the configured merge method to prevent "not running interactively" error
|
|
342
348
|
item.status = MergeItemStatus.MERGING;
|
|
343
|
-
const mergeResult = await mergePullRequest(this.owner, this.repo, item.pr.number, {}, this.verbose);
|
|
349
|
+
const mergeResult = await mergePullRequest(this.owner, this.repo, item.pr.number, { mergeMethod: MERGE_QUEUE_CONFIG.MERGE_METHOD }, this.verbose);
|
|
344
350
|
|
|
345
351
|
if (!mergeResult.success) {
|
|
346
352
|
item.status = MergeItemStatus.FAILED;
|