-
-
Notifications
You must be signed in to change notification settings - Fork 44
feat(duplicates): edit existing issues #201
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?
Conversation
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.
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>
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.
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.
| const existingIssue = await findIssueByTitle( | ||
| githubClient, | ||
| title, | ||
| meetingConfig |
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.
Why we need to pass the meetingConfig?
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.
To get the repository to search from
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.
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.