Repository navigation
ci: add Dependabot, dependency review and Gradle dependency submission - #192
Open
testableapple wants to merge 2 commits into
Open
testableapple wants to merge 2 commits into
testableapple wants to merge 2 commits into
Conversation
👋 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.
Or comment |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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: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.github-public-amd64runner group: submits that list. It needscontents: write, and only that job has it.mainthe 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.yml): weekly updates of the GitHub Actions in one grouped PR, with achoretitle 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 setsopen-pull-requests-limit: 0, which switches the routine version updates off and leaves the security ones.actions/checkoutv5 to v7.0.1,actions/setup-javav5 to v6.3.0,gradle/actions/setup-gradlev4 to v5.0.2,actions/upload-artifactv4 to v7.0.2,actions/download-artifactv4 to v8.0.2. Every other action stays on the major version it had and only moves to its latest release.github-public-amd64runner group toubuntu-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
Dependency Reviewfails on this PR, and that is the check working:mainhas no submitted list yet, so all 17 Gradle packages count as newly added, andjackson-coreandjackson-databind2.18.2 have known High advisories (fixed in 2.18.11). It passes once jackson is updated onmain, or oncemainhas its first list, because the review then only looks at what a pull request changes.Scheduled testswas run on this branch by hand and passed onubuntu-26.04: https://github.com/GetStream/stream-sdk-java/actions/runs/47371535433.regen.ymlandrelease.ymlchanged 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: writeon 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
runtimeClasspathto GitHub onmainand 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 (
checkoutv7,setup-javav6, Gradle setup/submission v5, upload/download-artifact v7/v8). Jobs that only build or test without calling the GitHub API move from thegithub-public-amd64runner group toubuntu-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.