Files
zed/.github/workflows/community_pr_board_refresh.yml
T
Lena 4c90ed88c3 Add more fields to the community PR board (#66617)
- Last push: the head commit's committer date, which moves with rebases
and merges from `main`.
- Merge conflicts
- Opened with no self-review: that's the `no self-review` label.

The Upvotes field now also counts comments and reviews too (and still
deduplicates per person).

The daily refresh had hit its 15-minute timeout many times so it now
fetches board items in batches of 10 (one at a time if a batch fails),
writes only values that changed, asks GitHub again for mergeability it
hasn't computed yet, and fails the run if any PR failed instead of
exiting successfully.

In `github_helpers.py`, `set_github_project_field` now handles number,
date and text fields, clears a field for `None` and can skip missing
fields. `is_staff_member` reads the staff team once per run. Requests
share one HTTP session. Rate-limited requests are retried, writes
included, as are project field writes that hit transient errors.

The refresh workflow is renamed to "Community PR Board Signals Refresh"
(also in the Slack failure notifier) for moar consistency, and it gets
members:read for the staff list.

## Testing

Ran from my machine and it worked (after two fix-ups)

Release Notes:

- N/A
2026-11-06 14:32:34 +00:00

63 lines
1.9 KiB
YAML

# Community PR Board — daily signal fields refresh
#
# Walks every open PR on the community board and recomputes its signal
# fields. Backstop for changes that don't reach the event-driven workflow,
# either because the relevant webhook isn't subscribed or doesn't fire at all.
name: Community PR Board Signals Refresh
on:
schedule:
- cron: "0 9 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: community-pr-board-refresh
cancel-in-progress: true
jobs:
refresh:
if: github.repository == 'zed-industries/zed'
runs-on: namespace-profile-2x4-ubuntu-2404
timeout-minutes: 15
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
with:
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
owner: zed-industries
repositories: zed
permission-issues: read
permission-members: read
permission-organization-projects: write
permission-pull-requests: read
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
sparse-checkout: |
script/github-community-pr-board.py
script/github_helpers.py
sparse-checkout-cone-mode: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- name: Install dependencies
run: pip install requests
- name: Refresh all board items
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
PROJECT_NUMBER: "85"
REFRESH_ALL: "1"
run: python script/github-community-pr-board.py