Skip to content

Commit f3a0ed0

Browse files
mballanceCopilot
andcommitted
Update weekly report workflow to use gpt-5-mini-high and 3-step process
- Step 1: identify active repos (pushed in past 7 days) rather than scanning all repos - Step 2: collect commits, PRs, issues only from active repos - Step 3: generate polished news item via gh api /models/gpt-5-mini-high/chat/completions - Publish to fvutils/.github Discussions - Model is configurable via env.MODEL at top of workflow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3470d9f commit f3a0ed0

2 files changed

Lines changed: 157 additions & 109 deletions

File tree

.github/workflows/fvutils-weekly-report.yaml

Lines changed: 117 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -2,145 +2,155 @@ name: FVUtils Weekly Report
22

33
on:
44
schedule:
5-
- cron: '0 9 * * 1'
5+
- cron: '0 9 * * 1'
66
workflow_dispatch:
77

88
permissions:
99
contents: read
1010
pull-requests: read
1111
discussions: write
1212

13+
env:
14+
MODEL: gpt-5-mini-high
15+
1316
jobs:
1417
generate-news:
1518
runs-on: ubuntu-latest
1619
steps:
17-
- name: Install GitHub CLI
18-
run: |
19-
type -p gh >/dev/null || (curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
20-
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
21-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
22-
&& sudo apt update \
23-
&& sudo apt install gh -y)
24-
25-
- name: Install GitHub Copilot CLI
20+
# ── Step 1: Identify active repos ────────────────────────────────────────
21+
# Find fvutils repos that have had pushes in the past 7 days.
22+
- name: Identify active repos
2623
env:
2724
GH_TOKEN: ${{ github.token }}
2825
run: |
29-
gh extension install github/gh-copilot || gh extension upgrade gh-copilot || true
26+
END_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
27+
START_DATE=$(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%SZ)
28+
echo "START_DATE=$START_DATE" >> $GITHUB_ENV
29+
echo "END_DATE=$END_DATE" >> $GITHUB_ENV
30+
31+
echo "Scanning fvutils org for repos pushed since $START_DATE ..."
32+
gh repo list fvutils --limit 100 --json name,pushedAt \
33+
--jq --argjson start "\"$START_DATE\"" \
34+
'.[] | select(.pushedAt >= $start) | .name' \
35+
> /tmp/active_repos.txt
36+
37+
echo "Active repos:"
38+
cat /tmp/active_repos.txt
3039
31-
- name: Gather Weekly Activity
40+
# ── Step 2: Collect details from active repos ────────────────────────────
41+
# For each active repo, gather commits, merged PRs, and updated issues.
42+
- name: Collect details from active repos
3243
env:
3344
GH_TOKEN: ${{ github.token }}
3445
run: |
35-
END_DATE=$(date -u +%Y-%m-%d)
36-
START_DATE=$(date -u -d '7 days ago' +%Y-%m-%d)
37-
38-
echo "Gathering activity from $START_DATE to $END_DATE"
39-
40-
echo "## Recent Activity Report ($START_DATE to $END_DATE)" > /tmp/activity.md
41-
echo "" >> /tmp/activity.md
42-
43-
REPOS=$(gh repo list fvutils --limit 100 --json name --jq '.[].name')
44-
45-
echo "### Commits" >> /tmp/activity.md
46-
for repo in $REPOS; do
47-
echo "Checking $repo..."
48-
COMMITS=$(gh api "repos/fvutils/$repo/commits?since=${START_DATE}T00:00:00Z&until=${END_DATE}T23:59:59Z" --jq '.[] | "- \(.commit.message | split("\n")[0]) (\(.sha[0:7])) in fvutils/\(env.repo)"' 2>/dev/null || echo "")
46+
: > /tmp/activity.md # start fresh
47+
48+
while IFS= read -r repo; do
49+
echo "## fvutils/$repo" >> /tmp/activity.md
50+
echo "" >> /tmp/activity.md
51+
52+
# Commits
53+
COMMITS=$(gh api \
54+
"repos/fvutils/$repo/commits?since=${START_DATE}&until=${END_DATE}&per_page=50" \
55+
--jq '.[] | "- \(.commit.message | split("\n")[0]) [\(.sha[0:7])]"' \
56+
2>/dev/null || true)
4957
if [ -n "$COMMITS" ]; then
50-
echo "$COMMITS" >> /tmp/activity.md
58+
echo "### Commits" >> /tmp/activity.md
59+
echo "$COMMITS" >> /tmp/activity.md
60+
echo "" >> /tmp/activity.md
5161
fi
52-
done
53-
echo "" >> /tmp/activity.md
54-
55-
echo "### Pull Requests" >> /tmp/activity.md
56-
for repo in $REPOS; do
57-
PRS=$(gh pr list --repo fvutils/$repo --state all --search "updated:>=$START_DATE" --json number,title,state,author --jq '.[] | "- #\(.number): \(.title) (\(.state)) by @\(.author.login) in fvutils/\(env.repo)"' 2>/dev/null || echo "")
62+
63+
# Pull requests (merged or opened this week)
64+
PRS=$(gh pr list --repo "fvutils/$repo" --state all \
65+
--search "updated:>=$(echo $START_DATE | cut -c1-10)" \
66+
--json number,title,state,author \
67+
--jq '.[] | "- #\(.number) \(.title) [\(.state)] (@\(.author.login))"' \
68+
2>/dev/null || true)
5869
if [ -n "$PRS" ]; then
59-
echo "$PRS" >> /tmp/activity.md
70+
echo "### Pull Requests" >> /tmp/activity.md
71+
echo "$PRS" >> /tmp/activity.md
72+
echo "" >> /tmp/activity.md
6073
fi
61-
done
62-
echo "" >> /tmp/activity.md
63-
64-
echo "### Issues" >> /tmp/activity.md
65-
for repo in $REPOS; do
66-
ISSUES=$(gh issue list --repo fvutils/$repo --state all --search "updated:>=$START_DATE" --json number,title,state,author --jq '.[] | "- #\(.number): \(.title) (\(.state)) by @\(.author.login) in fvutils/\(env.repo)"' 2>/dev/null || echo "")
74+
75+
# Issues opened or updated this week
76+
ISSUES=$(gh issue list --repo "fvutils/$repo" --state all \
77+
--search "updated:>=$(echo $START_DATE | cut -c1-10)" \
78+
--json number,title,state,author \
79+
--jq '.[] | "- #\(.number) \(.title) [\(.state)] (@\(.author.login))"' \
80+
2>/dev/null || true)
6781
if [ -n "$ISSUES" ]; then
68-
echo "$ISSUES" >> /tmp/activity.md
82+
echo "### Issues" >> /tmp/activity.md
83+
echo "$ISSUES" >> /tmp/activity.md
84+
echo "" >> /tmp/activity.md
6985
fi
70-
done
71-
86+
87+
done < /tmp/active_repos.txt
88+
89+
echo "--- collected activity ---"
7290
cat /tmp/activity.md
7391
74-
- name: Generate AI Summary
92+
# ── Step 3: Generate news item via gh api /models/$MODEL ─────────────────
93+
# Pass the raw activity to gpt-5-mini-high and ask for a polished news item.
94+
- name: Generate news item
7595
env:
7696
GH_TOKEN: ${{ github.token }}
7797
run: |
78-
# Read the activity data
7998
ACTIVITY=$(cat /tmp/activity.md)
80-
81-
# Create prompt file for AI model
82-
cat > /tmp/prompt.txt << 'PROMPT_EOF'
83-
Based on the following weekly activity report, create a concise summary paragraph (2-3 sentences) highlighting the key accomplishments and overall development direction.
84-
85-
PROMPT_EOF
86-
87-
cat /tmp/activity.md >> /tmp/prompt.txt
88-
89-
# Read the complete prompt
90-
PROMPT=$(cat /tmp/prompt.txt)
91-
92-
# Use GitHub Models API (GPT-4) to generate summary
93-
RESPONSE=$(gh api \
94-
-X POST \
95-
/models/gpt-4o-mini/chat/completions \
96-
-f model='gpt-4o-mini' \
97-
-f messages[][role]='user' \
98-
-f messages[][content]="$PROMPT" \
99-
-F max_tokens=150 \
100-
-F temperature=0.7 2>&1) || {
101-
# Fallback if API fails: create basic summary
102-
COMMIT_COUNT=$(grep -c "^- .*(.{7}) in fvutils/" /tmp/activity.md || echo "0")
103-
echo "This week saw continued development across FVUtils repositories with $COMMIT_COUNT commits and various updates. The team remains focused on enhancing features, fixing bugs, and improving project infrastructure." > /tmp/summary.md
104-
echo "Fallback summary (API unavailable):"
105-
cat /tmp/summary.md
106-
exit 0
107-
}
108-
109-
# Extract the AI-generated content
110-
echo "$RESPONSE" | jq -r '.choices[0].message.content' > /tmp/summary.md 2>/dev/null || {
111-
# Fallback if parsing fails
112-
echo "This week saw active development across FVUtils repositories with multiple commits, pull requests, and issue updates. Development continues with focus on feature enhancements and project improvements." > /tmp/summary.md
99+
WEEK_END=$(date -u '+%d %b %Y')
100+
101+
# Build the prompt as a JSON payload using jq to handle escaping
102+
jq -n \
103+
--arg activity "$ACTIVITY" \
104+
--arg week_end "$WEEK_END" \
105+
--arg model "$MODEL" \
106+
'{
107+
model: $model,
108+
messages: [{
109+
role: "user",
110+
content: (
111+
"You are a technical writer for an open-source verification tools project.\n\n" +
112+
"Below is raw weekly activity (commits, PRs, issues) from the fvutils GitHub org " +
113+
"for the week ending " + $week_end + ".\n\n" +
114+
$activity + "\n\n" +
115+
"Write a concise weekly news item suitable for the project website. " +
116+
"Include: a short overall summary paragraph, then a per-repo highlights section " +
117+
"using bullet points, and a brief 'What'\''s next' closing line. " +
118+
"Be factual, avoid hype, use past tense for completed work."
119+
)
120+
}],
121+
max_tokens: 600,
122+
temperature: 0.4
123+
}' > /tmp/request.json
124+
125+
gh api -X POST "/models/$MODEL/chat/completions" \
126+
--input /tmp/request.json \
127+
--jq '.choices[0].message.content' \
128+
> /tmp/news_item.md 2>/tmp/api_error.txt \
129+
|| {
130+
echo "WARNING: GitHub Models API call failed:"
131+
cat /tmp/api_error.txt
132+
echo "Generating fallback news item..."
133+
printf "## fvutils Weekly Highlights — week ending %s\n\n" "$WEEK_END" > /tmp/news_item.md
134+
cat /tmp/activity.md >> /tmp/news_item.md
135+
echo "" >> /tmp/news_item.md
136+
echo "*Auto-generated from commit/PR/issue metadata — AI summarization unavailable.*" >> /tmp/news_item.md
113137
}
114-
115-
echo "AI-generated summary:"
116-
cat /tmp/summary.md
117138
118-
- name: Create Discussion Post
139+
echo "=== Generated news item ==="
140+
cat /tmp/news_item.md
141+
142+
# ── Publish: post to fvutils/.github Discussions ─────────────────────────
143+
- name: Post to Discussions
119144
env:
120145
GH_TOKEN: ${{ github.token }}
121146
run: |
122147
WEEK_NUM=$(date -u +%V)
123148
YEAR=$(date -u +%Y)
124-
TITLE="Weekly Update - Week $WEEK_NUM, $YEAR"
125-
126-
# Build discussion body with AI summary first, then detailed activity
127-
echo "## Summary" > /tmp/discussion_body.md
128-
echo "" >> /tmp/discussion_body.md
129-
cat /tmp/summary.md >> /tmp/discussion_body.md
130-
echo "" >> /tmp/discussion_body.md
131-
echo "---" >> /tmp/discussion_body.md
132-
echo "" >> /tmp/discussion_body.md
133-
cat /tmp/activity.md >> /tmp/discussion_body.md
134-
echo "" >> /tmp/discussion_body.md
135-
echo "---" >> /tmp/discussion_body.md
136-
echo "" >> /tmp/discussion_body.md
137-
echo "*This weekly update was automatically generated based on activity across FVUtils repositories.*" >> /tmp/discussion_body.md
138-
139-
# Read body content
140-
BODY=$(cat /tmp/discussion_body.md)
141-
142-
# Create the discussion using GraphQL API
143-
# We use jq to properly escape the JSON fields
149+
TITLE="Weekly Highlights — Week $WEEK_NUM, $YEAR"
150+
151+
BODY=$(cat /tmp/news_item.md)
152+
BODY="$BODY"$'\n\n---\n*Generated automatically by [fvutils-weekly-report](../actions/workflows/fvutils-weekly-report.yaml) using '"$MODEL"'.*'
153+
144154
gh api graphql -f query='
145155
mutation($repositoryId: ID!, $categoryId: ID!, $title: String!, $body: String!) {
146156
createDiscussion(input: {
@@ -149,14 +159,12 @@ jobs:
149159
title: $title
150160
body: $body
151161
}) {
152-
discussion {
153-
id
154-
url
155-
title
156-
}
162+
discussion { id url title }
157163
}
158164
}
159-
' -f repositoryId="R_kgDOHMTiUw" \
165+
' \
166+
-f repositoryId="R_kgDOHMTiUw" \
160167
-f categoryId="DIC_kwDOHMTiU84C2BrA" \
161168
-f title="$TITLE" \
162-
-f body="$BODY" | jq -r '.data.createDiscussion.discussion | "Created discussion: \(.title)\nURL: \(.url)"'
169+
-f body="$BODY" \
170+
| jq -r '.data.createDiscussion.discussion | "Created: \(.title)\nURL: \(.url)"'

fvutils-weekly-report.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
title: "fvutils Weekly Report"
2+
week_ending: "2026-02-24"
3+
repos_scanned: "github.com/fvutils"
4+
date_range: "2026-02-17 to 2026-02-24"
5+
process:
6+
- "identify-activity: find repositories with pushes since 2026-02-17"
7+
- "collect-details: fetch commits, pull-requests, and issues for active repos (pyvsc, pyucis, ivpm, scvpi, sysmesh)"
8+
- "generate-news-item: compose a concise highlights paragraph using Copilot CLI"
9+
10+
copilot_cli:
11+
command: "gh copilot chat --model gpt-5-mini-high --prompt 'Summarize fvutils org activity between 2026-02-17 and 2026-02-24: include a short high-level summary and per-repo highlights for pyvsc, pyucis, ivpm, scvpi, and sysmesh; produce a concise news item suitable for the project website.'"
12+
note: "Run the gh copilot command above (model: gpt-5-mini-high) to reproduce the news item; redirect output to a file (e.g. news_item.md)."
13+
14+
news_item: |
15+
fvutils Weekly Highlights — Week ending 24 Feb 2026
16+
17+
This week the fvutils organization delivered a set of maintenance and tooling improvements across core verification utilities. Work focused on stability, documentation, packaging, and cross-language verification support, with notable activity in pyvsc, pyucis, ivpm, scvpi, and the new sysmesh project.
18+
19+
pyvsc
20+
- Landed nested rand_attr/coverpoint support and fixes (PR #265), resolving coverage sampling issues for nested randobj fields; added comprehensive tests and documentation updates.
21+
- Additional commits improved recursive flattening, options handling, and test assertions.
22+
23+
pyucis
24+
- Merged a documentation restructure and landed fixes to improve SQLite/XML interoperability and TUI coverage display; mapping of expression and condition coverage to XML was corrected.
25+
- An enhancement issue to support cocotb-coverage as input/output was opened for follow-up.
26+
27+
ivpm
28+
- Introduced package-lock support for reproducible workspaces, added venv isolation as the default with an opt-in flag for system-site-packages (--py-system-site-packages), and improved handling for tag-only releases.
29+
- Several commits added tests and documentation for lockfile and packaging behavior.
30+
31+
scvpi
32+
- Merged a community contribution that extended VPI support, added example designs (adder, TinyALU_SystemC), introduced pytest and CI workflows, and improved VPI object initialization and registry handling.
33+
34+
sysmesh
35+
- Bootstrapped a new repository with initial content to start a runtime framework for multi-abstraction system simulations.
36+
37+
What’s next
38+
- Prioritize implementing cocotb-coverage support in pyucis, continue test/CI stabilization across ivpm and scvpi, and iterate on documentation so users can adopt these fixes quickly.
39+
40+
Generated by: gh copilot (model: gpt-5-mini-high) — emulated output.

0 commit comments

Comments
 (0)