Skip to content

Commit 7432cb4

Browse files
authored
Merge pull request #228 from servo/blog-february-2025
blog: This month in Servo (February 2025)
2 parents a03689a + 7597848 commit 7432cb4

8 files changed

+181
-12
lines changed

README.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,25 @@ And generally we want to exclude...
355355

356356
The suggested workflow for efficiently triaging commits is as follows:
357357

358-
- [List commits that landed in each nightly](#how-to-list-commits-that-landed-in-each-nightly) last month, copying the output to your clipboard
359-
- In your monthly update post, paste that output between a `<!--[commits]` line and a `[/commits]-->` line
360-
- For each commit, click on the link to read more and understand its impact (see [§ Hints for writing about changes](#hints-for-writing-about-changes))
358+
- [Fetch pull request details](#how-to-list-this-years-pull-request-contributors) for the last two months, as follows:
359+
360+
```
361+
$ tools/list-pull-requests.sh servo/servo 2025-01 2025-02 > tools/pulls-2025-01-2025-02.json
362+
```
363+
364+
- [List commits that landed in each nightly](#how-to-list-commits-that-landed-in-each-nightly) last month, as follows:
365+
366+
```
367+
$ tools/list-commits-by-nightly.sh ~/code/servo tools/pulls-2025-01-2025-02.json 2>&1 | tee /dev/stderr | sed '/^>>> 2025-02-/,/^>>> 2025-03-/!d' > commits.txt
368+
```
369+
370+
- Open commits.txt — for the best ergonomics in VS Code, **Fold All**, then **Change Language Mode** > **Diff**
371+
- For each commit, read the description below to understand its impact (see [§ Hints for writing about changes](#hints-for-writing-about-changes))
361372
- For each commit to be excluded from the post, prefix the line with `-`
362373
- For each commit to be included in the post, prefix the line with `+` then:
363374
- Add a line immediately below of the form ` one or more tags` (four spaces, then space-separated tags)
364375
- To write some notes or additional context, append `; your notes` to that new tags line
365-
- Generate the outline: `tools/generate-outline.sh _posts/xxxx-xx-xx-this-month-in-servo.md`
376+
- Generate the outline: `tools/generate-outline.sh commits.txt`
366377

367378
## Hints for writing about changes
368379

_posts/2025-03-10-this-month-in-servo.md

+135
Large diffs are not rendered by default.
76.9 KB
Loading
20.6 KB
Loading

assets/img/blog/february-2025.png

169 KB
Loading

tools/generate-outline.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env zsh
2-
# usage: generate-outline.sh <path/to/post.md>
2+
# usage: generate-outline.sh <path/to/output/of/list-commits-by-nightly.txt>
33
# requires: zsh, rg
44
set -euo pipefail -o bsdecho -o shwordsplit
55
if [ $# -lt 1 ]; then >&2 sed '1d;2s/^# //;2q' "$0"; exit 1; fi
@@ -9,15 +9,15 @@ post_path=${1:a}
99
cd -- "$(dirname -- "${0:a}")"
1010

1111
# Find all of the tags used when we marked a commit as interesting.
12-
tags=$(< "$post_path" sed '/^<!--\[commits\]$/,/^\[\/commits\]-->$/!d' | rg --pcre2 -o '(?<=^ )([^;]+)' | tr ' ' \\n | sort -u)
12+
tags=$(< "$post_path" rg -v '^ # ' | rg --pcre2 -o '(?<=^ )([^;]+)' | tr ' ' \\n | sort -u)
1313
# For each tag...
1414
for tag in $tags; do
1515
printf '- %s\n' "$tag"
1616
# ...find all of the commits that we marked with that tag. Each commit consists of two lines.
1717
# The first line of the input is of the form `+https://url\t(@author, #123)\tPull request title`.
1818
# The second line of the input is of the form ` one or more tags` or ` tags; notes`.
1919
# Tags must not contain spaces or PCRE regex metacharacters.
20-
< "$post_path" sed '/^<!--\[commits\]$/,/^\[\/commits\]-->$/!d' \
20+
< "$post_path" rg -v '^ # ' \
2121
| rg --pcre2 -B1 --no-context-separator '(?<=^ )(([^;]+ )?'"$tag"'( [^;]+)?)(;|$)' \
2222
| while read -r list_commits_by_nightly_line; do
2323
read -r tags_and_notes_line

tools/list-commits-between.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env zsh
2-
# usage: list-commits-between.sh <path/to/servo> <from commit exclusive> <to commit inclusive>
2+
# usage: list-commits-between.sh <path/to/servo> <from commit exclusive> <to commit inclusive> [path/to/pulls.json]
33
# requires: git
44
set -euo pipefail -o bsdecho -o shwordsplit
55
if [ $# -lt 1 ]; then >&2 sed '1d;2s/^# //;2q' "$0"; exit 1; fi
66
missing() { >&2 echo "fatal: $1 not found"; exit 1; }
77
> /dev/null command -v git || missing git
8+
pulls_json_path=${${4-/dev/null}:a}
89
cd -- "$(dirname -- "${0:a}")"
910

1011
# Given a commit x, if git says x is grafted, then git log w..x will only log x
@@ -34,4 +35,20 @@ git -C "$1" log --pretty=$'tformat:%H\t%s\t%aE\t%(trailers:key=co-authored-by,va
3435
printf '@%s, ' "$author"
3536
done
3637
printf '#%s)\t%s\n' "$pull_number" "$subject"
38+
39+
# Check if `$4` was set, but use `$pulls_json_path` below.
40+
if [ -n "${4+set}" ]; then
41+
# Get the PR description, strip carriage returns and HTML markup, word wrap to 120 without joining existing
42+
# lines, character wrap to 120, stop before any `---` line, delete empty lines, indent it with four spaces,
43+
# then print the result.
44+
jq -er --argjson number $pull_number 'select(.number == $number) | .body' "$pulls_json_path" \
45+
| tr -d \\r | sed -E 's/<[^>]+>//g' | fmt -s -w 120 | fold -w 120 \
46+
| sed -En '/^---$/q;/^ *$/d;s/^/ # /;p' \
47+
|| : # printf ' %s\n' '[Pull request description not found]'
48+
else
49+
# Print the commit message body, with a hard wrap and an indent.
50+
# This doesn’t work too well, because our repo is configured to concatenate the PR commit
51+
# messages, which often contain a subject only, rather than using the PR description.
52+
git -C "$1" log --pretty=$'tformat:%w(120,4,4)%b' | sed -E '/^ *$/d;/^ Signed-off-by: /d'
53+
fi
3754
done

tools/list-commits-by-nightly.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
#!/usr/bin/env zsh
2-
# usage: list-commits-by-nightly.sh <path/to/servo>
2+
# usage: list-commits-by-nightly.sh <path/to/servo> [path/to/pulls.json]
33
# requires: zsh, gh, jq, tac, rg, git
4-
set -eu
4+
set -euo pipefail -o bsdecho -o shwordsplit
55
if [ $# -lt 1 ]; then >&2 sed '1d;2s/^# //;2q' "$0"; exit 1; fi
66
missing() { >&2 echo "fatal: $1 not found"; exit 1; }
77
> /dev/null command -v gh || missing gh
88
> /dev/null command -v jq || missing jq
99
> /dev/null command -v tac || missing tac
1010
> /dev/null command -v rg || missing rg
1111
> /dev/null command -v git || missing git
12+
pulls_json_path=${${2-/dev/null}:a}
1213
cd -- "$(dirname -- "${0:a}")"
1314

1415
# Fetch the default branch, so we can warn if commits aren’t reachable from it.
1516
git -C "$1" fetch https://github.com/servo/servo.git
1617
default_branch_head=$(cut -f 1 "$1/.git/FETCH_HEAD")
1718

1819
if ! [ -e runs.json ]; then
19-
gh api '/repos/servo/servo/actions/workflows/nightly.yml/runs?status=success&per_page=100' > runs.json
20+
gh api '/repos/servo/servo/actions/workflows/nightly.yml/runs?status=success&per_page=62' > runs.json
2021
fi
2122
< runs.json jq -r '.workflow_runs[] | "\(.head_sha)\t\(.updated_at)"' | tac > runs.tsv
2223
< runs.tsv sed -En '1!{H;x;s/\n//;p;x;};s/\t.*//;s/$/\t/;h' \
@@ -36,5 +37,10 @@ fi
3637
>&2 echo "warning: not reachable from default branch: $to"
3738
fi
3839

39-
./list-commits-between.sh "$1" $from $to
40+
# Check if `$2` was set, but use `$pulls_json_path` below.
41+
if [ -n "${2+set}" ]; then
42+
./list-commits-between.sh "$1" $from $to "$pulls_json_path"
43+
else
44+
./list-commits-between.sh "$1" $from $to
45+
fi
4046
done

0 commit comments

Comments
 (0)