Skip to content

ci(repo): run jobs that make no GitHub API call on free runners - #271

Merged
xsahil03x merged 21 commits into
mainfrom
ci/standard-runners
Nov 27, 2026
Merged

xsahil03x merged 21 commits into
mainfrom
ci/standard-runners

Conversation

@xsahil03x

@xsahil03x xsahil03x commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Why

Since the move to the static-IP github-public-amd64 group, every Linux job is billed per minute. The org IP allow list refuses GITHUB_TOKEN git pushes and GitHub API calls from standard runners, but not git reads of this public repository. Probes on ubuntu-latest against the static-IP group (run 1, run 2): git fetch and actions/checkout with the token succeed, while git push --dry-run, an API write, an API read of issue comments and bot-commit are refused with the allow-list error. GCP auth through OIDC works from both. So jobs that only check out and build can keep actions/checkout on free runners, without the hand-written anonymous checkout of #270; jobs that call the GitHub API stay on the static IPs.

This is the split Android already ships: the shared conventions (GetStream/stream-build-conventions-android#114, v1.5.0) run build, unit tests, static checks and SDK sizes on ubuntu-latest with plain actions/checkout, and keep only the jobs that write to GitHub (size comments, PR checklist, stale PRs, release, gh-pages) on the static-IP group (e.g. GetStream/stream-feeds-android#254). Our windows thumbnail job already checks out with the token on windows-latest.

Changes

  • To ubuntu-latest: analyze, test; the three pana jobs; thumbnail android, linux, web; analyze_legacy_version; analyze_beta_versions; style-guide check.
  • Goldens render and compare on the same runner: test and update_goldens both run on ubuntu-latest, with update_goldens handing the PNGs to a small static-IP job that commits them with bot-commit.
  • Thumbnail ios and macos back to macos-latest from scaleway-macos (ci(repo): use Scaleway macOS runners for IP allow list compatibility #263 moved them on the same assumption).
  • Gallery builds and Google Cloud deploys (PR, beta, prod) on ubuntu-latest; the PR comment runs in small follow-up jobs on the static-IP group, as in stream-video-flutter.
  • The gallery is no longer published to GitHub Pages: flutter.getstream.io/design-system hosts beta and prod, and nothing links to the github.io copy.
  • detect_changes.yml: a reusable workflow that tells whether a pull request or push changes any of a list of globs, diffing with git on ubuntu-latest instead of the GitHub API that dorny/paths-filter calls. legacy_version_analyze's gate is the first caller.
  • Unchanged on the static-IP group: anything else that calls the GitHub API (labels, PR title, release, tag, sync PRs).
  • persist-credentials: false on every checkout except the two that git push with the stored token (publish_gallery gh-pages, release_tag tags).
  • Every external action pinned to a commit SHA with its version as a comment; checkout@v3/@v4 bumped to v6.
  • Dependabot keeps the pins current, in the workflows and the composite actions under .github/actions/*: one grouped github-actions PR a week, same shape as stream-chat-flutter, with a 7-day cooldown on new releases.
  • pull-requests: read dropped where nothing reads pull requests; Codecov uploads only the listed reports (disable_search).
  • Dropped fetch-depth: 0 from the moved analyze/test jobs; nothing reads history.
  • The shared actions note the runner they need: bot-commit and flutter-web-pr-comment the static-IP group, the flutter-web deploy, remove and target actions any (Linux) runner.

Validation

  • This PR's own runs use the changed workflows: every moved job passes on ubuntu-latest / macos-latest, including the legacy-analysis gate, and actionlint reports nothing new.
  • pr_web_build, by labeling this PR build and removing it (deploy, remove): the preview deployed from ubuntu-latest and served, the link comment posted, then the build was removed and the comment updated.
  • update_goldens, on a branch with one golden deleted: the render job on ubuntu-latest handed the goldens to the static-IP job, which committed exactly that file back, byte-identical.
    🤖 Generated with Claude Code

The org IP allow list refuses GITHUB_TOKEN writes from standard runners
but not reads of this public repository, so jobs that only read keep
actions/checkout and move to ubuntu-latest. Jobs that push, tag, release,
comment or label stay on the static-IP group.

Checkouts no longer persist the token unless a later step pushes with
git, and every external action is pinned to a commit SHA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x
xsahil03x requested a review from a team as a code owner November 27, 2026 13:30
@github-actions github-actions Bot added the ready Pull request ready to be reviewed label Nov 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xsahil03x and others added 5 commits November 27, 2026 14:40
The job only reads the repository, which the IP allow list permits from
standard runners, so it returns to macos-latest from scaleway-macos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the iOS build, the job only reads the repository, so it returns to
macos-latest from scaleway-macos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bot-commit and flutter-web-pr-comment call the GitHub API, which the org
IP allow list refuses from standard runners. The flutter-web deploy,
remove and target actions make no GitHub call and run anywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "/" directory covers only .github/workflows, so the actions under
.github/actions, which other repositories run, were left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop `pull-requests: read` where no step reads pull requests.
- Upload only the listed coverage files, so Codecov stops picking up an
  IDE run configuration as a report.
- Name action-slack's pin by the release it matches (v3.19.0), so
  Dependabot can compare it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added pending Review comments waiting to be addressed and removed ready Pull request ready to be reviewed labels Nov 27, 2026
xsahil03x and others added 3 commits November 27, 2026 15:05
update_goldens renders on the static-IP runners' ubuntu-24.04, while
ubuntu-latest is now 26.04, so test pins 24.04 to keep regenerated
goldens matching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update_goldens rendered on the static-IP group, whose image an admin can
change without us noticing. It now renders on ubuntu-24.04, the image
`test` compares on, and only the commit through the API runs on the
static-IP group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both jobs are on free runners now, so they follow the same label without
a pinned image to bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x xsahil03x added ready Pull request ready to be reviewed and removed pending Review comments waiting to be addressed labels Nov 27, 2026
Comment thread .github/workflows/pr_web_build.yml Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See video: https://github.com/GetStream/stream-video-flutter/blob/v2/.github/workflows/pr_web_build.yml
This can run on generic runners, only the PR comment should run on github-public-amd64

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f69e443, following video's layout: deploy and remove run on ubuntu-latest, and the comment moved into comment / remove_comment jobs on github-public-amd64. The release workflow's prod gallery deploy moved too, since it only builds and deploys to GCP.

@github-actions github-actions Bot added pending Review comments waiting to be addressed and removed ready Pull request ready to be reviewed labels Nov 27, 2026
Comment thread .github/workflows/publish_gallery.yml Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check if we can also run this on generic runners, only the actual push/commit to github has to run on github-public-amd64, see for example update_goldens in video: https://github.com/GetStream/stream-video-flutter/blob/v2/.github/workflows/update_goldens.yml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f69e443: build_gallery builds on ubuntu-latest and uploads build/web; publish_pages on github-public-amd64 downloads it and runs the same commit and force-push to gh-pages that flutter-gh-pages did, so that action is gone. deploy_hosted (GCP only) moved to ubuntu-latest as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: dropped the GitHub Pages deploy instead (9782b46). flutter.getstream.io/design-system now hosts beta and prod, and nothing links to the github.io copy, so publish_gallery is just deploy_hosted on ubuntu-latest. After merge I'll point the repo's website field at flutter.getstream.io/design-system/, turn off Pages and delete gh-pages.

Building and deploying to Google Cloud make no GitHub API call, so the
PR, beta and prod gallery deploys move to ubuntu-latest. Only the steps
that call GitHub stay on the static-IP group: the PR comment, and the
gh-pages push, which now commits a build made in a separate job instead
of building inside flutter-gh-pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xsahil03x and others added 3 commits November 27, 2026 15:38
The GitHub Pages build also uses the bootstrap action, as the
flutter.getstream.io deploy beside it does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
flutter.getstream.io/design-system hosts the gallery's beta and prod
builds, and nothing links to the GitHub Pages copy, so the gh-pages
build and push go, along with their static-IP job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added approved Approved by a reviewer and removed pending Review comments waiting to be addressed labels Nov 27, 2026
xsahil03x and others added 7 commits November 27, 2026 16:43
With an empty token, paths-filter diffs pull requests with git against
the base branch instead of the GitHub API, which the org IP allow list
refuses from standard runners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pull request's test merge commit has the base branch as its first
parent, so diffing the last two commits lists the pull request's
changes without paths-filter or a token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without --no-renames git lists a moved file only under its new path, so a
pull request moving a file out of packages/ skipped the analysis, unlike
paths-filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
detect_changes.yml tells whether a pull request or push changes any of
the given globs, diffing with git instead of the GitHub API that
dorny/paths-filter calls, so gates run on free runners without a token.
Chat and chat-ai gate five workflows with paths-filter and can switch to
it. The legacy-analysis gate is the first caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…workflows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jobs that main's ruleset requires as status checks keep their IDs as
their names, since a required check is matched by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run the legacy analysis when its gate fails: a skipped required check
  passes, so a broken gate would have let every pull request through.
  detect_changes.yml's example now shows the same condition.
- Run it when a draft is marked ready for review, which kept the skipped
  check green until the next push.
- Queue the pull request web build's comment jobs in one group, so a late
  link comment can't overwrite "removed".
- Note in CLAUDE.md which jobs need the static-IP runners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x xsahil03x changed the title ci(repo): run read-only jobs on free standard runners ci(repo): run jobs that make no GitHub API call on free runners Nov 27, 2026
@xsahil03x xsahil03x added the build Deploy this pull request's web build to flutter.getstream.io/<app>/pr/<number>/ label Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Web build (design-system): removed.

@xsahil03x xsahil03x removed the build Deploy this pull request's web build to flutter.getstream.io/<app>/pr/<number>/ label Nov 27, 2026
@xsahil03x
xsahil03x deployed to flutter-web-pr November 27, 2026 16:08 — with GitHub Actions Active
@xsahil03x
xsahil03x merged commit ab35fa0 into main Nov 27, 2026
49 of 50 checks passed
@xsahil03x
xsahil03x deleted the ci/standard-runners branch November 27, 2026 16:30
xsahil03x added a commit that referenced this pull request Nov 27, 2026
bot-commit at #271's merge pins its own github-script by SHA, and the
minted token only gets `contents: write`, all bot-commit needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
flutter-web-pr — c5728725 Deployed Nov 27, 2026 by xsahil03x via Remove Build #151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Approved by a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants