feat(duplicates): edit existing issues#201
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the artifact creation logic to support updating existing meeting notes documents and GitHub issues instead of only creating new ones. The main changes enable a get-or-create pattern that checks for existing artifacts before creating new ones unless the --force flag is used.
- Introduces
getOrCreateNotesDocumentto check for existing HackMD notes by title before creating new ones - Introduces
createOrUpdateMeetingIssueto check for existing GitHub issues and update them if content differs - Removes early exit logic from the main script, moving it into the new functions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/hackmd.mjs | Adds getOrCreateNotesDocument function to find existing HackMD notes or create new ones based on the force flag |
| src/github.mjs | Adds createOrUpdateMeetingIssue and updateMeetingIssue functions to support updating existing GitHub issues |
| create-node-meeting-artifacts.mjs | Removes early-exit logic and updates function calls to use the new get-or-create and create-or-update functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…te-node-meeting-artifacts into edit-existing-issues
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
src/hackmd.mjs:1
- Function name mismatch: the function is named
getOrCreateMeetingNotesDocumentin the diff but the existing codebase usesgetOrCreateNotesDocument. This inconsistency will cause the function call in create-node-meeting-artifacts.mjs to fail since it callsgetOrCreateNotesDocument.
import HackMDAPI from '@hackmd/api';
src/github.mjs:1
- Function name mismatch: the function is named
createOrUpdateGitHubIssuein the diff but the existing codebase usescreateOrUpdateMeetingIssue. This inconsistency will cause the function call in create-node-meeting-artifacts.mjs to fail since it callscreateOrUpdateMeetingIssue.
import { Octokit } from '@octokit/rest';
src/github.mjs:1
- The
updateGitHubIssuefunction accessesgithubClient.issues.updatedirectly, butcreateGitHubIssueuses{ rest }destructuring to accessrest.issues.create. This inconsistency in how the githubClient is accessed could lead to runtime errors. The function should destructurerestfrom githubClient or use the full path consistently.
import { Octokit } from '@octokit/rest';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Now, instead of exiting on an existing issue being found, the script will edit the existing issue/HackMD note (fetched by comparing the titles) if the agenda has changed.