Skip to content

Commit ccb8e85

Browse files
authored
ci: make what's new updates incremental (#25817)
## Summary Fix the Sonnet 5 request failure by removing the deprecated temperature setting. Make daily curation incremental: skip the model when there are no unseen merges or expired highlights, review only unseen merge dates when work exists, and retain a manual full-window recalibration option. Generated by Codex
1 parent 1840ddd commit ccb8e85

3 files changed

Lines changed: 71 additions & 10 deletions

File tree

.agents/skills/curate-whats-new/SKILL.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,29 @@ status only when the relative importance of the candidate set changes.
5252
## Procedure
5353

5454
1. Read `data/whats-new.json`.
55-
2. List every PR merged in the requested period:
55+
2. Determine the review mode from the request:
56+
- For an incremental review, list PRs merged from the day after the supplied
57+
checkpoint through the end of the publication window. Retain existing
58+
items inside the publication window without re-reviewing their source PRs.
59+
- For a full review, inspect every PR merged in the supplied publication
60+
window.
61+
3. List PRs in the range that applies to the review mode:
5662

5763
```console
5864
$ gh pr list --repo docker/docs --state merged --search 'merged:START..END' --limit 200
5965
```
6066

61-
3. Inspect the diff and resulting pages for every plausible candidate.
62-
4. Decide what qualifies using only evidence in the merged documentation.
63-
5. Replace `period_start`, `period_end`, and `items` in
67+
If an incremental search returns no PRs, skip candidate inspection and only
68+
remove expired items.
69+
4. Inspect the diff and resulting pages for every plausible new candidate.
70+
5. Decide what qualifies using only evidence in the merged documentation.
71+
6. Remove existing items published before the requested publication window.
72+
Add newly qualifying launches, combine related PRs, and reconsider featured
73+
status across the resulting list. Do not replace or rewrite retained items
74+
merely because they were not part of the incremental candidate range.
75+
7. Replace `period_start`, `period_end`, and `items` in
6476
`data/whats-new.json`. Sort items by `published` date, newest first.
65-
6. Write `.pr-body.md` with the publication period, selected highlights and
77+
8. Write `.pr-body.md` with the publication period, selected highlights and
6678
source PRs, plus concise reasons for plausible exclusions.
6779

6880
Each item must contain `product`, `title`, `description`, `url`, `published`,

.github/agents/whats-new.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ models:
44
provider: anthropic
55
model: claude-sonnet-5
66
max_tokens: 4096
7-
temperature: 0.1
87

98
agents:
109
root:

.github/workflows/update-whats-new.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ name: Update What's New
22

33
on:
44
schedule:
5-
# Review the previous 30 complete UTC days every day at 06:00 UTC.
5+
# Review new merges and expire old highlights every day at 06:00 UTC.
66
- cron: "0 6 * * *"
77
workflow_dispatch:
88
inputs:
99
dry-run:
1010
description: "Propose highlights without opening a pull request"
1111
type: boolean
1212
default: false
13+
full-rescan:
14+
description: "Re-evaluate every pull request in the 30-day window"
15+
type: boolean
16+
default: false
1317

1418
permissions:
1519
contents: write
@@ -40,6 +44,14 @@ jobs:
4044
echo "start=$(date -u -d "$PERIOD_END - 29 days" +%F)" >> "$GITHUB_OUTPUT"
4145
echo "end=$PERIOD_END" >> "$GITHUB_OUTPUT"
4246
47+
- name: Restore curator state
48+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
49+
with:
50+
path: ${{ runner.temp }}/whats-new-state.json
51+
key: whats-new-state-${{ github.repository }}-${{ github.run_id }}
52+
restore-keys: |
53+
whats-new-state-${{ github.repository }}-
54+
4355
- name: Configure AWS credentials
4456
id: aws-credentials
4557
continue-on-error: true
@@ -68,16 +80,47 @@ jobs:
6880
git show "origin/$BRANCH_NAME:data/whats-new.json" > data/whats-new.json
6981
fi
7082
83+
- name: Set review mode and checkpoint
84+
id: review
85+
env:
86+
FULL_RESCAN: ${{ inputs.full-rescan == true }}
87+
PERIOD_END: ${{ steps.period.outputs.end }}
88+
STATE_FILE: ${{ runner.temp }}/whats-new-state.json
89+
run: |
90+
REVIEWED_THROUGH=$(jq -r '.reviewed_through // empty' "$STATE_FILE" 2>/dev/null || true)
91+
if ! [[ "$REVIEWED_THROUGH" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
92+
REVIEWED_THROUGH=$(jq -r '.period_end' data/whats-new.json)
93+
fi
94+
DATA_PERIOD_END=$(jq -r '.period_end' data/whats-new.json)
95+
if [[ "$DATA_PERIOD_END" > "$REVIEWED_THROUGH" ]]; then
96+
REVIEWED_THROUGH=$DATA_PERIOD_END
97+
fi
98+
99+
if [ "$FULL_RESCAN" = "true" ]; then
100+
MODE=full
101+
else
102+
MODE=incremental
103+
fi
104+
105+
jq -n --arg reviewed_through "$PERIOD_END" \
106+
'{reviewed_through: $reviewed_through}' > "$STATE_FILE"
107+
108+
{
109+
echo "mode=$MODE"
110+
echo "reviewed-through=$REVIEWED_THROUGH"
111+
} >> "$GITHUB_OUTPUT"
112+
71113
- name: Curate highlights
72114
uses: docker/docker-agent-action@e96a4bb40cac114f64358621e1d08346c8eadc8c # v2.0.1
73115
env:
74116
GH_TOKEN: ${{ env.GITHUB_APP_TOKEN || github.token }}
75117
with:
76118
agent: ${{ github.workspace }}/.github/agents/whats-new.yaml
77119
prompt: >-
78-
Use the curate-whats-new skill to review documentation pull requests merged from
79-
${{ steps.period.outputs.start }} through
80-
${{ steps.period.outputs.end }}, inclusive.
120+
Use the curate-whats-new skill in ${{ steps.review.outputs.mode }} mode.
121+
The publication window is ${{ steps.period.outputs.start }} through
122+
${{ steps.period.outputs.end }}, inclusive. The last successful incremental
123+
review covered through ${{ steps.review.outputs.reviewed-through }}.
81124
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
82125
github-token: ${{ env.GITHUB_APP_TOKEN || github.token }}
83126
timeout: 1200
@@ -158,3 +201,10 @@ jobs:
158201
--base main \
159202
--head "$BRANCH_NAME"
160203
fi
204+
205+
- name: Save curator state
206+
if: success() && inputs.dry-run != true && steps.changes.outputs.changed != 'true'
207+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
208+
with:
209+
path: ${{ runner.temp }}/whats-new-state.json
210+
key: whats-new-state-${{ github.repository }}-${{ github.run_id }}

0 commit comments

Comments
 (0)