Skip to content

feat: add HackMD sync helper#160

Open
barnabasbusa wants to merge 3 commits intomasterfrom
add-hackmd-sync
Open

feat: add HackMD sync helper#160
barnabasbusa wants to merge 3 commits intomasterfrom
add-hackmd-sync

Conversation

@barnabasbusa
Copy link
Copy Markdown
Contributor

Summary

  • Adds md/sync.py, a small helper for syncing devnet spec notes between local markdown files and notes.ethereum.org HackMD team notes.
  • Commands:
    • from-remote <network> — pull a HackMD note into md/<network>.md
    • to-remote <network> — push the local markdown back to HackMD
    • pr <network> [<sync-to-remote>] <github-pr-url> — insert a PR link into the appropriate section, optionally pushing to HackMD
    • sync-prs <network> — refresh status badges for every linked PR (logs only the ones that actually changed) and pushes to HackMD if there were updates
  • Auto-gzips request bodies above ~8KB to dodge the origin WAF size limit on notes.ethereum.org.
  • Uses `HACKMD_TOKEN` (required) and optional `GITHUB_TOKEN` for higher GitHub API rate limits.

Test plan

  • HACKMD_TOKEN=... python3 md/sync.py from-remote <some-team-note> pulls successfully
  • python3 md/sync.py to-remote <network> round-trips a note unchanged
  • python3 md/sync.py sync-prs <network> updates statuses and reports diffs

Add md/sync.py for syncing devnet spec notes between local markdown
files and notes.ethereum.org HackMD team notes. Supports pull/push,
adding GitHub PR links into pre-defined sections, and refreshing PR
statuses in bulk.
Replace the implicit KeyError on os.environ['HACKMD_TOKEN'] with a
SystemExit pointing the user at the API token settings page.
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.

1 participant