@eldrforge/kodrdriv 0.0.27 → 0.0.29

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.
@@ -1,31 +1,30 @@
1
- **🔧 Task Definition**
2
1
 
3
- You are analyzing review notes about a software project. Your task is to extract specific, actionable issues that can be addressed by the development team.
2
+ ## 🔧 Task Definition
4
3
 
5
- The content contains:
4
+ You are analyzing notes, discussions, or reviews about a software project. Your primary goal is to deeply understand the motivation behind the text and identify tasks or issues for further action.
6
5
 
7
- * **\[Review Notes]** — Feedback that may include observations, criticisms, suggestions, or general commentary about the project.
8
- * **\[User Context]** **IMPORTANT**: Critical background information about the project including recent commits, diffs, release notes, and open GitHub issues. This context is essential for understanding the current state of the project and providing informed analysis.
6
+ These can include:
7
+ - Explicit tasks or clearly defined issues.
8
+ - Tasks that explore, clarify, or further investigate concepts and requirements.
9
+ - Issues to improve understanding or refine ideas mentioned in the text.
9
10
 
10
11
  ---
11
12
 
12
- ## 🎯 OUTPUT REQUIREMENTS
13
+ ## 📌 OUTPUT REQUIREMENTS
13
14
 
14
- ### CRITICAL: JSON Format Required
15
-
16
- You **MUST** respond with valid JSON in this exact format:
15
+ Respond with valid JSON in this exact format:
17
16
 
18
17
  ```json
19
18
  {
20
- "summary": "Brief overview of the review session",
19
+ "summary": "Brief overview highlighting key themes and motivations identified",
21
20
  "totalIssues": number,
22
21
  "issues": [
23
22
  {
24
- "title": "Short descriptive title",
25
- "description": "Detailed description of the issue",
23
+ "title": "Concise descriptive title",
24
+ "description": "Detailed explanation of the issue or exploratory task, including context from the notes",
26
25
  "priority": "low|medium|high",
27
- "category": "ui|content|functionality|accessibility|performance|other",
28
- "suggestions": ["actionable suggestion 1", "actionable suggestion 2"]
26
+ "category": "ui|content|functionality|security|accessibility|performance|investigation|other",
27
+ "suggestions": ["Specific next step 1", "Specific next step 2"]
29
28
  }
30
29
  ]
31
30
  }
@@ -33,93 +32,61 @@ You **MUST** respond with valid JSON in this exact format:
33
32
 
34
33
  ---
35
34
 
36
- ## 📋 CATEGORIZATION GUIDE
35
+ ## 📋 Categories Guide
37
36
 
38
- ### Categories:
39
- * **ui** — Visual design, layout, styling issues
40
- * **content** — Text, copy, documentation issues
41
- * **functionality** — Features, behavior, logic issues
42
- * **accessibility** — Usability, accessibility concerns
43
- * **performance** — Speed, optimization issues
44
- * **other** — Any other type of issue
37
+ Include a category explicitly for exploration:
45
38
 
46
- ### Priorities:
47
- * **high** — Critical issues that significantly impact user experience
48
- * **medium** — Important issues that should be addressed soon
49
- * **low** — Minor issues or improvements
39
+ - **investigation** — Tasks intended to clarify, explore, or investigate ideas or requirements further.
40
+ - **ui** — Visual design, layout, styling issues
41
+ - **content** — Text, copy, documentation issues
42
+ - **functionality** — Features, behavior, logic issues
43
+ - **security** — Issues related to security practices or vulnerabilities
44
+ - **accessibility** — Usability, accessibility concerns
45
+ - **performance** — Speed, optimization issues
46
+ - **other** — Any other type of issue
50
47
 
51
48
  ---
52
49
 
53
- ## ⚠️ IMPORTANT: Using Review Notes and User Context
54
-
55
- **CRITICAL APPROACH:**
56
-
57
- * **Review Notes** This is the PRIMARY source you should use to extract issues. The feedback provided here should generate actionable items.
58
- * **User Context** **ESSENTIAL for informed analysis**: This provides crucial background information that you MUST consider when analyzing the review notes. Use this context to:
59
- - Understand the current state of the project
60
- - Avoid duplicating existing known issues
61
- - Provide more accurate prioritization
62
- - Suggest solutions that align with recent development work
63
- - Understand the broader project goals and constraints
64
-
65
- **If the review notes are empty, blank, or contain no actionable feedback:**
66
- * Return `"totalIssues": 0` and `"issues": []`
67
- * Do NOT generate issues from context alone when no review feedback is provided
68
-
69
- **Important Philosophy:**
70
- * **If someone took the time to provide a review, there's likely something valuable in it**
71
- * **Err on the side of inclusion** — capture suggestions, comments, and observations as issues
72
- * **Even subjective feedback can be valuable** — preferences and opinions often highlight real user experience concerns
73
- * **Transform general commentary into actionable items** where possible
74
-
75
- **Handling Detailed/Lengthy Feedback:**
76
- * **Long transcripts and reviews are gold mines** — if someone recorded a 10-minute note or wrote extensive feedback, there's substantial value to capture
77
- * **Don't just summarize — dive deep** — extract the full richness of detailed feedback into comprehensive issue descriptions
78
- * **Capture context, reasoning, and nuances** — lengthy feedback often contains important context about why something matters
79
- * **Break down complex feedback** — one long review might generate multiple detailed issues covering different aspects
80
- * **Preserve the reviewer's voice** — maintain the specific language and examples they provided when possible
81
-
82
- **Avoiding Duplicate Issues:**
83
- * **CRITICALLY IMPORTANT**: If the User Context includes open GitHub issues, review them carefully
84
- * Do NOT create new issues for problems that are already documented in existing issues
85
- * Only create issues for NEW problems mentioned in the review notes that are not already covered
86
- * If a review issue is similar to an existing one but has new details, you may create it but note the relationship
87
- * Use the User Context to understand what work is already planned or in progress
50
+ ## 🚨 Important Philosophy
51
+
52
+ - **If the reviewer mentioned it, there's likely value.**
53
+ - **Be inclusive:** Even subtle suggestions, questions, or ideas should be transformed into investigative tasks if no explicit action is immediately obvious.
54
+ - **Infer tasks:** If the reviewer hints at an area needing further thought or clarity, explicitly create an investigative task around it.
55
+ - **Balance exploratory and explicit tasks:** Capture both clearly actionable issues and important exploratory discussions.
88
56
 
89
57
  ---
90
58
 
91
- ## ✅ DO:
59
+ ## ✅ **DO:**
92
60
 
93
- * **Extract ALL meaningful feedback** from the review notes, including suggestions and comments
94
- * **Leverage User Context** to provide informed analysis and avoid duplicates
95
- * **Transform general observations into actionable items** whenever possible
96
- * **Capture subjective preferences** as low-priority issues when they could improve user experience
97
- * **Use appropriate categories and priorities** based on impact and context
98
- * **Include suggestions, comments, and observations** as valid issues
99
- * **Provide clear, implementable suggestions** for fixes that consider the current project state
100
- * **Include enough detail** in descriptions for developers to understand the issue
61
+ - Capture subtle or implicit feedback as actionable investigative tasks.
62
+ - Clearly articulate why an exploratory issue might need investigation.
63
+ - Prioritize based on potential impact to security, usability, or functionality.
101
64
 
102
- ## ❌ DO NOT:
65
+ ## ❌ **DO NOT:**
103
66
 
104
- * Dismiss feedback as too vague without attempting to make it actionable
105
- * Ignore suggestions or comments that could be valuable improvements
106
- * ❌ Create issues for problems already documented in existing GitHub issues
107
- * ❌ Ignore the User Context when analyzing review notes
108
- * ❌ Use any format other than the required JSON structure
67
+ - Skip feedback because it's vague—create a clarification or exploration issue instead.
68
+ - Limit yourself to explicitly defined tasks—embrace nuance.
109
69
 
110
70
  ---
111
71
 
112
- ## 🎯 Focus Areas
72
+ ## 🎯 **Focus on Understanding Motivation:**
113
73
 
114
- Prioritize feedback that relates to:
74
+ - Explicitly attempt to identify **why** the reviewer raised particular points.
75
+ - Derive actionable investigative tasks directly from these inferred motivations.
76
+ - Clearly articulate the intent behind these exploratory tasks.
77
+
78
+ ---
115
79
 
116
- * User experience problems and suggestions
117
- * Functional issues or bugs
118
- * Accessibility concerns
119
- * Performance problems
120
- * Content clarity or accuracy
121
- * Visual design issues and improvements
122
- * General suggestions for enhancement
123
- * Subjective preferences that could improve usability
80
+ ## ⚠️ **IMPORTANT: Using User Context**
81
+
82
+ - **User Context is ESSENTIAL for informed analysis:**
83
+ Use this context to:
84
+ - Understand the current state of the project.
85
+ - Avoid duplicating existing known issues.
86
+ - Provide accurate prioritization.
87
+ - Suggest solutions aligned with recent development.
88
+ - Understand broader project goals and constraints.
89
+
90
+ ---
124
91
 
125
- Remember: Your goal is to help the development team understand what specific actions they can take to improve the project based on ALL the review feedback, informed by the current project context. **If someone provided feedback, there's likely something worth capturing as an issue.**
92
+ **Your goal** is to comprehensively transform the reviewer's observations, comments, and implicit ideas into clearly defined issues, including exploratory or investigative tasks where explicit direction is absent.
package/dist/types.js CHANGED
@@ -72,13 +72,23 @@ const ConfigSchema = z.object({
72
72
  unlinkWorkspacePackages: z.boolean().optional(),
73
73
  checksTimeout: z.number().optional(),
74
74
  skipUserConfirmation: z.boolean().optional(),
75
- sendit: z.boolean().optional()
75
+ sendit: z.boolean().optional(),
76
+ waitForReleaseWorkflows: z.boolean().optional(),
77
+ releaseWorkflowsTimeout: z.number().optional(),
78
+ releaseWorkflowNames: z.array(z.string()).optional()
76
79
  }).optional(),
77
80
  link: z.object({
78
81
  scopeRoots: z.record(z.string(), z.string()).optional(),
79
82
  workspaceFile: z.string().optional(),
80
83
  dryRun: z.boolean().optional()
81
84
  }).optional(),
85
+ publishTree: z.object({
86
+ directory: z.string().optional(),
87
+ excludedPatterns: z.array(z.string()).optional(),
88
+ startFrom: z.string().optional(),
89
+ script: z.string().optional(),
90
+ publish: z.boolean().optional()
91
+ }).optional(),
82
92
  excludedPatterns: z.array(z.string()).optional()
83
93
  });
84
94
  z.object({
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n outputDirectory: z.string().optional(),\n preferencesDirectory: z.string().optional(),\n commit: z.object({\n add: z.boolean().optional(),\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n direction: z.string().optional(),\n }).optional(),\n audioCommit: z.object({\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n focus: z.string().optional(),\n }).optional(),\n review: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n note: z.string().optional(),\n }).optional(),\n audioReview: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n directory: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n publish: z.object({\n mergeMethod: z.enum(['merge', 'squash', 'rebase']).optional(),\n dependencyUpdatePatterns: z.array(z.string()).optional(),\n requiredEnvVars: z.array(z.string()).optional(),\n linkWorkspacePackages: z.boolean().optional(),\n unlinkWorkspacePackages: z.boolean().optional(),\n checksTimeout: z.number().optional(),\n skipUserConfirmation: z.boolean().optional(),\n sendit: z.boolean().optional(),\n }).optional(),\n link: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n workspaceFile: z.string().optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n\nexport type MergeMethod = 'merge' | 'squash' | 'rebase';\n\nexport interface PullRequest {\n html_url: string;\n number: number;\n labels: {\n name: string;\n }[];\n}\n\nexport type ReleaseSummary = {\n title: string;\n body: string;\n}\n\nexport type ReleaseConfig = {\n from?: string;\n to?: string;\n context?: string;\n focus?: string;\n}\n\nexport type ReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n note?: string;\n}\n\nexport type AudioReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n directory?: string;\n keepTemp?: boolean;\n}\n\nexport type AudioCommitConfig = {\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n keepTemp?: boolean;\n}\n\nexport type PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","model","string","contextDirectories","array","outputDirectory","preferencesDirectory","commit","add","cached","sendit","messageLimit","number","context","direction","audioCommit","maxRecordingTime","audioDevice","file","keepTemp","release","from","to","focus","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","note","audioReview","directory","publish","mergeMethod","enum","dependencyUpdatePatterns","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","checksTimeout","skipUserConfirmation","link","scopeRoots","record","workspaceFile","excludedPatterns","openaiApiKey","commandName"],"mappings":";;AAGO,MAAMA,YAAAA,GAAeC,CAAAA,CAAEC,MAAM,CAAC;IACjCC,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC5BC,OAAAA,EAASL,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC7BE,KAAAA,EAAON,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC3BG,SAAAA,EAAWP,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ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vCwD,YAAAA,EAAczD,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACrC,CAAA;AAEmCJ,CAAAA,CAAEC,MAAM,CAAC;IACxCyD,WAAAA,EAAa1D,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACpC,CAAA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n outputDirectory: z.string().optional(),\n preferencesDirectory: z.string().optional(),\n commit: z.object({\n add: z.boolean().optional(),\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n direction: z.string().optional(),\n }).optional(),\n audioCommit: z.object({\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n focus: z.string().optional(),\n }).optional(),\n review: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n note: z.string().optional(),\n }).optional(),\n audioReview: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n directory: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n publish: z.object({\n mergeMethod: z.enum(['merge', 'squash', 'rebase']).optional(),\n dependencyUpdatePatterns: z.array(z.string()).optional(),\n requiredEnvVars: z.array(z.string()).optional(),\n linkWorkspacePackages: z.boolean().optional(),\n unlinkWorkspacePackages: z.boolean().optional(),\n checksTimeout: z.number().optional(),\n skipUserConfirmation: z.boolean().optional(),\n sendit: z.boolean().optional(),\n waitForReleaseWorkflows: z.boolean().optional(),\n releaseWorkflowsTimeout: z.number().optional(),\n releaseWorkflowNames: z.array(z.string()).optional(),\n }).optional(),\n link: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n workspaceFile: z.string().optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n publishTree: z.object({\n directory: z.string().optional(),\n excludedPatterns: z.array(z.string()).optional(),\n startFrom: z.string().optional(),\n script: z.string().optional(),\n publish: z.boolean().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n\nexport type MergeMethod = 'merge' | 'squash' | 'rebase';\n\nexport interface PullRequest {\n html_url: string;\n number: number;\n labels: {\n name: string;\n }[];\n}\n\nexport type ReleaseSummary = {\n title: string;\n body: string;\n}\n\nexport type ReleaseConfig = {\n from?: string;\n to?: string;\n context?: string;\n focus?: string;\n}\n\nexport type ReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n note?: string;\n}\n\nexport type AudioReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n directory?: string;\n keepTemp?: boolean;\n}\n\nexport type AudioCommitConfig = {\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n keepTemp?: boolean;\n}\n\nexport type PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","model","string","contextDirectories","array","outputDirectory","preferencesDirectory","commit","add","cached","sendit","messageLimit","number","context","direction","audioCommit","maxRecordingTime","audioDevice","file","keepTemp","release","from","to","focus","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","note","audioReview","directory","publish","mergeMethod","enum","dependencyUpdatePatterns","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","checksTimeout","skipUserConfirmation","waitForReleaseWorkflows","releaseWorkflowsTimeout","releaseWorkflowNames","link","scopeRoots","record","workspaceFile","publishTree","excludedPatterns","startFrom","script","openaiApiKey","commandName"],"mappings":";;AAGO,MAAMA,YAAAA,GAAeC,CAAAA,CAAEC,MAAM,CAAC;IACjCC,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC5BC,OAAAA,EAASL,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC7BE,KAAAA,EAAON,CAAAA,CAAEG,OAAO,EA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AAA,CAAIL,QAAQ,EAAA;QACrDsD,aAAAA,EAAe1D,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;QAClCF,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ;AAChC,KAAA,CAAA,CAAGA,QAAQ,EAAA;IACXuD,WAAAA,EAAa3D,CAAAA,CAAEC,MAAM,CAAC;QAClByC,SAAAA,EAAW1C,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;AAC9BwD,QAAAA,gBAAAA,EAAkB5D,EAAEW,KAAK,CAACX,CAAAA,CAAES,MAAM,IAAIL,QAAQ,EAAA;QAC9CyD,SAAAA,EAAW7D,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;QAC9B0D,MAAAA,EAAQ9D,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;QAC3BuC,OAAAA,EAAS3C,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ;AACjC,KAAA,CAAA,CAAGA,QAAQ,EAAA;AACXwD,IAAAA,gBAAAA,EAAkB5D,EAAEW,KAAK,CAACX,CAAAA,CAAES,MAAM,IAAIL,QAAQ;AAClD,CAAA;AAEkCJ,CAAAA,CAAEC,MAAM,CAAC;IACvC8D,YAAAA,EAAc/D,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACrC,CAAA;AAEmCJ,CAAAA,CAAEC,MAAM,CAAC;IACxC+D,WAAAA,EAAahE,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACpC,CAAA;;;;"}
@@ -268,6 +268,140 @@ const createIssue = async (title, body, labels)=>{
268
268
  html_url: response.data.html_url
269
269
  };
270
270
  };
271
+ const getWorkflowRunsTriggeredByRelease = async (tagName, workflowNames)=>{
272
+ const octokit = getOctokit();
273
+ const { owner, repo } = await getRepoDetails();
274
+ const logger = getLogger();
275
+ try {
276
+ logger.debug(`Fetching workflow runs triggered by release ${tagName}...`);
277
+ // Get all workflows
278
+ const workflowsResponse = await octokit.actions.listRepoWorkflows({
279
+ owner,
280
+ repo
281
+ });
282
+ const relevantWorkflows = workflowsResponse.data.workflows.filter((workflow)=>{
283
+ // If specific workflow names are provided, only include those
284
+ if (workflowNames && workflowNames.length > 0) {
285
+ return workflowNames.includes(workflow.name);
286
+ }
287
+ // Otherwise, find workflows that trigger on releases
288
+ return true; // We'll filter by event later when we get the runs
289
+ });
290
+ logger.debug(`Found ${relevantWorkflows.length} workflows to check`);
291
+ const allRuns = [];
292
+ // Get recent workflow runs for each workflow
293
+ for (const workflow of relevantWorkflows){
294
+ try {
295
+ const runsResponse = await octokit.actions.listWorkflowRuns({
296
+ owner,
297
+ repo,
298
+ workflow_id: workflow.id,
299
+ per_page: 10
300
+ });
301
+ // Filter runs that were triggered by our release
302
+ const releaseRuns = runsResponse.data.workflow_runs.filter((run)=>{
303
+ // Check if the run was triggered by a release event and matches our tag
304
+ return run.event === 'release' && run.head_sha && run.created_at;
305
+ });
306
+ allRuns.push(...releaseRuns);
307
+ } catch (error) {
308
+ logger.warn(`Failed to get runs for workflow ${workflow.name}: ${error.message}`);
309
+ }
310
+ }
311
+ // Sort by creation time (newest first) and take the most recent ones
312
+ allRuns.sort((a, b)=>new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
313
+ logger.debug(`Found ${allRuns.length} workflow runs triggered by release events`);
314
+ return allRuns;
315
+ } catch (error) {
316
+ logger.warn(`Failed to fetch workflow runs: ${error.message}`);
317
+ return [];
318
+ }
319
+ };
320
+ const waitForReleaseWorkflows = async (tagName, options = {})=>{
321
+ const logger = getLogger();
322
+ const timeout = options.timeout || 600000; // 10 minutes default
323
+ const skipUserConfirmation = options.skipUserConfirmation || false;
324
+ logger.info(`Waiting for workflows triggered by release ${tagName}...`);
325
+ // Wait a bit for workflows to start (GitHub can take a moment to trigger them)
326
+ logger.debug('Waiting 30 seconds for workflows to start...');
327
+ await delay(30000);
328
+ const startTime = Date.now();
329
+ let workflowRuns = [];
330
+ let consecutiveNoWorkflowsCount = 0;
331
+ const maxConsecutiveNoWorkflows = 6; // 1 minute of checking before asking user
332
+ while(true){
333
+ const elapsedTime = Date.now() - startTime;
334
+ // Check for timeout
335
+ if (elapsedTime > timeout) {
336
+ logger.warn(`Timeout reached (${timeout / 1000}s) while waiting for release workflows.`);
337
+ if (!skipUserConfirmation) {
338
+ const proceedWithoutWorkflows = await promptConfirmation(`⚠️ Timeout reached while waiting for release workflows for ${tagName}.\n` + `This might indicate that no workflows are configured to trigger on releases.\n` + `Do you want to proceed anyway?`);
339
+ if (proceedWithoutWorkflows) {
340
+ logger.info('User chose to proceed without waiting for release workflows.');
341
+ return;
342
+ } else {
343
+ throw new Error(`Timeout waiting for release workflows for ${tagName}. User chose not to proceed.`);
344
+ }
345
+ } else {
346
+ throw new Error(`Timeout waiting for release workflows for ${tagName} (${timeout / 1000}s)`);
347
+ }
348
+ }
349
+ // Get current workflow runs
350
+ workflowRuns = await getWorkflowRunsTriggeredByRelease(tagName, options.workflowNames);
351
+ if (workflowRuns.length === 0) {
352
+ consecutiveNoWorkflowsCount++;
353
+ logger.info(`No release workflows found (${consecutiveNoWorkflowsCount}/${maxConsecutiveNoWorkflows}). Waiting...`);
354
+ // After several attempts with no workflows, ask user if they want to continue
355
+ if (consecutiveNoWorkflowsCount >= maxConsecutiveNoWorkflows) {
356
+ logger.warn(`No workflows triggered by release ${tagName} after ${maxConsecutiveNoWorkflows} attempts.`);
357
+ if (!skipUserConfirmation) {
358
+ const proceedWithoutWorkflows = await promptConfirmation(`⚠️ No GitHub Actions workflows appear to be triggered by the release ${tagName}.\n` + `This might be expected if no workflows are configured for release events.\n` + `Do you want to proceed without waiting for workflows?`);
359
+ if (proceedWithoutWorkflows) {
360
+ logger.info('User chose to proceed without release workflows.');
361
+ return;
362
+ } else {
363
+ throw new Error(`No release workflows found for ${tagName}. User chose not to proceed.`);
364
+ }
365
+ } else {
366
+ // In non-interactive mode, proceed if no workflows are found
367
+ logger.info('No release workflows found, proceeding.');
368
+ return;
369
+ }
370
+ }
371
+ await delay(10000);
372
+ continue;
373
+ }
374
+ // Reset counter since we found workflows
375
+ consecutiveNoWorkflowsCount = 0;
376
+ // Check status of all workflow runs
377
+ const failingRuns = workflowRuns.filter((run)=>run.conclusion && [
378
+ 'failure',
379
+ 'timed_out',
380
+ 'cancelled'
381
+ ].includes(run.conclusion));
382
+ if (failingRuns.length > 0) {
383
+ logger.error(`Release workflows for ${tagName} have failures:`);
384
+ for (const run of failingRuns){
385
+ logger.error(`- ${run.name}: ${run.conclusion} (${run.html_url})`);
386
+ }
387
+ throw new Error(`Release workflows for ${tagName} failed.`);
388
+ }
389
+ const allWorkflowsCompleted = workflowRuns.every((run)=>run.status === 'completed');
390
+ if (allWorkflowsCompleted) {
391
+ const successfulRuns = workflowRuns.filter((run)=>run.conclusion === 'success');
392
+ logger.info(`All ${workflowRuns.length} release workflows for ${tagName} completed successfully.`);
393
+ for (const run of successfulRuns){
394
+ logger.info(`✓ ${run.name}: ${run.conclusion}`);
395
+ }
396
+ return;
397
+ }
398
+ const completedCount = workflowRuns.filter((run)=>run.status === 'completed').length;
399
+ const runningCount = workflowRuns.filter((run)=>run.status === 'in_progress').length;
400
+ const queuedCount = workflowRuns.filter((run)=>run.status === 'queued').length;
401
+ logger.info(`Release workflows for ${tagName}: ${completedCount} completed, ${runningCount} running, ${queuedCount} queued (${workflowRuns.length} total)`);
402
+ await delay(15000); // wait 15 seconds
403
+ }
404
+ };
271
405
 
272
- export { createIssue, createPullRequest, createRelease, findOpenPullRequestByHeadRef, getCurrentBranchName, getOctokit, getOpenIssues, getRepoDetails, mergePullRequest, waitForPullRequestChecks };
406
+ export { createIssue, createPullRequest, createRelease, findOpenPullRequestByHeadRef, getCurrentBranchName, getOctokit, getOpenIssues, getRepoDetails, getWorkflowRunsTriggeredByRelease, mergePullRequest, waitForPullRequestChecks, waitForReleaseWorkflows };
273
407
  //# sourceMappingURL=github.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"github.js","sources":["../../src/util/github.ts"],"sourcesContent":["import { Octokit } from '@octokit/rest';\nimport { getLogger } from '../logging';\nimport { PullRequest, MergeMethod } from '../types';\nimport { run } from './child';\nimport { promptConfirmation } from './stdin';\n\nexport const getOctokit = (): Octokit => {\n const logger = getLogger();\n const token = process.env.GITHUB_TOKEN;\n\n if (!token) {\n logger.error('GITHUB_TOKEN environment variable is not set.');\n throw new Error('GITHUB_TOKEN is not set.');\n }\n\n return new Octokit({\n auth: token,\n });\n};\n\nexport const getCurrentBranchName = async (): Promise<string> => {\n const { stdout } = await run('git rev-parse --abbrev-ref HEAD');\n return stdout.trim();\n};\n\nexport const getRepoDetails = async (): Promise<{ owner: string; repo: string }> => {\n const { stdout } = await run('git remote get-url origin');\n const url = stdout.trim();\n // git@github.com:owner/repo.git or https://github.com/owner/repo.git\n const match = url.match(/github\\.com[/:]([\\w-]+)\\/([\\w.-]+)\\.git/);\n if (!match) {\n throw new Error(`Could not parse repository owner and name from origin URL: \"${url}\". Expected format: git@github.com:owner/repo.git or https://github.com/owner/repo.git`);\n }\n return { owner: match[1], repo: match[2] };\n};\n\nexport const createPullRequest = async (\n title: string,\n body: string,\n head: string,\n base: string = 'main'\n): Promise<PullRequest> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n const response = await octokit.pulls.create({\n owner,\n repo,\n title,\n body,\n head,\n base,\n });\n\n return response.data;\n};\n\nexport const findOpenPullRequestByHeadRef = async (head: string): Promise<PullRequest | null> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n try {\n logger.debug(`Searching for open pull requests with head: ${owner}:${head} in ${owner}/${repo}`);\n\n const response = await octokit.pulls.list({\n owner,\n repo,\n state: 'open',\n head: `${owner}:${head}`,\n });\n\n logger.debug(`Found ${response.data.length} open pull requests`);\n return response.data[0] ?? null;\n } catch (error: any) {\n logger.error(`Failed to find open pull requests: ${error.message}`);\n if (error.status === 404) {\n logger.error(`Repository ${owner}/${repo} not found or access denied. Please check your GITHUB_TOKEN permissions.`);\n }\n throw error;\n }\n};\n\nconst delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));\n\n// Check if repository has GitHub Actions workflows configured\nconst hasWorkflowsConfigured = async (): Promise<boolean> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n try {\n const response = await octokit.actions.listRepoWorkflows({\n owner,\n repo,\n });\n\n return response.data.workflows.length > 0;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error: any) {\n // If we can't check workflows (e.g., no Actions permission), assume they might exist\n return true;\n }\n};\n\nexport const waitForPullRequestChecks = async (prNumber: number, options: { timeout?: number; skipUserConfirmation?: boolean } = {}): Promise<void> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n const timeout = options.timeout || 300000; // 5 minutes default timeout\n const skipUserConfirmation = options.skipUserConfirmation || false;\n\n const startTime = Date.now();\n let consecutiveNoChecksCount = 0;\n const maxConsecutiveNoChecks = 6; // 6 consecutive checks (1 minute) with no checks before asking user\n\n while (true) {\n const elapsedTime = Date.now() - startTime;\n\n // Check for timeout\n if (elapsedTime > timeout) {\n logger.warn(`Timeout reached (${timeout / 1000}s) while waiting for PR #${prNumber} checks.`);\n\n if (!skipUserConfirmation) {\n const proceedWithoutChecks = await promptConfirmation(\n `⚠️ Timeout reached while waiting for PR #${prNumber} checks.\\n` +\n `This might indicate that no checks are configured for this repository.\\n` +\n `Do you want to proceed with merging the PR without waiting for checks?`\n );\n\n if (proceedWithoutChecks) {\n logger.info('User chose to proceed without waiting for checks.');\n return;\n } else {\n throw new Error(`Timeout waiting for PR #${prNumber} checks. User chose not to proceed.`);\n }\n } else {\n throw new Error(`Timeout waiting for PR #${prNumber} checks (${timeout / 1000}s)`);\n }\n }\n\n const pr = await octokit.pulls.get({\n owner,\n repo,\n pull_number: prNumber,\n });\n\n const checkRunsResponse = await octokit.checks.listForRef({\n owner,\n repo,\n ref: pr.data.head.sha,\n });\n\n const checkRuns = checkRunsResponse.data.check_runs;\n\n if (checkRuns.length === 0) {\n consecutiveNoChecksCount++;\n logger.info(`PR #${prNumber}: No checks found (${consecutiveNoChecksCount}/${maxConsecutiveNoChecks}). Waiting...`);\n\n // After several consecutive \"no checks\" responses, check if workflows are configured\n if (consecutiveNoChecksCount >= maxConsecutiveNoChecks) {\n logger.info(`No checks detected for ${maxConsecutiveNoChecks} consecutive attempts. Checking repository configuration...`);\n\n const hasWorkflows = await hasWorkflowsConfigured();\n\n if (!hasWorkflows) {\n logger.warn(`No GitHub Actions workflows found in repository ${owner}/${repo}.`);\n\n if (!skipUserConfirmation) {\n const proceedWithoutChecks = await promptConfirmation(\n `⚠️ No GitHub Actions workflows or checks are configured for this repository.\\n` +\n `PR #${prNumber} will never have status checks to wait for.\\n` +\n `Do you want to proceed with merging the PR without checks?`\n );\n\n if (proceedWithoutChecks) {\n logger.info('User chose to proceed without checks (no workflows configured).');\n return;\n } else {\n throw new Error(`No checks configured for PR #${prNumber}. User chose not to proceed.`);\n }\n } else {\n // In non-interactive mode, proceed if no workflows are configured\n logger.info('No workflows configured, proceeding without checks.');\n return;\n }\n } else {\n logger.info('GitHub Actions workflows are configured. Continuing to wait for checks...');\n consecutiveNoChecksCount = 0; // Reset counter since workflows exist\n }\n }\n\n await delay(10000);\n continue;\n }\n\n // Reset the no-checks counter since we found some checks\n consecutiveNoChecksCount = 0;\n\n const failingChecks = checkRuns.filter(\n (cr) => cr.conclusion && ['failure', 'timed_out', 'cancelled'].includes(cr.conclusion)\n );\n\n if (failingChecks.length > 0) {\n logger.error(`PR #${prNumber} has failing checks:`);\n for (const check of failingChecks) {\n logger.error(`- ${check.name}: ${check.conclusion}`);\n }\n throw new Error(`PR #${prNumber} checks failed.`);\n }\n\n const allChecksCompleted = checkRuns.every((cr) => cr.status === 'completed');\n\n if (allChecksCompleted) {\n logger.info(`All checks for PR #${prNumber} have completed successfully.`);\n return;\n }\n\n const completedCount = checkRuns.filter(cr => cr.status === 'completed').length;\n logger.info(`PR #${prNumber} checks: ${completedCount}/${checkRuns.length} completed. Waiting...`);\n\n await delay(10000); // wait 10 seconds\n }\n};\n\nexport const mergePullRequest = async (prNumber: number, mergeMethod: MergeMethod = 'squash'): Promise<void> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n logger.info(`Merging PR #${prNumber} using ${mergeMethod} method...`);\n const pr = await octokit.pulls.get({\n owner,\n repo,\n pull_number: prNumber,\n });\n const headBranch = pr.data.head.ref;\n\n await octokit.pulls.merge({\n owner,\n repo,\n pull_number: prNumber,\n merge_method: mergeMethod,\n });\n logger.info(`PR #${prNumber} merged using ${mergeMethod} method.`);\n\n logger.info(`Deleting branch ${headBranch}...`);\n await octokit.git.deleteRef({\n owner,\n repo,\n ref: `heads/${headBranch}`,\n });\n logger.info(`Branch ${headBranch} deleted.`);\n};\n\nexport const createRelease = async (tagName: string, title: string, notes: string): Promise<void> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n logger.info(`Creating release for tag ${tagName}...`);\n await octokit.repos.createRelease({\n owner,\n repo,\n tag_name: tagName,\n name: title,\n body: notes,\n });\n logger.info(`Release ${tagName} created.`);\n};\n\nexport const getOpenIssues = async (limit: number = 20): Promise<string> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n try {\n logger.debug(`Fetching up to ${limit} open GitHub issues...`);\n\n const response = await octokit.issues.listForRepo({\n owner,\n repo,\n state: 'open',\n per_page: Math.min(limit, 100), // GitHub API limit\n sort: 'updated',\n direction: 'desc',\n });\n\n const issues = response.data.filter(issue => !issue.pull_request); // Filter out PRs\n\n if (issues.length === 0) {\n logger.debug('No open issues found');\n return '';\n }\n\n const issueStrings = issues.slice(0, limit).map(issue => {\n const labels = issue.labels.map(label =>\n typeof label === 'string' ? label : label.name\n ).join(', ');\n\n return [\n `Issue #${issue.number}: ${issue.title}`,\n `Labels: ${labels || 'none'}`,\n `Created: ${issue.created_at}`,\n `Updated: ${issue.updated_at}`,\n `Body: ${issue.body?.substring(0, 500) || 'No description'}${issue.body && issue.body.length > 500 ? '...' : ''}`,\n '---'\n ].join('\\n');\n });\n\n logger.debug(`Fetched ${issues.length} open issues`);\n return issueStrings.join('\\n\\n');\n } catch (error: any) {\n logger.warn('Failed to fetch GitHub issues: %s', error.message);\n return '';\n }\n};\n\nexport const createIssue = async (\n title: string,\n body: string,\n labels?: string[]\n): Promise<{ number: number; html_url: string }> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n const response = await octokit.issues.create({\n owner,\n repo,\n title,\n body,\n labels: labels || [],\n });\n\n return {\n number: response.data.number,\n html_url: response.data.html_url,\n };\n}; "],"names":["getOctokit","logger","getLogger","token","process","env","GITHUB_TOKEN","error","Error","Octokit","auth","getCurrentBranchName","stdout","run","trim","getRepoDetails","url","match","owner","repo","createPullRequest","title","body","head","base","octokit","response","pulls","create","data","findOpenPullRequestByHeadRef","debug","list","state","length","message","status","delay","ms","Promise","resolve","setTimeout","hasWorkflowsConfigured","actions","listRepoWorkflows","workflows","waitForPullRequestChecks","prNumber","options","timeout","skipUserConfirmation","startTime","Date","now","consecutiveNoChecksCount","maxConsecutiveNoChecks","elapsedTime","warn","proceedWithoutChecks","promptConfirmation","info","pr","get","pull_number","checkRunsResponse","checks","listForRef","ref","sha","checkRuns","check_runs","hasWorkflows","failingChecks","filter","cr","conclusion","includes","check","name","allChecksCompleted","every","completedCount","mergePullRequest","mergeMethod","headBranch","merge","merge_method","git","deleteRef","createRelease","tagName","notes","repos","tag_name","getOpenIssues","limit","issues","listForRepo","per_page","Math","min","sort","direction","issue","pull_request","issueStrings","slice","map","labels","label","join","number","created_at","updated_at","substring","createIssue","html_url"],"mappings":";;;;;MAMaA,UAAAA,GAAa,IAAA;AACtB,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AACf,IAAA,MAAMC,KAAAA,GAAQC,O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,CAACkF,MAAM;QAC5BK,QAAAA,EAAU1F,QAAAA,CAASG,IAAI,CAACuF;AAC5B,KAAA;AACJ;;;;"}
1
+ {"version":3,"file":"github.js","sources":["../../src/util/github.ts"],"sourcesContent":["import { Octokit } from '@octokit/rest';\nimport { getLogger } from '../logging';\nimport { PullRequest, MergeMethod } from '../types';\nimport { run } from './child';\nimport { promptConfirmation } from './stdin';\n\nexport const getOctokit = (): Octokit => {\n const logger = getLogger();\n const token = process.env.GITHUB_TOKEN;\n\n if (!token) {\n logger.error('GITHUB_TOKEN environment variable is not set.');\n throw new Error('GITHUB_TOKEN is not set.');\n }\n\n return new Octokit({\n auth: token,\n });\n};\n\nexport const getCurrentBranchName = async (): Promise<string> => {\n const { stdout } = await run('git rev-parse --abbrev-ref HEAD');\n return stdout.trim();\n};\n\nexport const getRepoDetails = async (): Promise<{ owner: string; repo: string }> => {\n const { stdout } = await run('git remote get-url origin');\n const url = stdout.trim();\n // git@github.com:owner/repo.git or https://github.com/owner/repo.git\n const match = url.match(/github\\.com[/:]([\\w-]+)\\/([\\w.-]+)\\.git/);\n if (!match) {\n throw new Error(`Could not parse repository owner and name from origin URL: \"${url}\". Expected format: git@github.com:owner/repo.git or https://github.com/owner/repo.git`);\n }\n return { owner: match[1], repo: match[2] };\n};\n\nexport const createPullRequest = async (\n title: string,\n body: string,\n head: string,\n base: string = 'main'\n): Promise<PullRequest> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n const response = await octokit.pulls.create({\n owner,\n repo,\n title,\n body,\n head,\n base,\n });\n\n return response.data;\n};\n\nexport const findOpenPullRequestByHeadRef = async (head: string): Promise<PullRequest | null> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n try {\n logger.debug(`Searching for open pull requests with head: ${owner}:${head} in ${owner}/${repo}`);\n\n const response = await octokit.pulls.list({\n owner,\n repo,\n state: 'open',\n head: `${owner}:${head}`,\n });\n\n logger.debug(`Found ${response.data.length} open pull requests`);\n return response.data[0] ?? null;\n } catch (error: any) {\n logger.error(`Failed to find open pull requests: ${error.message}`);\n if (error.status === 404) {\n logger.error(`Repository ${owner}/${repo} not found or access denied. Please check your GITHUB_TOKEN permissions.`);\n }\n throw error;\n }\n};\n\nconst delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));\n\n// Check if repository has GitHub Actions workflows configured\nconst hasWorkflowsConfigured = async (): Promise<boolean> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n try {\n const response = await octokit.actions.listRepoWorkflows({\n owner,\n repo,\n });\n\n return response.data.workflows.length > 0;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error: any) {\n // If we can't check workflows (e.g., no Actions permission), assume they might exist\n return true;\n }\n};\n\nexport const waitForPullRequestChecks = async (prNumber: number, options: { timeout?: number; skipUserConfirmation?: boolean } = {}): Promise<void> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n const timeout = options.timeout || 300000; // 5 minutes default timeout\n const skipUserConfirmation = options.skipUserConfirmation || false;\n\n const startTime = Date.now();\n let consecutiveNoChecksCount = 0;\n const maxConsecutiveNoChecks = 6; // 6 consecutive checks (1 minute) with no checks before asking user\n\n while (true) {\n const elapsedTime = Date.now() - startTime;\n\n // Check for timeout\n if (elapsedTime > timeout) {\n logger.warn(`Timeout reached (${timeout / 1000}s) while waiting for PR #${prNumber} checks.`);\n\n if (!skipUserConfirmation) {\n const proceedWithoutChecks = await promptConfirmation(\n `⚠️ Timeout reached while waiting for PR #${prNumber} checks.\\n` +\n `This might indicate that no checks are configured for this repository.\\n` +\n `Do you want to proceed with merging the PR without waiting for checks?`\n );\n\n if (proceedWithoutChecks) {\n logger.info('User chose to proceed without waiting for checks.');\n return;\n } else {\n throw new Error(`Timeout waiting for PR #${prNumber} checks. User chose not to proceed.`);\n }\n } else {\n throw new Error(`Timeout waiting for PR #${prNumber} checks (${timeout / 1000}s)`);\n }\n }\n\n const pr = await octokit.pulls.get({\n owner,\n repo,\n pull_number: prNumber,\n });\n\n const checkRunsResponse = await octokit.checks.listForRef({\n owner,\n repo,\n ref: pr.data.head.sha,\n });\n\n const checkRuns = checkRunsResponse.data.check_runs;\n\n if (checkRuns.length === 0) {\n consecutiveNoChecksCount++;\n logger.info(`PR #${prNumber}: No checks found (${consecutiveNoChecksCount}/${maxConsecutiveNoChecks}). Waiting...`);\n\n // After several consecutive \"no checks\" responses, check if workflows are configured\n if (consecutiveNoChecksCount >= maxConsecutiveNoChecks) {\n logger.info(`No checks detected for ${maxConsecutiveNoChecks} consecutive attempts. Checking repository configuration...`);\n\n const hasWorkflows = await hasWorkflowsConfigured();\n\n if (!hasWorkflows) {\n logger.warn(`No GitHub Actions workflows found in repository ${owner}/${repo}.`);\n\n if (!skipUserConfirmation) {\n const proceedWithoutChecks = await promptConfirmation(\n `⚠️ No GitHub Actions workflows or checks are configured for this repository.\\n` +\n `PR #${prNumber} will never have status checks to wait for.\\n` +\n `Do you want to proceed with merging the PR without checks?`\n );\n\n if (proceedWithoutChecks) {\n logger.info('User chose to proceed without checks (no workflows configured).');\n return;\n } else {\n throw new Error(`No checks configured for PR #${prNumber}. User chose not to proceed.`);\n }\n } else {\n // In non-interactive mode, proceed if no workflows are configured\n logger.info('No workflows configured, proceeding without checks.');\n return;\n }\n } else {\n logger.info('GitHub Actions workflows are configured. Continuing to wait for checks...');\n consecutiveNoChecksCount = 0; // Reset counter since workflows exist\n }\n }\n\n await delay(10000);\n continue;\n }\n\n // Reset the no-checks counter since we found some checks\n consecutiveNoChecksCount = 0;\n\n const failingChecks = checkRuns.filter(\n (cr) => cr.conclusion && ['failure', 'timed_out', 'cancelled'].includes(cr.conclusion)\n );\n\n if (failingChecks.length > 0) {\n logger.error(`PR #${prNumber} has failing checks:`);\n for (const check of failingChecks) {\n logger.error(`- ${check.name}: ${check.conclusion}`);\n }\n throw new Error(`PR #${prNumber} checks failed.`);\n }\n\n const allChecksCompleted = checkRuns.every((cr) => cr.status === 'completed');\n\n if (allChecksCompleted) {\n logger.info(`All checks for PR #${prNumber} have completed successfully.`);\n return;\n }\n\n const completedCount = checkRuns.filter(cr => cr.status === 'completed').length;\n logger.info(`PR #${prNumber} checks: ${completedCount}/${checkRuns.length} completed. Waiting...`);\n\n await delay(10000); // wait 10 seconds\n }\n};\n\nexport const mergePullRequest = async (prNumber: number, mergeMethod: MergeMethod = 'squash'): Promise<void> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n logger.info(`Merging PR #${prNumber} using ${mergeMethod} method...`);\n const pr = await octokit.pulls.get({\n owner,\n repo,\n pull_number: prNumber,\n });\n const headBranch = pr.data.head.ref;\n\n await octokit.pulls.merge({\n owner,\n repo,\n pull_number: prNumber,\n merge_method: mergeMethod,\n });\n logger.info(`PR #${prNumber} merged using ${mergeMethod} method.`);\n\n logger.info(`Deleting branch ${headBranch}...`);\n await octokit.git.deleteRef({\n owner,\n repo,\n ref: `heads/${headBranch}`,\n });\n logger.info(`Branch ${headBranch} deleted.`);\n};\n\nexport const createRelease = async (tagName: string, title: string, notes: string): Promise<void> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n logger.info(`Creating release for tag ${tagName}...`);\n await octokit.repos.createRelease({\n owner,\n repo,\n tag_name: tagName,\n name: title,\n body: notes,\n });\n logger.info(`Release ${tagName} created.`);\n};\n\nexport const getOpenIssues = async (limit: number = 20): Promise<string> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n try {\n logger.debug(`Fetching up to ${limit} open GitHub issues...`);\n\n const response = await octokit.issues.listForRepo({\n owner,\n repo,\n state: 'open',\n per_page: Math.min(limit, 100), // GitHub API limit\n sort: 'updated',\n direction: 'desc',\n });\n\n const issues = response.data.filter(issue => !issue.pull_request); // Filter out PRs\n\n if (issues.length === 0) {\n logger.debug('No open issues found');\n return '';\n }\n\n const issueStrings = issues.slice(0, limit).map(issue => {\n const labels = issue.labels.map(label =>\n typeof label === 'string' ? label : label.name\n ).join(', ');\n\n return [\n `Issue #${issue.number}: ${issue.title}`,\n `Labels: ${labels || 'none'}`,\n `Created: ${issue.created_at}`,\n `Updated: ${issue.updated_at}`,\n `Body: ${issue.body?.substring(0, 500) || 'No description'}${issue.body && issue.body.length > 500 ? '...' : ''}`,\n '---'\n ].join('\\n');\n });\n\n logger.debug(`Fetched ${issues.length} open issues`);\n return issueStrings.join('\\n\\n');\n } catch (error: any) {\n logger.warn('Failed to fetch GitHub issues: %s', error.message);\n return '';\n }\n};\n\nexport const createIssue = async (\n title: string,\n body: string,\n labels?: string[]\n): Promise<{ number: number; html_url: string }> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n const response = await octokit.issues.create({\n owner,\n repo,\n title,\n body,\n labels: labels || [],\n });\n\n return {\n number: response.data.number,\n html_url: response.data.html_url,\n };\n};\n\nexport const getWorkflowRunsTriggeredByRelease = async (tagName: string, workflowNames?: string[]): Promise<any[]> => {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n const logger = getLogger();\n\n try {\n logger.debug(`Fetching workflow runs triggered by release ${tagName}...`);\n\n // Get all workflows\n const workflowsResponse = await octokit.actions.listRepoWorkflows({\n owner,\n repo,\n });\n\n const relevantWorkflows = workflowsResponse.data.workflows.filter(workflow => {\n // If specific workflow names are provided, only include those\n if (workflowNames && workflowNames.length > 0) {\n return workflowNames.includes(workflow.name);\n }\n // Otherwise, find workflows that trigger on releases\n return true; // We'll filter by event later when we get the runs\n });\n\n logger.debug(`Found ${relevantWorkflows.length} workflows to check`);\n\n const allRuns: any[] = [];\n\n // Get recent workflow runs for each workflow\n for (const workflow of relevantWorkflows) {\n try {\n const runsResponse = await octokit.actions.listWorkflowRuns({\n owner,\n repo,\n workflow_id: workflow.id,\n per_page: 10, // Check last 10 runs\n });\n\n // Filter runs that were triggered by our release\n const releaseRuns = runsResponse.data.workflow_runs.filter(run => {\n // Check if the run was triggered by a release event and matches our tag\n return run.event === 'release' && run.head_sha && run.created_at;\n });\n\n allRuns.push(...releaseRuns);\n } catch (error: any) {\n logger.warn(`Failed to get runs for workflow ${workflow.name}: ${error.message}`);\n }\n }\n\n // Sort by creation time (newest first) and take the most recent ones\n allRuns.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());\n\n logger.debug(`Found ${allRuns.length} workflow runs triggered by release events`);\n return allRuns;\n } catch (error: any) {\n logger.warn(`Failed to fetch workflow runs: ${error.message}`);\n return [];\n }\n};\n\nexport const waitForReleaseWorkflows = async (\n tagName: string,\n options: {\n timeout?: number;\n workflowNames?: string[];\n skipUserConfirmation?: boolean;\n } = {}\n): Promise<void> => {\n const logger = getLogger();\n const timeout = options.timeout || 600000; // 10 minutes default\n const skipUserConfirmation = options.skipUserConfirmation || false;\n\n logger.info(`Waiting for workflows triggered by release ${tagName}...`);\n\n // Wait a bit for workflows to start (GitHub can take a moment to trigger them)\n logger.debug('Waiting 30 seconds for workflows to start...');\n await delay(30000);\n\n const startTime = Date.now();\n let workflowRuns: any[] = [];\n let consecutiveNoWorkflowsCount = 0;\n const maxConsecutiveNoWorkflows = 6; // 1 minute of checking before asking user\n\n while (true) {\n const elapsedTime = Date.now() - startTime;\n\n // Check for timeout\n if (elapsedTime > timeout) {\n logger.warn(`Timeout reached (${timeout / 1000}s) while waiting for release workflows.`);\n\n if (!skipUserConfirmation) {\n const proceedWithoutWorkflows = await promptConfirmation(\n `⚠️ Timeout reached while waiting for release workflows for ${tagName}.\\n` +\n `This might indicate that no workflows are configured to trigger on releases.\\n` +\n `Do you want to proceed anyway?`\n );\n\n if (proceedWithoutWorkflows) {\n logger.info('User chose to proceed without waiting for release workflows.');\n return;\n } else {\n throw new Error(`Timeout waiting for release workflows for ${tagName}. User chose not to proceed.`);\n }\n } else {\n throw new Error(`Timeout waiting for release workflows for ${tagName} (${timeout / 1000}s)`);\n }\n }\n\n // Get current workflow runs\n workflowRuns = await getWorkflowRunsTriggeredByRelease(tagName, options.workflowNames);\n\n if (workflowRuns.length === 0) {\n consecutiveNoWorkflowsCount++;\n logger.info(`No release workflows found (${consecutiveNoWorkflowsCount}/${maxConsecutiveNoWorkflows}). Waiting...`);\n\n // After several attempts with no workflows, ask user if they want to continue\n if (consecutiveNoWorkflowsCount >= maxConsecutiveNoWorkflows) {\n logger.warn(`No workflows triggered by release ${tagName} after ${maxConsecutiveNoWorkflows} attempts.`);\n\n if (!skipUserConfirmation) {\n const proceedWithoutWorkflows = await promptConfirmation(\n `⚠️ No GitHub Actions workflows appear to be triggered by the release ${tagName}.\\n` +\n `This might be expected if no workflows are configured for release events.\\n` +\n `Do you want to proceed without waiting for workflows?`\n );\n\n if (proceedWithoutWorkflows) {\n logger.info('User chose to proceed without release workflows.');\n return;\n } else {\n throw new Error(`No release workflows found for ${tagName}. User chose not to proceed.`);\n }\n } else {\n // In non-interactive mode, proceed if no workflows are found\n logger.info('No release workflows found, proceeding.');\n return;\n }\n }\n\n await delay(10000);\n continue;\n }\n\n // Reset counter since we found workflows\n consecutiveNoWorkflowsCount = 0;\n\n // Check status of all workflow runs\n const failingRuns = workflowRuns.filter(run =>\n run.conclusion && ['failure', 'timed_out', 'cancelled'].includes(run.conclusion)\n );\n\n if (failingRuns.length > 0) {\n logger.error(`Release workflows for ${tagName} have failures:`);\n for (const run of failingRuns) {\n logger.error(`- ${run.name}: ${run.conclusion} (${run.html_url})`);\n }\n throw new Error(`Release workflows for ${tagName} failed.`);\n }\n\n const allWorkflowsCompleted = workflowRuns.every(run => run.status === 'completed');\n\n if (allWorkflowsCompleted) {\n const successfulRuns = workflowRuns.filter(run => run.conclusion === 'success');\n logger.info(`All ${workflowRuns.length} release workflows for ${tagName} completed successfully.`);\n for (const run of successfulRuns) {\n logger.info(`✓ ${run.name}: ${run.conclusion}`);\n }\n return;\n }\n\n const completedCount = workflowRuns.filter(run => run.status === 'completed').length;\n const runningCount = workflowRuns.filter(run => run.status === 'in_progress').length;\n const queuedCount = workflowRuns.filter(run => run.status === 'queued').length;\n\n logger.info(\n `Release workflows for ${tagName}: ${completedCount} completed, ${runningCount} running, ${queuedCount} queued (${workflowRuns.length} total)`\n );\n\n await delay(15000); // wait 15 seconds\n }\n};\n"],"names":["getOctokit","logger","getLogger","token","process","env","GITHUB_TOKEN","error","Error","Octokit","auth","getCurrentBranchName","stdout","run","trim","getRepoDetails","url","match","owner","repo","createPullRequest","title","body","head","base","octokit","response","pulls","create","data","findOpenPullRequestByHeadRef","debug","list","state","length","message","status","delay","ms","Promise","resolve","setTimeout","hasWorkflowsConfigured","actions","listRepoWorkflows","workflows","waitForPullRequestChecks","prNumber","options","timeout","skipUserConfirmation","startTime","Date","now","consecutiveNoChecksCount","maxConsecutiveNoChecks","elapsedTime","warn","proceedWithoutChecks","promptConfirmation","info","pr","get","pull_number","checkRunsResponse","checks","listForRef","ref","sha","checkRuns","check_runs","hasWorkflows","failingChecks","filter","cr","conclusion","includes","check","name","allChecksCompleted","every","completedCount","mergePullRequest","mergeMethod","headBranch","merge","merge_method","git","deleteRef","createRelease","tagName","notes","repos","tag_name","getOpenIssues","limit","issues","listForRepo","per_page","Math","min","sort","direction","issue","pull_request","issueStrings","slice","map","labels","label","join","number","created_at","updated_at","substring","createIssue","html_url","getWorkflowRunsTriggeredByRelease","workflowNames","workflowsResponse","relevantWorkflows","workflow","allRuns","runsResponse","listWorkflowRuns","workflow_id","id","releaseRuns","workflow_runs","event","head_sha","push","a","b","getTime","waitForReleaseWorkflows","workflowRuns","consecutiveNoWorkflowsCount","maxConsecutiveNoWorkflows","proceedWithoutWorkflows","failingRuns","allWorkflowsCompleted","successfulRuns","runningCount","queuedCount"],"mappings":";;;;;MAMaA,UAAAA,GAAa,IAAA;AACtB,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AACf,IAAA,MAAMC,KAAAA,GAAQC,OAAAA,CAAQC,GAAG,CAACC,YAAY;AAEtC,IAAA,IAAI,CAACH,KAAAA,EAAO;AAC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AAA,CAAE,CAAA;AAClD,YAAA;AACA,YAAA;AACJ,QAAA;QAEA,MAAMM,cAAAA,GAAiBuD,YAAAA,CAAa/D,MAAM,CAAC5D,CAAAA,MAAOA,GAAAA,CAAIuB,MAAM,KAAK,WAAA,CAAA,CAAaF,MAAM;QACpF,MAAM6G,YAAAA,GAAeP,YAAAA,CAAa/D,MAAM,CAAC5D,CAAAA,MAAOA,GAAAA,CAAIuB,MAAM,KAAK,aAAA,CAAA,CAAeF,MAAM;QACpF,MAAM8G,WAAAA,GAAcR,YAAAA,CAAa/D,MAAM,CAAC5D,CAAAA,MAAOA,GAAAA,CAAIuB,MAAM,KAAK,QAAA,CAAA,CAAUF,MAAM;QAE9EjC,MAAAA,CAAO2D,IAAI,CACP,CAAC,sBAAsB,EAAE8B,OAAAA,CAAQ,EAAE,EAAET,cAAAA,CAAe,YAAY,EAAE8D,YAAAA,CAAa,UAAU,EAAEC,WAAAA,CAAY,SAAS,EAAER,YAAAA,CAAatG,MAAM,CAAC,OAAO,CAAC,CAAA;QAGlJ,MAAMG,KAAAA,CAAM;AAChB,IAAA;AACJ;;;;"}
@@ -19,7 +19,8 @@ const create = (params)=>{
19
19
  const isDirectory = async (path)=>{
20
20
  const stats = await fs.promises.stat(path);
21
21
  if (!stats.isDirectory()) {
22
- log(`${path} is not a directory`);
22
+ // Log at debug level since this is expected when scanning directories
23
+ // that contain both files and directories
23
24
  return false;
24
25
  }
25
26
  return true;
@@ -27,7 +28,7 @@ const create = (params)=>{
27
28
  const isFile = async (path)=>{
28
29
  const stats = await fs.promises.stat(path);
29
30
  if (!stats.isFile()) {
30
- log(`${path} is not a file`);
31
+ // Log removed since this is expected when checking file types
31
32
  return false;
32
33
  }
33
34
  return true;