Conversation
`create <eventFile>` could only ever create one draft, in
`meetup.groupUrlname`, while `create-from-json` already took
`--groups "a,b" | all`. This gives the file path the same capability, with
idempotency and write-back tracked per group.
Frontmatter: the scalar `event_url` / `event_id` pair stays exactly as it is
and a complete `meetup_events` list is added alongside it, including the
primary group's own row:
event_url: 'https://www.meetup.com/cpp-serbia/events/313413133/'
event_id: '313413133'
meetup_events:
- group: cpp-serbia
event_id: '313413133'
- group: chicago-c-cpp-users-group
event_id: '314900001'
Keeping the scalars, rather than replacing them with the list, is
load-bearing in three ways:
* `.github/workflows/_meetup-event-draft.yml` greps `^event_url:` before
and after the run and discards any file change that does not move that
line. Dropping the scalar would make every write-back vanish.
* Adopter sites read `event_url` for their "Register on Meetup" link, and
they want one link, not a set.
* A single-group `create` (no `--groups`) must keep behaving byte for byte
as before, including its `--output` shape, so existing setups are
untouched.
For the same reasons only the *primary* group's ids ever reach the scalars.
A secondary group's id there would make a later plain `create` skip the file
and so never create the primary event at all, and would point that
"Register on Meetup" link at the wrong group. `meetup_events` is the complete
record; the scalars are a mirror of one row of it.
Idempotency is per group and needs no migration step: `createdGroupEvents`
reads `meetup_events`, then folds in the legacy scalar pair attributed via
`groupUrlnameFromEventUrl` (a Meetup event URL already names its group),
falling back to an assumed group. Keys are lower-cased because Meetup
urlnames are case-insensitive. A malformed hand-edited row throws, naming the
file: silently ignoring a typo would silently create a duplicate draft, the
exact failure this record prevents.
Write-back happens inside `onCreated`, once per group, so a failure halfway
through leaves the groups that succeeded recorded on disk and a retry creates
only what is missing. When every requested group is already recorded the run
returns before building a client and before touching the file, so "the file
did not change" keeps meaning "no work was done".
Also fixed along the way:
* `--groups ","` parsed to `[]`, which is truthy, so the "only these
groups" filter was skipped and it silently meant `--groups all`.
`parseCsvArg` (renamed from `parseHostArg`, which already parsed
`--groups` too) now returns undefined for an all-empty value.
* `runMain(main).then(() => process.exit(0))` discarded the
`process.exitCode = 1` a partly-failed multi-group run sets, so
`create-from-json --groups` has never signalled failure to CI despite the
README promising it. It now exits with the code a command set.
* `onCreated` now reports `groupUrlname`, so an adopter creating in several
groups can tell which group's id it was handed.
`_meetup-event-draft.yml` is deliberately left alone: wiring `--groups` into
it first needs its `event_url` before/after grep replaced with
`git diff --quiet`, because a run whose primary group is skipped changes only
`meetup_events`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
create <eventFile>now takes--groups "a,b" | all, matchingcreate-from-json.Without it the command behaves as before, including its
--outputshape.meetup_eventslist (PublishedEventRef, added to core) recordingevery group the event was created in. The
event_url/event_idscalars stay, andmirror the primary group's row only.
group is written back as it succeeds so a half-failed run resumes cleanly, and a run
where everything is already recorded returns before building a client or touching the
file. No migration step — a legacy scalar pair is attributed to its group via the event
URL, which already names it.
--groups ","parsed to[], which is truthy, so the "only these groups" filterwas skipped and it silently meant
--groups all.onCreatednow reportsgroupUrlname, so an adopter creating in several groups can tellwhich group's id it was handed.
Only the primary group's ids reach the scalars: a secondary id there would make a later
plain
createskip the file and so never create the primary event, and would point anadopter's "Register on Meetup" link at the wrong group.
_meetup-event-draft.ymlis deliberately left alone. Wiring--groupsinto it first needsits
event_urlbefore/after grep replaced withgit diff --quiet, because a run whoseprimary group is skipped changes only
meetup_events.Motivation
create-from-jsonhas taken--groupssince #2, but the file-per-event path — the oneadopters keeping a markdown file per event actually use — could still only ever create one
draft, in
meetup.groupUrlname.Testing
Tested locally. Full CI chain green (build, lint, format:check, typecheck, spell, test),
158 tests — 33 new across
create-drafts-from-file.test.ts,payload.test.tsandcli.test.ts, covering per-group skip/attempt ordering, case-insensitive group matching,legacy-scalar attribution, the malformed-
meetup_eventsthrow, write-back placement, the--groups ","regression, and both--outputshapes. All dry-run; nothing reaches theMeetup API.
Checkup list