Skip to content

Commit

Permalink
Merge pull request #228 from servo/blog-february-2025
Browse files Browse the repository at this point in the history
blog: This month in Servo (February 2025)
  • Loading branch information
delan authored Mar 11, 2025
2 parents a03689a + 7597848 commit 7432cb4
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 12 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,25 @@ And generally we want to exclude...

The suggested workflow for efficiently triaging commits is as follows:

- [List commits that landed in each nightly](#how-to-list-commits-that-landed-in-each-nightly) last month, copying the output to your clipboard
- In your monthly update post, paste that output between a `<!--[commits]` line and a `[/commits]-->` line
- 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))
- [Fetch pull request details](#how-to-list-this-years-pull-request-contributors) for the last two months, as follows:

```
$ tools/list-pull-requests.sh servo/servo 2025-01 2025-02 > tools/pulls-2025-01-2025-02.json
```

- [List commits that landed in each nightly](#how-to-list-commits-that-landed-in-each-nightly) last month, as follows:

```
$ 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
```

- Open commits.txt — for the best ergonomics in VS Code, **Fold All**, then **Change Language Mode** > **Diff**
- For each commit, read the description below to understand its impact (see [§ Hints for writing about changes](#hints-for-writing-about-changes))
- For each commit to be excluded from the post, prefix the line with `-`
- For each commit to be included in the post, prefix the line with `+` then:
- Add a line immediately below of the form ` one or more tags` (four spaces, then space-separated tags)
- To write some notes or additional context, append `; your notes` to that new tags line
- Generate the outline: `tools/generate-outline.sh _posts/xxxx-xx-xx-this-month-in-servo.md`
- Generate the outline: `tools/generate-outline.sh commits.txt`

## Hints for writing about changes

Expand Down
135 changes: 135 additions & 0 deletions _posts/2025-03-10-this-month-in-servo.md

Large diffs are not rendered by default.

Binary file added assets/img/blog/2025-02-directory-listing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/blog/2025-02-egui-dialogs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/blog/february-2025.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tools/generate-outline.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env zsh
# usage: generate-outline.sh <path/to/post.md>
# usage: generate-outline.sh <path/to/output/of/list-commits-by-nightly.txt>
# requires: zsh, rg
set -euo pipefail -o bsdecho -o shwordsplit
if [ $# -lt 1 ]; then >&2 sed '1d;2s/^# //;2q' "$0"; exit 1; fi
Expand All @@ -9,15 +9,15 @@ post_path=${1:a}
cd -- "$(dirname -- "${0:a}")"

# Find all of the tags used when we marked a commit as interesting.
tags=$(< "$post_path" sed '/^<!--\[commits\]$/,/^\[\/commits\]-->$/!d' | rg --pcre2 -o '(?<=^ )([^;]+)' | tr ' ' \\n | sort -u)
tags=$(< "$post_path" rg -v '^ # ' | rg --pcre2 -o '(?<=^ )([^;]+)' | tr ' ' \\n | sort -u)
# For each tag...
for tag in $tags; do
printf '- %s\n' "$tag"
# ...find all of the commits that we marked with that tag. Each commit consists of two lines.
# The first line of the input is of the form `+https://url\t(@author, #123)\tPull request title`.
# The second line of the input is of the form ` one or more tags` or ` tags; notes`.
# Tags must not contain spaces or PCRE regex metacharacters.
< "$post_path" sed '/^<!--\[commits\]$/,/^\[\/commits\]-->$/!d' \
< "$post_path" rg -v '^ # ' \
| rg --pcre2 -B1 --no-context-separator '(?<=^ )(([^;]+ )?'"$tag"'( [^;]+)?)(;|$)' \
| while read -r list_commits_by_nightly_line; do
read -r tags_and_notes_line
Expand Down
19 changes: 18 additions & 1 deletion tools/list-commits-between.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env zsh
# usage: list-commits-between.sh <path/to/servo> <from commit exclusive> <to commit inclusive>
# usage: list-commits-between.sh <path/to/servo> <from commit exclusive> <to commit inclusive> [path/to/pulls.json]
# requires: git
set -euo pipefail -o bsdecho -o shwordsplit
if [ $# -lt 1 ]; then >&2 sed '1d;2s/^# //;2q' "$0"; exit 1; fi
missing() { >&2 echo "fatal: $1 not found"; exit 1; }
> /dev/null command -v git || missing git
pulls_json_path=${${4-/dev/null}:a}
cd -- "$(dirname -- "${0:a}")"

# Given a commit x, if git says x is grafted, then git log w..x will only log x
Expand Down Expand Up @@ -34,4 +35,20 @@ git -C "$1" log --pretty=$'tformat:%H\t%s\t%aE\t%(trailers:key=co-authored-by,va
printf '@%s, ' "$author"
done
printf '#%s)\t%s\n' "$pull_number" "$subject"

# Check if `$4` was set, but use `$pulls_json_path` below.
if [ -n "${4+set}" ]; then
# Get the PR description, strip carriage returns and HTML markup, word wrap to 120 without joining existing
# lines, character wrap to 120, stop before any `---` line, delete empty lines, indent it with four spaces,
# then print the result.
jq -er --argjson number $pull_number 'select(.number == $number) | .body' "$pulls_json_path" \
| tr -d \\r | sed -E 's/<[^>]+>//g' | fmt -s -w 120 | fold -w 120 \
| sed -En '/^---$/q;/^ *$/d;s/^/ # /;p' \
|| : # printf ' %s\n' '[Pull request description not found]'
else
# Print the commit message body, with a hard wrap and an indent.
# This doesn’t work too well, because our repo is configured to concatenate the PR commit
# messages, which often contain a subject only, rather than using the PR description.
git -C "$1" log --pretty=$'tformat:%w(120,4,4)%b' | sed -E '/^ *$/d;/^ Signed-off-by: /d'
fi
done
14 changes: 10 additions & 4 deletions tools/list-commits-by-nightly.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#!/usr/bin/env zsh
# usage: list-commits-by-nightly.sh <path/to/servo>
# usage: list-commits-by-nightly.sh <path/to/servo> [path/to/pulls.json]
# requires: zsh, gh, jq, tac, rg, git
set -eu
set -euo pipefail -o bsdecho -o shwordsplit
if [ $# -lt 1 ]; then >&2 sed '1d;2s/^# //;2q' "$0"; exit 1; fi
missing() { >&2 echo "fatal: $1 not found"; exit 1; }
> /dev/null command -v gh || missing gh
> /dev/null command -v jq || missing jq
> /dev/null command -v tac || missing tac
> /dev/null command -v rg || missing rg
> /dev/null command -v git || missing git
pulls_json_path=${${2-/dev/null}:a}
cd -- "$(dirname -- "${0:a}")"

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

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

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

0 comments on commit 7432cb4

Please sign in to comment.