Skip to content

Add PowerShell Community Call to the calendar - #635

Open
HeyItsGilbert wants to merge 6 commits into
mainfrom
community-call-calendar
Open

HeyItsGilbert wants to merge 6 commits into
mainfrom
community-call-calendar

Conversation

@HeyItsGilbert

Copy link
Copy Markdown
Member

Summary

  • Adds the PowerShell team's monthly Community Call (3rd Thursday, 9:30 AM Pacific) to content/calendar/.
  • .github/scripts/sync-community-call.mjs computes the next 3 occurrences (DST-aware) and, via GitHub's Discussions GraphQL API, links the latest matching agenda thread from PowerShell/PowerShell's Community Call category as discussionUrl when its month lines up with a generated occurrence.
  • .github/workflows/community-call-sync.yml runs the script daily via workflow_dispatch/cron and opens a bot PR, mirroring the existing meetup-sync/podcast-sync automation.
  • calendar.html renders an "Agenda discussion" link on the event card when discussionUrl is present.
  • Seeded the first three generated calendar entries so the feature is visible immediately.

Design notes

  • The occurrence date is always computed from the known 3rd-Thursday/9:30am-Pacific rule (matching the team's own recurring ICS), never parsed from a discussion title — titles are inconsistent ("October Community Call" vs. "August 21 2025 Community Call"). An explicit day+year in a title overrides the computed date only when present (handles holiday reschedules).
  • The discussions category occasionally contains unrelated threads; filtering on /community call/i in the title reliably excluded all observed noise during investigation.
  • The script never deletes calendar files — occurrences that fall off the 3-month horizon are simply left as historical records, same as meetup-sync.

Testing

  • node --test .github/scripts/sync-community-call.test.mjs — 11 new tests (date math, DST handling, title parsing, sync planning).
  • node --test .github/scripts/sync-meetup-events.test.mjs — unaffected, still passing.
  • Dry-run against the live GitHub API confirmed correct date computation and discussion matching.
  • Hugo wasn't available in the dev sandbox to render calendar.html locally — this PR/Netlify build is the first real render check for that template change.

- New .github/scripts/sync-community-call.mjs computes the next 3 monthly
  occurrences (3rd Thursday, 9:30 AM Pacific, DST-aware) and links the latest
  matching agenda discussion from PowerShell/PowerShell's Community Call
  GitHub Discussions category, with unit tests.
- New .github/workflows/community-call-sync.yml runs it daily and opens a bot PR,
  mirroring the existing meetup-sync/podcast-sync automation pattern.
- Render an "Agenda discussion" link on calendar cards when discussionUrl is set.
- Seed the first three generated events.
- Initial output of .github/scripts/sync-community-call.mjs for the next
  3 monthly occurrences, as the daily sync workflow will keep producing.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 20:33
@netlify

netlify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for powershellorg ready!

Name Link
🔨 Latest commit 8e4deea
🔍 Latest deploy log https://app.netlify.com/projects/powershellorg/deploys/6aff5f73b6afc6c1f897c9c8
😎 Deploy Preview https://deploy-preview-635--powershellorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🟢 up 1 from production)
Accessibility: 95 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

- upcomingOccurrences always started at the current UTC month, so running the
  sync after today's call had ended still counted it toward the 3-occurrence
  window, leaving only 2 truly upcoming calls.
- Now skips (without consuming a slot) any occurrence whose endDate is already
  past `from`, with regression tests for both sides of that boundary.
- Wire sync-community-call.test.mjs into build.yml, next to the meetup test,
  so CI actually runs it.
- Regenerate the seed calendar files with the corrected window.

Copilot AI 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.

🟡 Changes recommended

Critical sync defects can overwrite historical content, revert resolved event dates and agenda links, and generate November–December 2026 calls despite the last-call-of-the-year announcement.

3 open issues
What changed in this PR

Adds PowerShell Community Call events to the site’s calendar and subscription feed, with automated scheduling and links to agenda discussions.

Changes:

  • Generates three months of events with Pacific daylight-saving handling and discussion-based date overrides.
  • Adds a daily and manually triggered workflow that opens synchronization PRs.
  • Seeds initial events, displays agenda links on calendar cards, and adds synchronization tests.
File Description
themes/​powershell-community/​layouts/​_default/​calendar.html Displays agenda links when available.
content/​calendar/​community-call-2027-01.md Seeds the January 2027 event.
content/​calendar/​community-call-2026-12.md Seeds the December 2026 event.
content/​calendar/​community-call-2026-11.md Seeds the November 2026 event.
.github/​workflows/​community-call-sync.yml Runs synchronization and opens update PRs.
.github/​scripts/​sync-community-call.test.mjs Tests scheduling, date conversion, agenda matching, and sync planning.
.github/​scripts/​sync-community-call.mjs Computes event dates, fetches agendas, and writes calendar entries.

Review effort: Balanced

Comment thread .github/scripts/sync-community-call.mjs Outdated
Comment on lines +69 to +70
const day = thirdThursday(normalizedYear, normalizedMonth);
occurrences.push({
const parsed = parseAgendaTitle(discussion.title);
if (!parsed) return occurrences;

const index = occurrences.findIndex((occurrence) => occurrence.monthIndex === parsed.monthIndex);
Comment on lines +214 to +217
const discussion = await fetchLatestAgendaDiscussion(token);
const occurrences = applyAgendaDiscussion(upcomingOccurrences(HORIZON_MONTHS), discussion);
const existing = await calendarFiles();
const { changes } = communityCallSyncPlan(existing, occurrences);
Copilot AI balanced review requested due to automatic review settings November 19, 2026 20:38
- New cancelled/cancelledReason frontmatter fields, usable by any calendar entry.
- sync-community-call.mjs treats a cancelled managed file as frozen: the daily
  sync never overwrites its date or un-cancels it (isCancelled, with tests).
- calendar.html shows a muted "Cancelled" card (upcoming) or badge (past)
  instead of a join CTA.
- event.ics now emits STATUS:CANCELLED for cancelled events.
- Mark November and December 2026's PowerShell Community Call cancelled for
  the holidays.

Copilot AI 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.

🟡 Changes recommended

Agenda matching ignores explicit years, allowing stale discussions to replace upcoming calls and overwrite historical entries, while reschedule handling can discard or reset valid updates.

4 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve other months’ reschedules when updating an agenda

.github/​scripts/​sync-community-call.mjs:141

When a new month's agenda becomes the latest discussion, this loop overwrites every in-horizon file using defaults for the other months. For example, publishing December's agenda on November 18 resets a previously rescheduled November 30 call to November 19 and removes its agenda link. Fetch and apply an agenda for each month, or preserve each managed file's resolved date and link unless an authoritative update for that month is available.

Review effort: Balanced

if (!token) throw new Error('GITHUB_TOKEN is required to look up the community call agenda discussion.');

const discussion = await fetchLatestAgendaDiscussion(token);
const occurrences = applyAgendaDiscussion(upcomingOccurrences(HORIZON_MONTHS), discussion);
Copilot AI balanced review requested due to automatic review settings November 19, 2026 20:43
- event.ics: my earlier edit replaced the "color" dict entry instead of adding
  "status" alongside it, silently dropping COLOR:7C3AED from every calendar
  event. Restored it.
- Verified with a real `hugo` build (not available in the earlier sandbox) that
  `cond .Params.cancelled "CANCELLED" "CONFIRMED"` does not crash the ICS
  template on events without the field (Hugo treats nil as falsy here) and
  that STATUS/COLOR render correctly for both cancelled and normal events.
- Regenerated assets/css/tailwind.css for the new cancelled-state utility
  classes (line-through, bg-red-100, opacity-75, etc.), which CI's
  'Verify generated assets are up to date' check correctly caught as stale.
- Output of npm run build:css after the calendar.html cancelled-state classes.

Copilot AI 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.

🟡 Changes recommended

The sync can match stale agendas across years and overwrite historical event files, omit upcoming rescheduled calls, and trigger committed-assets check failures when cancellation styling changes with the date.

5 open issues
1 file not reviewed
  • assets/css/tailwind.css: Generated file

Review effort: Balanced

<div class="flex items-center justify-between">
<div>
<h3 class="font-semibold text-gray-700">{{ .Title }}</h3>
<h3 class="font-semibold text-gray-700">{{ .Title }}{{ if .Params.cancelled }} <span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-red-100 text-red-700 align-middle">Cancelled</span>{{ end }}</h3>

This branch has not been deployed

No deployments
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.

2 participants