Skip to content

feat: changelog - #851

Open
sheepzh wants to merge 2 commits into
mainfrom
changelog
Open

feat: changelog#851
sheepzh wants to merge 2 commits into
mainfrom
changelog

Conversation

@sheepzh

@sheepzh sheepzh commented Jul 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.36%. Comparing base (5132bf6) to head (ceb3e88).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #851   +/-   ##
=======================================
  Coverage   61.36%   61.36%           
=======================================
  Files          54       54           
  Lines        2112     2112           
  Branches      498      500    +2     
=======================================
  Hits         1296     1296           
  Misses        644      644           
  Partials      172      172           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI lite review requested due to automatic review settings August 9, 2026 06:56

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

Adds a small scripting pipeline to parse CHANGELOG.md and sync release notes to Firefox Add-ons (AMO), including a simple token-bucket throttler and JWT-based authentication for the AMO API.

Changes:

  • Introduce a Throttler utility for rate-limiting script requests.
  • Add Firefox AMO helpers to list versions and patch release notes.
  • Add a changelog pipeline script to parse CHANGELOG.md and update AMO notes; update changelog formatting and add JWT dependencies.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
script/util/throttler.ts New token-bucket throttler used to rate-limit AMO API calls.
script/pipeline/firefox.ts New AMO API integration (JWT auth, list versions, patch release notes).
script/pipeline/changelog.ts New CLI script to parse CHANGELOG.md and drive AMO release-note updates.
package.json Adds jsonwebtoken and its types for the new pipeline scripts.
CHANGELOG.md Normalizes some changelog formatting/content for parsing and display.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to +17
import { readFileSync } from 'fs'
import { join } from 'path'
import { createArrayGuard, createObjectGuard, createOptionalGuard, createStringUnionGuard, isBoolean } from 'typescript-guard'
import { fileURLToPath } from 'url'
import { parseArgs, ParseArgsOptionsConfig } from 'util'
import { version as current } from '../../package.json'
import { exitWith } from '../util/process'
import { listFirefoxVersions, updateFirefoxReleaseNote } from './firefox'

type ChangeLog = {
version: string
date: string
changes: string[]
}

function parseChangelog(): ChangeLog[] {
const filePath = join(fileURLToPath(import.meta.url), '..', '..', '..', 'CHANGELOG.md')
Comment thread script/util/throttler.ts
Comment on lines +2 to +19
private tokens: number
private listRefillTs: number

constructor(private readonly capacity: number, private readonly refillRate: number) {
if (capacity <= 0) throw new Error('Capacity must be positive')
if (refillRate <= 0) throw new Error('Refill rate must be positive')
this.tokens = capacity
this.listRefillTs = Date.now() / 1000
}

#refill(): void {
const now = Date.now() / 1000
const elapsed = now - this.listRefillTs
if (elapsed > 0) {
const added = elapsed * this.refillRate
this.tokens = Math.min(this.capacity, this.tokens + added)
this.listRefillTs = now
}
Comment on lines +76 to +77
// one request per 20 seconds
const UPDATE_THROTTLER = new Throttler(1, 1 / 21)
const jsonResp = await response.json()
if (!isVersion(jsonResp)) {
console.log(JSON.stringify(jsonResp, null, 2))
throw new Error('Errored to update Firefox version.')
Comment on lines +25 to +27
const TOKEN = generateJwtToken()
const HEADERS = { Authorization: `jwt ${TOKEN}` } as const
const THROTTLER = new Throttler(1, 1)
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