Skip to content

Commit 66824ba

Browse files
committed
#7580 enhanced scope
1 parent 48d20c1 commit 66824ba

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

.github/ISSUE/ticket-add-frontmatter-to-release-notes.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ GH ticket id: #7580
1212

1313
## Description
1414

15-
To improve the structure and utility of the locally synchronized release notes, we should add YAML frontmatter containing key metadata, similar to how issues are handled.
15+
To improve the structure and utility of the locally synchronized release notes, we should add YAML frontmatter containing key metadata. This change also standardizes the frontmatter convention across the entire sync service.
16+
17+
During implementation, a broader strategic decision was made to align all frontmatter keys with the `camelCase` format used by the source GitHub API (`gh` CLI). This improves maintainability and reduces transformation logic.
1618

1719
## Acceptance Criteria
1820

19-
1. The `#syncReleaseNotes` method in `SyncService.mjs` is updated to fetch `tagName`, `name`, and `publishedAt` in addition to the release `body`.
20-
2. The `gray-matter` library is used to stringify the release `body` with the fetched metadata as YAML frontmatter.
21-
3. The complete content (frontmatter + body) is saved to the local `.md` file.
22-
4. The filename convention is clarified and implemented to be clean and predictable (e.g., `v10.9.0.md` from a `v10.9.0` tag).
21+
1. The `#syncReleaseNotes` method in `SyncService.mjs` is updated to fetch `tagName`, `name`, and `publishedAt` and save them as `camelCase` YAML frontmatter.
22+
2. The `#formatIssueMarkdown` method is refactored to use `camelCase` for all its frontmatter keys (e.g., `createdAt`, `commentsCount`) instead of `snake_case`, ensuring consistency.
23+
3. The `gray-matter` library is used to stringify the content with the fetched metadata as YAML frontmatter for both issues and release notes.
24+
4. The filename convention for release notes is confirmed to be clean and predictable (e.g., `v10.9.0.md` from a `v10.9.0` tag).

ai/mcp/server/github-workflow/services/SyncService.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,20 @@ class SyncService extends Base {
222222
*/
223223
#formatIssueMarkdown(issue, comments) {
224224
const frontmatter = {
225-
id : issue.number,
226-
title : issue.title,
227-
state : issue.state,
228-
labels : issue.labels.map(l => l.name),
229-
assignees : issue.assignees.map(a => a.login),
230-
created_at : issue.createdAt,
231-
updated_at : issue.updatedAt,
232-
github_url : issue.url,
233-
author : issue.author.login,
234-
comments_count: comments.length
225+
id : issue.number,
226+
title : issue.title,
227+
state : issue.state,
228+
labels : issue.labels.map(l => l.name),
229+
assignees : issue.assignees.map(a => a.login),
230+
createdAt : issue.createdAt,
231+
updatedAt : issue.updatedAt,
232+
githubUrl : issue.url,
233+
author : issue.author.login,
234+
commentsCount: comments.length
235235
};
236236

237237
if (issue.closedAt) {
238-
frontmatter.closed_at = issue.closedAt;
238+
frontmatter.closedAt = issue.closedAt;
239239
}
240240
if (issue.milestone) {
241241
frontmatter.milestone = issue.milestone.title;
@@ -415,7 +415,7 @@ class SyncService extends Base {
415415
state : issue.state,
416416
path : targetPath,
417417
updated : issue.updatedAt,
418-
closed_at: issue.closedAt || null,
418+
closedAt : issue.closedAt || null,
419419
milestone: issue.milestone?.title || null,
420420
title : issue.title
421421
};

0 commit comments

Comments
 (0)