{{ message }}
Repository navigation
Run Sonar on push so branch baselines stop going stale - #78
Merged
Merged
Conversation
The Sonar step was gated on `github.event.pull_request.head.repo.full_name == github.repository`. On a push there is no pull_request object, so the left side is the empty string and the guard is always false. Sonar has therefore only ever run on pull requests, and a PR analysis does not refresh the branch baseline. Consumers have been measuring "new code" against a baseline frozen at the day they adopted this workflow: stream-core-android last analysed 2025-12-23 (the day it was created), stream-video-android 2025-12-19, stream-feeds-android 2025-10-15. Keep the fork and Dependabot guards, but apply the fork check only to pull_request events. The same stale condition also made the sibling "skipped because the PR comes from a fork" notice fire on every push, reporting the wrong reason in the log.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
gpunto
reviewed
Sep 21, 2026
Review feedback from @gpunto. The previous form admitted merge_group and workflow_dispatch, both of which were skipped before. merge_group reaches one consumer: stream-chat-android calls this workflow from pr-checks.yml, which triggers on pull_request and merge_group, and that repo has a real coverage { includedModules = ... } block. On a merge-queue run GITHUB_REF is refs/heads/gh-readonly-queue/..., and the plugin sets no sonar.branch.name, so the scanner would register that throwaway ref as a SonarCloud branch — and a Sonar failure inside the required unit-test job could block the queue. Chat already gets branch analysis from its own build-and-test.yml. workflow_dispatch has the same shape in core, video and feeds: dispatching CI on a feature branch would register that branch in SonarCloud.
gpunto
approved these changes
Sep 22, 2026
Collaborator
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.

Goal
Fixes AND-1443
The Sonar step is gated on
github.event.pull_request.head.repo.full_name == github.repository. On a push there is nopull_requestobject, so the guard isalways false and Sonar only ever runs on PRs — which never refreshes the branch
baseline. Consumers have been measuring new code against a baseline frozen since
they adopted this workflow: core 2025-12-23, video 2025-12-19, feeds 2025-10-15.
stream-chat-androidalso consumes this workflow, frompr-checks.yml, but is notaffected by the staleness — it gets branch analysis from its own
build-and-test.yml,which runs Sonar on push unconditionally.
Implementation
Gate the Sonar step on
pushexplicitly and scope the fork check topull_request;the Dependabot guard stays on all events.
The old condition also made the sibling "skipped because the PR comes from a fork"
notice fire on pushes, merge-queue runs and manual dispatches, reporting the wrong
reason in the log. That one is scoped too.
SONAR_TOKENis a repo secret in core, video and feeds and is already passed intothis workflow, so it is available to push-event runs.
Testing
actionlint .github/workflows/android-ci.yml— clean.Both conditions evaluated per event type:
develop/mainmerge_groupworkflow_dispatchConsumers pin this workflow by SHA, so each repo needs its
android.ymlbumpedbefore it takes effect.