Skip to content

chore: move to JSON#237

Merged
avivkeller merged 4 commits into
mainfrom
json
Jul 1, 2026
Merged

chore: move to JSON#237
avivkeller merged 4 commits into
mainfrom
json

Conversation

@avivkeller

Copy link
Copy Markdown
Member

Also supersedes #236, and fixes the issue mentioned in that PRs description.

Comment thread src/meeting.mjs Outdated

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a lot of changes to review, could you give more details on how you generate them and what to review?

@avivkeller

Copy link
Copy Markdown
Member Author

This moves the dotenv files to .json files, so that they are easier to edit, as we've gotten concerns that editting the dotenv files is tedious and annoying. The files should contain the same content as the dotenv, so just verifying that they do / that they can be read properly is all that needs to be reviewed, though I have tested this on my own.

@avivkeller avivkeller requested a review from aduh95 June 24, 2026 12:30
@aduh95

aduh95 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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

@avivkeller

Copy link
Copy Markdown
Member Author

I wrote them by hand using the original env files 😅

Comment thread meetings/build.meeting.json Outdated
@aduh95

aduh95 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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.

@avivkeller

Copy link
Copy Markdown
Member Author

All the changes seem intentional

@aduh95

aduh95 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

There are conflicts to solve

avivkeller and others added 3 commits June 26, 2026 14:27
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@avivkeller

Copy link
Copy Markdown
Member Author

@aduh95 can you dismiss the CodeQL alert so I can merge?

@aduh95

aduh95 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

can you dismiss the CodeQL alert so I can merge?

Can't you address it instead? It's correct that if the title is Hello \[world\](./), the added backspace will make it Hello \\[world\\](./) which is valid markdown for a link

…caping or encoding'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 20:10
@avivkeller avivkeller merged commit bc2efb8 into main Jul 1, 2026
2 of 4 checks passed
@avivkeller avivkeller deleted the json branch July 1, 2026 20:10
Copilot stopped reviewing on behalf of avivkeller due to an error July 1, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 normalized meetings/<group>.meeting.json configs and templates/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.json instead 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 to meeting.group when meeting.name is missing, but createTemplateContext() passes meeting.name directly into generateTimeAndDateLink(). 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 by repo (and optionally issues within each group by number/updated_at) before returning.
    src/github.mjs:1
  • MeetingConfig.github.owner is documented/typed as 'Organization/user', but the search query always uses org:${owner} which only works for organizations. Either (a) constrain/document the field as organization-only, or (b) support user-owned scopes by switching to user:${owner} when appropriate (or add an explicit github.scope field to avoid guessing).
    src/hackmd.mjs:1
  • After deleting global.d.ts, the JSDoc types HackMDAPI (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 in src/types.d.ts and reference those consistently.
    src/meeting.mjs:1
  • render() reads the template file from disk on every call. The CLI calls render() 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.

Comment thread src/meeting.mjs
*/
const escapeTitle = title => title.replace(/([[\]])/g, '\\$1');
const escapeTitle = title =>
title.replace(/\\/g, '\\\\').replace(/([\[\]])/g, '\\$1');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that suggestion was correct though

@aduh95 aduh95 Jul 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like

Suggested change
title.replace(/\\/g, '\\\\').replace(/([\[\]])/g, '\\$1');
title.replace(/(?<!\\)(\\\\)*([[\]])/g, '$1\\$2');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants