-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add MongoDB migration and S3 copy utilities with package configuration updates #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7804b8b
9e2bfd9
e1d9318
b58260a
dd2ba36
44d80a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| # Process Pull Request Comments | ||
|
|
||
| ## Purpose | ||
| This workflow processes analyzed pull request comments from `./tmp/PR_CONVERSATIONS.md` and executes actions based on the Decision field for each relevant comment. | ||
|
|
||
| ## Prerequisites | ||
| - Analysis file exists at: `./tmp/PR_CONVERSATIONS.md` | ||
| - Scripts available: `scripts/resolve-pr-conversation.js` | ||
| - GitHub CLI configured for issue creation | ||
|
|
||
| ## Process Flow | ||
|
|
||
| ### 1. Read Analysis File | ||
| - Load `./tmp/PR_CONVERSATIONS.md` | ||
| - Parse all comments into structured data | ||
| - Extract fields: Id, Status, Decision, Comment Body, PR Number, etc. | ||
|
|
||
| ### 2. Process Each Conversation | ||
|
|
||
| #### Step 2.1: Check Id Field | ||
| - **If Id = "Local"**: Skip to next conversation (no resolution needed - created by local tool) | ||
| - **Otherwise**: Continue to Step 2.2 | ||
|
|
||
| #### Step 2.2: Check Status Field | ||
| - **If Status = "OUTDATED"**: | ||
| - Execute: `node scripts/resolve-pr-conversation.js CONVERSATION_ID "Marked as outdated"` | ||
| - Skip to next conversation | ||
| - **Otherwise**: Continue to Step 2.3 | ||
|
|
||
| #### Step 2.3: Process Based on Decision Field | ||
|
|
||
| | Decision Value | Action | Resolution Comment | | ||
| |----------------|--------|-------------------| | ||
| | IGNORE or Empty | Skip to next conversation | N/A | | ||
| | RESOLVE | Mark as resolved only | "Acknowledged and resolved" | | ||
| | PROCESS or FIX | 1. Apply fix using common rules<br>2. Mark as resolved | "Fixed: [7-15 word description of what was done]" | | ||
| | Create Issue or Fix later | 1. Create GitHub issue<br>2. Add links (PR ↔ Issue)<br>3. Mark as resolved | "Created issue #[number] for future fix" | | ||
|
|
||
| ### 3. Resolution Command Format | ||
| ```bash | ||
| node scripts/resolve-pr-conversation.js CONVERSATION_ID "Your comment here" | ||
| ``` | ||
|
|
||
| ## Visual Process Diagrams | ||
|
|
||
| ### Main Process Flow Diagram | ||
| ```mermaid | ||
| flowchart TD | ||
| Start([Start: Process PR Comments]) --> ReadFile[Read ./tmp/PR_CONVERSATIONS.md] | ||
| ReadFile --> ParseComments[Parse Comments into Structured Data] | ||
| ParseComments --> StartLoop{For Each Conversation} | ||
|
|
||
| StartLoop --> CheckId{Is Id = Local?} | ||
| CheckId -->|Yes| NextConv[Skip to Next Conversation] | ||
| CheckId -->|No| CheckStatus{Is Status = OUTDATED?} | ||
|
|
||
| CheckStatus -->|Yes| ResolveOutdated[Execute: resolve-pr-conversation.js<br/>with 'Marked as outdated'] | ||
| ResolveOutdated --> NextConv | ||
|
|
||
| CheckStatus -->|No| CheckDecision{Check Decision Field} | ||
|
|
||
| CheckDecision -->|IGNORE or Empty| NextConv | ||
| CheckDecision -->|RESOLVE| ResolveOnly[Mark as Resolved<br/>Comment: 'Acknowledged and resolved'] | ||
| CheckDecision -->|PROCESS or FIX| ProcessFix[1. Apply Fix Using Common Rules<br/>2. Mark as Resolved<br/>Comment: 'Fixed: 7-15 word description'] | ||
| CheckDecision -->|Create Issue or<br/>Fix later| CreateIssue[1. Create GitHub Issue<br/>2. Add PR-Issue Links<br/>3. Mark as Resolved<br/>Comment: 'Created issue #number for future fix'] | ||
|
|
||
| ResolveOnly --> NextConv | ||
| ProcessFix --> NextConv | ||
| CreateIssue --> NextConv | ||
|
|
||
| NextConv --> MoreConv{More Conversations?} | ||
| MoreConv -->|Yes| StartLoop | ||
| MoreConv -->|No| End([End]) | ||
|
|
||
| %% Styling | ||
| classDef decision fill:#f9f,stroke:#333,stroke-width:2px | ||
| classDef action fill:#bbf,stroke:#333,stroke-width:2px | ||
| classDef terminal fill:#9f9,stroke:#333,stroke-width:2px | ||
|
|
||
| class CheckId,CheckStatus,CheckDecision,StartLoop,MoreConv decision | ||
| class ReadFile,ParseComments,ResolveOutdated,ResolveOnly,ProcessFix,CreateIssue,NextConv action | ||
| class Start,End terminal | ||
| ``` | ||
|
|
||
| ### Common Rules Application Diagram (For PROCESS/FIX Decision) | ||
| ```mermaid | ||
| flowchart LR | ||
| subgraph ProcessFix[Process/Fix Workflow] | ||
| direction TB | ||
| Start2([Decision = PROCESS/FIX]) --> ApplyRules[Apply Common Rules] | ||
|
|
||
| ApplyRules --> Rule1[no-apologies-rule:<br/>Remove any apologies] | ||
| ApplyRules --> Rule2[no-summaries-rule:<br/>Don't summarize changes] | ||
| ApplyRules --> Rule3[no-unnecessary-confirmations-rule:<br/>Don't ask for confirmation] | ||
| ApplyRules --> Rule4[no-unnecessary-updates-rule:<br/>Only make needed changes] | ||
| ApplyRules --> Rule5[preserve-existing-code-rule:<br/>Keep unrelated code intact] | ||
|
|
||
| Rule1 --> ImplementFix[Implement the Fix] | ||
| Rule2 --> ImplementFix | ||
| Rule3 --> ImplementFix | ||
| Rule4 --> ImplementFix | ||
| Rule5 --> ImplementFix | ||
|
|
||
| ImplementFix --> CreateComment[Create 7-15 Word Summary<br/>of What Was Fixed] | ||
| CreateComment --> ResolveConv[Execute: resolve-pr-conversation.js<br/>CONVERSATION_ID 'Fixed: summary'] | ||
| end | ||
|
|
||
| %% Styling | ||
| classDef rules fill:#ffd,stroke:#333,stroke-width:2px | ||
| classDef process fill:#ddf,stroke:#333,stroke-width:2px | ||
|
|
||
| class Rule1,Rule2,Rule3,Rule4,Rule5 rules | ||
| class ApplyRules,ImplementFix,CreateComment,ResolveConv process | ||
| ``` | ||
|
|
||
| ## Comment Guidelines | ||
| - Rephrase comments to fix English grammar | ||
| - Keep original wording/intent | ||
| - For processed/fixed items: Create concise 7-15 word summary of action taken | ||
| - Be specific about what was changed or fixed | ||
|
|
||
| ## Error Handling | ||
| - If conversation ID not found: Log and continue | ||
| - If GitHub issue creation fails: Log error, mark conversation with error note | ||
| - If resolution script fails: Retry once, then log failure | ||
|
|
||
| ## Common Rules Reference | ||
| When Decision = PROCESS or FIX, apply these rules: | ||
| - no-apologies-rule | ||
| - no-summaries-rule | ||
| - no-unnecessary-confirmations-rule | ||
| - no-unnecessary-updates-rule | ||
| - preserve-existing-code-rule | ||
|
|
||
| ## Quick Reference Flowchart | ||
|
|
||
| ### Main Process Flow | ||
| 1. Read `./tmp/PR_CONVERSATIONS.md` | ||
| 2. For each conversation: | ||
| - Local? → Skip | ||
| - OUTDATED? → Resolve with "Marked as outdated" | ||
| - Decision: | ||
| - IGNORE/Empty → Skip | ||
| - RESOLVE → Resolve with "Acknowledged and resolved" | ||
| - PROCESS/FIX → Apply fix, resolve with action summary | ||
| - Create Issue/Fix later → Create issue, add links, resolve | ||
|
|
||
| ### Resolution Command | ||
| ```bash | ||
| node scripts/resolve-pr-conversation.js CONVERSATION_ID "Your comment" | ||
| ``` | ||
|
|
||
| ### Decision Matrix | ||
| | Decision | Action Required | Resolution Comment Template | | ||
| |----------|----------------|---------------------------| | ||
| | Local ID | None (Skip) | N/A | | ||
| | OUTDATED | Resolve only | "Marked as outdated" | | ||
| | IGNORE | None (Skip) | N/A | | ||
| | Empty | None (Skip) | N/A | | ||
| | RESOLVE | Resolve only | "Acknowledged and resolved" | | ||
| | PROCESS | Fix + Resolve | "Fixed: [specific action taken]" | | ||
| | FIX | Fix + Resolve | "Fixed: [specific action taken]" | | ||
| | Create Issue | Issue + Resolve | "Created issue #[num] for future fix" | | ||
| | Fix later | Issue + Resolve | "Created issue #[num] for future fix" | | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,76 @@ | ||||||
| --- | ||||||
| description: | ||||||
| globs: | ||||||
| alwaysApply: false | ||||||
| --- | ||||||
| # Handle Pull Request Comments | ||||||
|
|
||||||
| ## Purpose | ||||||
| This workflow analyzes pull request comments against the current codebase to identify which comments are still relevant and need to be addressed. | ||||||
|
|
||||||
| ## Process | ||||||
|
|
||||||
| 1. Get PR Number: `npx tsx scripts/get-pr-number.ts` | ||||||
| 2. Fetch PR Comments: `npx tsx scripts/list-pr-conversations.ts <PR_NUMBER>` | ||||||
| 3. Analyze Comments | ||||||
| For each comment retrieved: | ||||||
| - Review the comment content | ||||||
| - Check if the mentioned code/issue still relevant in the current codebase | ||||||
| - Categorize as: | ||||||
| - **RELEVANT**: The issue or suggestion mentioned still applies (even if code moved to different location) | ||||||
| - **OUTDATED**: The issue has been addressed or code has changed | ||||||
|
|
||||||
| **Relevance is determined by the intent of the comment, not exact code location:** | ||||||
| - If problematic pattern still exists anywhere → RELEVANT | ||||||
| - If suggestion hasn't been implemented → RELEVANT | ||||||
| - If issue was fixed/refactored → OUTDATED | ||||||
| - If code was removed entirely → OUTDATED | ||||||
|
|
||||||
| ### 4. Generate Report | ||||||
| Create a detailed report that includes: | ||||||
| - Summary of all comments analyzed | ||||||
| - List of comments that are still relevant | ||||||
| - if issue is still relevant, provide recommendation for addressing the comment | ||||||
| - Any comments that need further investigation | ||||||
|
|
||||||
| #### Edge Cases: | ||||||
| - **Bot comments**: Treat bot comments (e.g., from copilot-pull-request-reviewer) the same as human comments | ||||||
| - **Deleted files**: If a comment references a file that no longer exists, mark as OUTDATED | ||||||
| - **Vague comments**: Comments without specific details (e.g., "this looks wrong") should be marked as RELEVANT | ||||||
| - **Decision field**: Always leave the Decision field empty for the user to fill in later | ||||||
|
|
||||||
| ### 5. Save the analysis report to `./tmp/PR_CONVERSATIONS.md`, Use the following structure: | ||||||
|
|
||||||
| ```markdown | ||||||
| # All Conversations for PR #4: | ||||||
|
|
||||||
| ## ❌ OUTDATED (Fixed by previous changes): | ||||||
|
|
||||||
| ### **<relative path to file>:<line>** | ||||||
| Id: <conversation id> | ||||||
| Author: <the author of a comment> | ||||||
| Description: <once sentence up to 40 words what actually this comment about> | ||||||
| ---- | ||||||
| <Full text of original comment> | ||||||
| ---- | ||||||
| Status: <RELEVANT>:<Explanation why this is relevant> | ||||||
|
|
||||||
| ## ✅ STILL RELEVANT (Need to be fixed): | ||||||
|
|
||||||
| ### **<relative path to file>:<line>** | ||||||
| Id: <conversation id> | ||||||
| Author: <the author of a comment> | ||||||
| Description: <once sentence up to 40 words what actually this comment about> | ||||||
| ---- | ||||||
| <Full text of original comment> | ||||||
| ---- | ||||||
| Status: <RELEVANT>:<Explanation why this is relevant> | ||||||
| Recommendation: <Recommendation whether this issue needs to be processed or ignored> | ||||||
| Decision: | ||||||
|
|
||||||
| ``` | ||||||
|
|
||||||
| ## Important Notes | ||||||
| - The `list-pr-comments.ts` script outputs JSON to console for programmatic processing | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct script filename reference. The documentation references -- The `list-pr-comments.ts` script outputs JSON to console for programmatic processing
+- The `list-pr-conversations.js` script outputs JSON to console for programmatic processing📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - Each comment includes: file, line, author, body, createdAt, outdated, resolved, diffHunk, and url | ||||||
| - Comments are automatically sorted by creation date | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,3 +144,4 @@ website/public/apos-frontend | |
| dump.archive | ||
| .prettierrc | ||
| aposUsersSafe.json | ||
| tmp | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix script references to match actual implementation.
The workflow references TypeScript scripts (
get-pr-number.ts,list-pr-conversations.ts), but the actual scripts are implemented in JavaScript (.jsextension).📝 Committable suggestion
🤖 Prompt for AI Agents