chore: move to JSON#237
Conversation
aduh95
left a comment
There was a problem hiding this comment.
It's a lot of changes to review, could you give more details on how you generate them and what to review?
|
This moves the |
|
OK but did you generate them? If you used a script, it'd be much easier to review the script and verifies I'm getting similar results when I run it |
|
I wrote them by hand using the original env files 😅 |
|
Using the following script to review: #!/usr/bin/env node
import path from 'node:path';
import { readFile, opendir, writeFile, rm } from 'node:fs/promises';
import { parseEnv } from 'node:util';
const TEMPLATES_DIR = new URL('./templates/', import.meta.url);
async function generateMeetingObject(tag) {
const {
AGENDA_TAG,
ISSUE_LABEL,
CALENDAR_FILTER,
GROUP_NAME,
HACKMD_TEAM_NAME,
ICAL_URL,
JOINING_INSTRUCTIONS,
HOST,
REPO,
USER,
} = parseEnv(await readFile(new URL(`./meeting_base_${tag}`, TEMPLATES_DIR), 'utf8'));
return {
name: GROUP_NAME,
host: HOST || USER,
calendar: {
filter: CALENDAR_FILTER,
url: ICAL_URL,
},
github: {
owner: USER,
repo: REPO,
agendaLabel: AGENDA_TAG,
issueLabels: ISSUE_LABEL,
},
hackmd: {
team: HACKMD_TEAM_NAME,
},
joining: {
participant: JOINING_INSTRUCTIONS.match(/\blink for participants: ?\<?([^\n]+?)\>?\n/i)?.[1],
observer: JOINING_INSTRUCTIONS.match(/\bFor those who just want to watch: ?\<?([^\n]+?)\>?\n/i)?.[1],
},
invited: (await readFile(new URL(`./invited_${tag}`, TEMPLATES_DIR), 'utf8')).trim().split(/(^|\n) ?\* ?/).filter(s => s.trim()),
}
}
for await (const dirent of await opendir(TEMPLATES_DIR)) {
if (dirent.isDirectory() || !dirent.name.startsWith('meeting_base_')) continue;
const tag = dirent.name.slice(13);
await writeFile(
new URL(`./meetings/${tag.toLowerCase()}.meeting.json`, import.meta.url),
JSON.stringify(await generateMeetingObject(tag), undefined, 2) + '\n'
);
}
await rm(TEMPLATES_DIR, { force: true, recursive: true });I'm seeing those differences with this PR. |
|
All the changes seem intentional |
|
There are conflicts to solve |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
|
@aduh95 can you dismiss the CodeQL alert so I can merge? |
Can't you address it instead? It's correct that if the title is |
…caping or encoding' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates meeting artifact generation from per-group template files and dotenv-parsed configs to a single shared Mustache template driven by per-group JSON config files under meetings/.
Changes:
- Replaced legacy template parsing (
meeting_base_*,invited_*, etc.) with normalizedmeetings/<group>.meeting.jsonconfigs andtemplates/meeting.mustache. - Updated meeting/github/calendar/hackmd logic and tests to use the new config shape (including agenda grouping + alternating joining sessions).
- Simplified workflows and docs to discover groups from
meetings/*.meeting.jsoninstead of template filenames.
Reviewed changes
Copilot reviewed 126 out of 153 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/templates.test.mjs | Removed tests for deleted legacy variable-substitution templating. |
| test/meeting.test.mjs | Reworked tests to cover JSON-based meeting config loading and Mustache rendering. |
| test/helpers.mjs | Updated test fixture builders to match the new MeetingConfig shape. |
| test/github.test.mjs | Updated tests for new agenda grouping output shape and meeting.github config usage. |
| test/calendar.test.mjs | Updated tests to use meeting.calendar.filter instead of legacy properties. |
| templates/observers_package_metadata_interop | Removed legacy per-group observers template file. |
| templates/observers_outreach | Removed legacy per-group observers template file. |
| templates/minutes_base_web-server-frameworks | Removed legacy per-group minutes template file. |
| templates/minutes_base_web | Removed legacy per-group minutes template file. |
| templates/minutes_base_uvwasi | Removed legacy per-group minutes template file. |
| templates/minutes_base_userfeedback | Removed legacy per-group minutes template file. |
| templates/minutes_base_typescript | Removed legacy per-group minutes template file. |
| templates/minutes_base_tsc | Removed legacy per-group minutes template file. |
| templates/minutes_base_tooling | Removed legacy per-group minutes template file. |
| templates/minutes_base_sustainability_collab | Removed legacy per-group minutes template file. |
| templates/minutes_base_standards | Removed legacy per-group minutes template file. |
| templates/minutes_base_security_collab | Removed legacy per-group minutes template file. |
| templates/minutes_base_security-wg | Removed legacy per-group minutes template file. |
| templates/minutes_base_package_metadata_interop | Removed legacy per-group minutes template file. |
| templates/minutes_base_package-maintenance | Removed legacy per-group minutes template file. |
| templates/minutes_base_outreach | Removed legacy per-group minutes template file. |
| templates/minutes_base_next-10 | Removed legacy per-group minutes template file. |
| templates/minutes_base_modules | Removed legacy per-group minutes template file. |
| templates/minutes_base_loaders | Removed legacy per-group minutes template file. |
| templates/minutes_base_ecosystem_report | Removed legacy per-group minutes template file. |
| templates/minutes_base_diag_deepdive | Removed legacy per-group minutes template file. |
| templates/minutes_base_diag | Removed legacy per-group minutes template file. |
| templates/minutes_base_cross_project_council | Removed legacy per-group minutes template file. |
| templates/minutes_base_bundler_collab | Removed legacy per-group minutes template file. |
| templates/minutes_base_build | Removed legacy per-group minutes template file. |
| templates/minutes_base_benchmarking | Removed legacy per-group minutes template file. |
| templates/minutes_base_Release | Removed legacy per-group minutes template file. |
| templates/meeting_issue.md | Removed legacy meeting-issue markdown template in favor of Mustache. |
| templates/meeting_base_web-server-frameworks | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_web | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_uvwasi | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_userfeedback | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_typescript | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_tsc | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_tooling | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_test_runner | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_sustainability_collab | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_standards | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_security_collab | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_security-wg | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_package_metadata_interop | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_package-maintenance | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_outreach | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_next-10 | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_modules | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_ecosystem_report | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_diag_deepdive | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_diag | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_cross_project_council | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_bundler_collab | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_build | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_benchmarking | Removed legacy per-group meeting base config template file. |
| templates/meeting_base_Release | Removed legacy per-group meeting base config template file. |
| templates/meeting.mustache | Added the single shared Mustache template used for both issues and minutes. |
| templates/invited_web-server-frameworks | Removed legacy per-group invited template file. |
| templates/invited_web | Removed legacy per-group invited template file. |
| templates/invited_uvwasi | Removed legacy per-group invited template file. |
| templates/invited_userfeedback | Removed legacy per-group invited template file. |
| templates/invited_typescript | Removed legacy per-group invited template file. |
| templates/invited_tsc | Removed legacy per-group invited template file. |
| templates/invited_tooling | Removed legacy per-group invited template file. |
| templates/invited_test_runner | Removed legacy per-group invited template file. |
| templates/invited_sustainability_collab | Removed legacy per-group invited template file. |
| templates/invited_standards | Removed legacy per-group invited template file. |
| templates/invited_security_collab | Removed legacy per-group invited template file. |
| templates/invited_security-wg | Removed legacy per-group invited template file. |
| templates/invited_package_metadata_interop | Removed legacy per-group invited template file. |
| templates/invited_package-maintenance | Removed legacy per-group invited template file. |
| templates/invited_outreach | Removed legacy per-group invited template file. |
| templates/invited_next-10 | Removed legacy per-group invited template file. |
| templates/invited_modules | Removed legacy per-group invited template file. |
| templates/invited_loaders | Removed legacy per-group invited template file. |
| templates/invited_ecosystem_report | Removed legacy per-group invited template file. |
| templates/invited_diag_deepdive | Removed legacy per-group invited template file. |
| templates/invited_diag | Removed legacy per-group invited template file. |
| templates/invited_cross_project_council | Removed legacy per-group invited template file. |
| templates/invited_bundler_collab | Removed legacy per-group invited template file. |
| templates/invited_build | Removed legacy per-group invited template file. |
| templates/invited_benchmarking | Removed legacy per-group invited template file. |
| templates/invited_Release | Removed legacy per-group invited template file. |
| src/utils/templates.mjs | Removed custom $VAR$ replacement utility in favor of Mustache. |
| src/types.d.ts | Replaced legacy template-derived types with a normalized JSON meeting config schema. |
| src/meeting.mjs | Implemented JSON config loading, context building, and Mustache rendering. |
| src/hackmd.mjs | Updated HackMD integration to use meeting JSON config (hackmd.team). |
| src/github.mjs | Updated GitHub integration to use meeting JSON config and new agenda grouping shape. |
| src/constants.mjs | Replaced DEFAULT_CONFIG with host/calendar constants used by new renderer. |
| src/config.mjs | Removed directory/template config; now only reads environment credentials. |
| src/calendar.mjs | Updated calendar filtering to use meeting.calendar.filter. |
| package.json | Removed dotenv/dedent; added mustache (+ types). |
| meetings/web.meeting.json | Added JSON meeting config for the web group. |
| meetings/web-server-frameworks.meeting.json | Added JSON meeting config for the web-server-frameworks group. |
| meetings/uvwasi.meeting.json | Added JSON meeting config for the uvwasi group. |
| meetings/userfeedback.meeting.json | Added JSON meeting config for the userfeedback group. |
| meetings/typescript.meeting.json | Added JSON meeting config for the typescript group. |
| meetings/tsc.meeting.json | Added JSON meeting config for the tsc group (including alternating sessions + curated agenda). |
| meetings/tooling.meeting.json | Added JSON meeting config for the tooling group. |
| meetings/test_runner.meeting.json | Added JSON meeting config for the test_runner group. |
| meetings/sustainability_collab.meeting.json | Added JSON meeting config for the sustainability_collab group. |
| meetings/standards.meeting.json | Added JSON meeting config for the standards group. |
| meetings/security_collab.meeting.json | Added JSON meeting config for the security_collab group. |
| meetings/security-wg.meeting.json | Added JSON meeting config for the security-wg group (including curated agenda). |
| meetings/release.meeting.json | Added JSON meeting config for the release group. |
| meetings/package_metadata_interop.meeting.json | Added JSON meeting config for the package_metadata_interop group. |
| meetings/package-maintenance.meeting.json | Added JSON meeting config for the package-maintenance group (including curated agenda). |
| meetings/outreach.meeting.json | Added JSON meeting config for the outreach group. |
| meetings/next-10.meeting.json | Added JSON meeting config for the next-10 group. |
| meetings/modules.meeting.json | Added JSON meeting config for the modules group. |
| meetings/loaders.meeting.json | Added JSON meeting config for the loaders group. |
| meetings/ecosystem_report.meeting.json | Added JSON meeting config for the ecosystem_report group. |
| meetings/diag_deepdive.meeting.json | Added JSON meeting config for the diag_deepdive group. |
| meetings/diag.meeting.json | Added JSON meeting config for the diag group. |
| meetings/cross_project_council.meeting.json | Added JSON meeting config for the cross_project_council group (including issueLabels + curated agenda). |
| meetings/bundler_collab.meeting.json | Added JSON meeting config for the bundler_collab group. |
| meetings/build.meeting.json | Added JSON meeting config for the build group. |
| meetings/benchmarking.meeting.json | Added JSON meeting config for the benchmarking group. |
| global.d.ts | Removed global JSDoc type aliases (migrated to explicit imports/types). |
| eslint.config.mjs | Added Node globals configuration for test files. |
| create-node-meeting-artifacts.mjs | Updated CLI to load JSON configs and render with Mustache for both issue and minutes. |
| TEMPLATES_DOCUMENTATION.md | Replaced legacy template docs with JSON meeting config reference. |
| README.md | Updated repository docs to describe JSON meeting configs and shared Mustache template. |
| .github/workflows/create-meeting-artifacts-scheduled.yml | Updated scheduled workflow to build matrix from meetings/*.meeting.json. |
| .github/workflows/create-meeting-artifacts-manual.yml | Updated manual workflow to read .github.owner from the JSON config. |
| .env.example | Updated HackMD env var guidance for per-meeting team configuration. |
Comments suppressed due to low confidence (5)
src/meeting.mjs:1
generateMeetingTitle()falls back tomeeting.groupwhenmeeting.nameis missing, butcreateTemplateContext()passesmeeting.namedirectly intogenerateTimeAndDateLink(). This can produce incorrect links (e.g. 'undefined') or throw if the URL helper expects a string. Use the same fallback (meeting.name ?? meeting.group) when generating the time-and-date link.
src/github.mjs:1- The returned group order depends on the first-seen order of
issues, which can be nondeterministic from GitHub search results. This can cause rendered markdown sections to reorder between runs (noisy diffs, harder reviews). Consider sorting the returned groups byrepo(and optionally issues within each group bynumber/updated_at) before returning.
src/github.mjs:1 MeetingConfig.github.owneris documented/typed as 'Organization/user', but the search query always usesorg:${owner}which only works for organizations. Either (a) constrain/document the field as organization-only, or (b) support user-owned scopes by switching touser:${owner}when appropriate (or add an explicitgithub.scopefield to avoid guessing).
src/hackmd.mjs:1- After deleting
global.d.ts, the JSDoc typesHackMDAPI(and related references in this file) are no longer declared anywhere in the provided diffs. This can break type-aware tooling/linting. Prefer explicit JSDoc imports (e.g.import('@hackmd/api').API) or add exported aliases insrc/types.d.tsand reference those consistently.
src/meeting.mjs:1 render()reads the template file from disk on every call. The CLI callsrender()at least twice per run (issue + minutes), and tests render repeatedly across groups. Consider caching the template content in-module (lazy-loaded once) to avoid repeated filesystem I/O.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| */ | ||
| const escapeTitle = title => title.replace(/([[\]])/g, '\\$1'); | ||
| const escapeTitle = title => | ||
| title.replace(/\\/g, '\\\\').replace(/([\[\]])/g, '\\$1'); |
There was a problem hiding this comment.
I don't think that suggestion was correct though
There was a problem hiding this comment.
Something like
| title.replace(/\\/g, '\\\\').replace(/([\[\]])/g, '\\$1'); | |
| title.replace(/(?<!\\)(\\\\)*([[\]])/g, '$1\\$2'); |
Also supersedes #236, and fixes the issue mentioned in that PRs description.