Skip to content

ci: add Dependabot, dependency review and Gradle dependency submission - #192

Open
testableapple wants to merge 2 commits into
mainfrom
ci/dependabot-dependency-review
Open

testableapple wants to merge 2 commits into
mainfrom
ci/dependabot-dependency-review

Conversation

@testableapple

@testableapple testableapple commented Dec 4, 2026 •

Copy link
Copy Markdown

Problem

Nothing in this repo checks a pull request for dependencies with known vulnerabilities, and nothing keeps the GitHub Actions the workflows use up to date. The workflows also refer to actions by tag, and a tag can be moved to different code later.

Part of CHA-7207. The process is described in DevSecOps for SDK repositories. The client SDK repos get the same setup, for example in stream-chat-swift#4446.

Solution

  • Dependency Review (dependency_review.yml): a check on every pull request that fails when the PR adds or changes a dependency to a version with a known vulnerability. It also shows the OpenSSF Scorecard of each changed dependency and warns below 3. For it to see Gradle dependencies, the workflow has three jobs that run one after another:
    • Resolve the Gradle dependencies on ubuntu-26.04: GitHub cannot read Gradle dependencies from the build files, so Gradle resolves them into a list. Only the runtime classpath of the published library is listed, without the test classpaths and the build tooling.
    • Dependency Submission on the github-public-amd64 runner group: submits that list. It needs contents: write, and only that job has it.
    • Dependency Review runs after the submission. GitHub caches the comparison it returns per request, so a review that asks before the list is in keeps getting the answer without the Gradle dependencies.
    • On pushes to main the first two jobs run alone. That is what gets the packages into the dependency graph, so Dependabot alerts cover them. Pull requests from forks and from Dependabot cannot submit; for them the review still checks everything except Gradle.
  • Dependabot (dependabot.yml): weekly updates of the GitHub Actions in one grouped PR, with a chore title so it passes the PR title check. A release must be 4 days old before it is proposed. Gradle dependencies get security updates only: their entry sets open-pull-requests-limit: 0, which switches the routine version updates off and leaves the security ones.
  • Pinned actions: every action reference now names a full commit SHA, with the release in a comment (24 references changed). Dependabot keeps both up to date.
  • These actions move to a new major version: actions/checkout v5 to v7.0.1, actions/setup-java v5 to v6.3.0, gradle/actions/setup-gradle v4 to v5.0.2, actions/upload-artifact v4 to v7.0.2, actions/download-artifact v4 to v8.0.2. Every other action stays on the major version it had and only moves to its latest release.
  • Runners: 3 jobs that use no GitHub token move from the github-public-amd64 runner group to ubuntu-26.04: ci.yml (tests-passed); run_integration.yml (integration); run_tests.yml (test). Jobs that call the GitHub API, and every job in the release workflow, stay where they were.

How to verify

  1. The checks on this PR are the first run of the changed workflows that run on a pull request, on the new runners where a job moved.
  2. Dependency Review fails on this PR, and that is the check working: main has no submitted list yet, so all 17 Gradle packages count as newly added, and jackson-core and jackson-databind 2.18.2 have known High advisories (fixed in 2.18.11). It passes once jackson is updated on main, or once main has its first list, because the review then only looks at what a pull request changes.
  3. The integration job does not run on a pull request. Scheduled tests was run on this branch by hand and passed on ubuntu-26.04: https://github.com/GetStream/stream-sdk-java/actions/runs/47371535433.
  4. The three jobs took 26 s, 11 s and 8 s here. The submitted list is the 17 packages of the published runtime classpath, the same as the local Gradle output. The same workflow is in review for the Android SDKs, where a test dependency with a critical advisory made the review fail and name it (stream-chat-android#7147).
  5. regen.yml and release.yml changed too and do not run on a PR. Watch their next run.

Note

Medium Risk
CI behavior changes from tag-pinned to SHA-pinned actions with major version bumps, and runner allocation shifts for test jobs; release and API workflows are untouched but dependency submission adds contents: write on a dedicated job.

Overview
Adds DevSecOps automation: Dependabot for weekly grouped GitHub Actions updates (4-day cooldown) and Gradle security-only bumps, plus a new Dependency Review workflow that submits the published library’s runtimeClasspath to GitHub on main and runs dependency review (with OpenSSF Scorecard warnings) on pull requests.

Pins all workflow action references to commit SHAs (with version comments) and bumps several core actions to new majors (checkout v7, setup-java v6, Gradle setup/submission v5, upload/download-artifact v7/v8). Jobs that only build or test without calling the GitHub API move from the github-public-amd64 runner group to ubuntu-26.04 (tests-passed, unit/integration test lanes); API-dependent and release jobs stay on the paid runner group.

Reviewed by Cursor Bugbot for commit 97f804b. Bugbot is set up for automated code reviews on this repo. Configure here.

@getstream-metis

Copy link
Copy Markdown

👋 Hi Alexey, want a second pair of eyes on this?

I'm Jeffery, Stream's review agent. I look for bugs, regressions, missing tests and slow paths, and I only post findings I've checked against the code.

  • Review this PR

Or comment /jeffery review. I'll stay quiet unless you ask.

Submit the Gradle dependencies on every pull request and run Dependency Review after the submission, as jobs of one workflow. GitHub caches the comparison it returns per request, so a review that asks before the submission is in keeps getting the answer without the Gradle dependencies.

This branch was successfully deployed

1 active (outdated) deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant