Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- code-review-graph MCP tools -->
## MCP Tools: code-review-graph

**IMPORTANT: This project has a knowledge graph. ALWAYS use the
code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore
the codebase.** The graph is faster, cheaper (fewer tokens), and gives
you structural context (callers, dependents, test coverage) that file
scanning cannot.

### When to use graph tools FIRST

- **Exploring code**: `semantic_search_nodes` or `query_graph` instead of Grep
- **Understanding impact**: `get_impact_radius` instead of manually tracing imports
- **Code review**: `detect_changes` + `get_review_context` instead of reading entire files
- **Finding relationships**: `query_graph` with callers_of/callees_of/imports_of/tests_for
- **Architecture questions**: `get_architecture_overview` + `list_communities`

Fall back to Grep/Glob/Read **only** when the graph doesn't cover what you need.

### Key Tools

| Tool | Use when |
|------|----------|
| `detect_changes` | Reviewing code changes — gives risk-scored analysis |
| `get_review_context` | Need source snippets for review — token-efficient |
| `get_impact_radius` | Understanding blast radius of a change |
| `get_affected_flows` | Finding which execution paths are impacted |
| `query_graph` | Tracing callers, callees, imports, tests, dependencies |
| `semantic_search_nodes` | Finding functions/classes by name or keyword |
| `get_architecture_overview` | Understanding high-level codebase structure |
| `refactor_tool` | Planning renames, finding dead code |

### Workflow

1. The graph auto-updates on file changes (via hooks).
2. Use `detect_changes` for code review.
3. Use `get_affected_flows` to understand impact.
4. Use `query_graph` pattern="tests_for" to check coverage.
61 changes: 16 additions & 45 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Android CI

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
Expand All @@ -12,49 +13,49 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Cache Gradle dependencies
uses: gradle/actions/setup-gradle@v3

- name: Run Checks
run: ./gradlew check --stacktrace

paparazi-screenshot-tests:
roborazzi-screenshot-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Cache Gradle dependencies
uses: gradle/actions/setup-gradle@v3

- name: Run Paparazzi Screenshot Tests
run: ./gradlew :showkase-screenshot-testing-paparazzi-sample:verifyPaparazziDebug -PuseKsp=true --stacktrace
- name: Run Roborazzi Screenshot Tests
run: ./gradlew :showkase-screenshot-testing-roborazzi-sample:verifyRoborazziDebug --stacktrace

- name: Upload Screenshot Test Report
uses: actions/upload-artifact@v4
if: always()
with:
name: reports
path: showkase-screenshot-testing-paparazzi-sample/build/reports/tests/testDebugUnitTest/
name: roborazzi-reports
path: showkase-screenshot-testing-roborazzi-sample/build/reports/tests/testDebugUnitTest/
retention-days: 1

- name: Upload Screenshot Failure Differences
- name: Upload Screenshot Diff Outputs
uses: actions/upload-artifact@v4
if: failure()
with:
name: reports
path: showkase-screenshot-testing-paparazzi-sample/out/failures/
name: roborazzi-diffs
path: showkase-screenshot-testing-roborazzi-sample/build/outputs/roborazzi/
retention-days: 1

ui-testing:
Expand All @@ -73,11 +74,11 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Cache Gradle dependencies
uses: gradle/actions/setup-gradle@v3
Expand Down Expand Up @@ -123,7 +124,7 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Start emulator and run UI Tests w/ KAPT
- name: Start emulator and run UI Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
Expand All @@ -134,36 +135,6 @@ jobs:
adb devices -l
bash --noprofile --norc -eo pipefail "${{ steps.script.outputs.file }}"
./gradlew connectedCheck --no-daemon --stacktrace


- name: Start emulator and run UI Tests w/ KSP
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
adb devices -l
bash --noprofile --norc -eo pipefail "${{ steps.script.outputs.file }}"
./gradlew connectedCheck --no-daemon --stacktrace -PuseKsp=true

- name: Run Screenshot Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew executeScreenshotTests -PdirectorySuffix=Api${{ matrix.api-level }} -PprintBase64


- name: Upload screenshot testing report
uses: actions/upload-artifact@v4
with:
name: reports-${{ matrix.api-level }}-${{ matrix.target }}
path: sample/build/reports/shot/debug/Api${{ matrix.api-level }}/verification/
retention-days: 1

# Uncomment the jobs below if you want to generate and record screenshots. Once you download the
# artifact, place them under sample/screenshots/debug/
Expand Down
140 changes: 140 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Release

on:
workflow_dispatch:
inputs:
version-bump:
description: 'Semver part to bump from the latest v*.*.* tag'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
push:
branches: [ master, main ]
tags: [ 'v*.*.*' ]

permissions:
contents: write
packages: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch tags
run: git fetch --tags --force

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- name: Cache Gradle dependencies
uses: gradle/actions/setup-gradle@v3

- name: Determine next version
id: version
run: |
set -euo pipefail
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
NEW_TAG="${GITHUB_REF_NAME}"
NEW_VERSION="${NEW_TAG#v}"
PREVIOUS_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -vx "${NEW_TAG}" | head -n1 || true)
echo "Triggered by tag push: $NEW_TAG"
else
BUMP="${{ github.event.inputs.version-bump || 'patch' }}"
LATEST_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n1 || true)
if [ -z "$LATEST_TAG" ]; then
PREVIOUS_TAG=""
MAJOR=0; MINOR=0; PATCH=0
echo "No existing v*.*.* tag found, starting from v0.0.0"
else
PREVIOUS_TAG="$LATEST_TAG"
VERSION="${LATEST_TAG#v}"
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
fi
case "$BUMP" in
major) MAJOR=$((MAJOR+1)); MINOR=0; PATCH=0 ;;
minor) MINOR=$((MINOR+1)); PATCH=0 ;;
patch) PATCH=$((PATCH+1)) ;;
*) echo "Unknown bump type: $BUMP"; exit 1 ;;
esac
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
NEW_TAG="v${NEW_VERSION}"
fi
echo "Previous tag: ${PREVIOUS_TAG:-<none>}"
echo "New version: $NEW_VERSION"
echo "previous-tag=$PREVIOUS_TAG" >> "$GITHUB_OUTPUT"
echo "new-version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
echo "new-tag=$NEW_TAG" >> "$GITHUB_OUTPUT"

- name: Publish to GitHub Packages
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew \
:showkase:publishAllPublicationsToGitHubPackagesRepository \
:showkase-annotation:publishAllPublicationsToGitHubPackagesRepository \
:showkase-models:publishAllPublicationsToGitHubPackagesRepository \
:showkase-processor:publishAllPublicationsToGitHubPackagesRepository \
:showkase-screenshot-testing:publishAllPublicationsToGitHubPackagesRepository \
:showkase-screenshot-testing-shot:publishAllPublicationsToGitHubPackagesRepository \
:showkase-screenshot-testing-roborazzi:publishAllPublicationsToGitHubPackagesRepository \
-PVERSION_NAME=${{ steps.version.outputs.new-version }} \
-PRELEASE_SIGNING_ENABLED=false \
--stacktrace

- name: Generate release notes
id: notes
run: |
set -euo pipefail
PREV_TAG="${{ steps.version.outputs.previous-tag }}"
NEW_TAG="${{ steps.version.outputs.new-tag }}"
NOTES_FILE="$(mktemp)"
{
echo "## What's Changed"
echo
if [ -z "$PREV_TAG" ]; then
git log --no-merges --pretty=format:"- %s (%h) by @%an" HEAD
else
git log --no-merges --pretty=format:"- %s (%h) by @%an" "${PREV_TAG}..HEAD"
fi
echo
echo
if [ -n "$PREV_TAG" ]; then
echo "**Full Changelog**: https://github.com/${GITHUB_REPOSITORY}/compare/${PREV_TAG}...${NEW_TAG}"
fi
} > "$NOTES_FILE"
echo "notes-file=$NOTES_FILE" >> "$GITHUB_OUTPUT"
echo "----- generated notes -----"
cat "$NOTES_FILE"

- name: Create and push tag
if: github.ref_type != 'tag'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.version.outputs.new-tag }}" -m "Release ${{ steps.version.outputs.new-tag }}"
git push origin "${{ steps.version.outputs.new-tag }}"

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.version.outputs.new-tag }}" \
--title "${{ steps.version.outputs.new-tag }}" \
--notes-file "${{ steps.notes.outputs.notes-file }}" \
--target "${{ github.sha }}"
11 changes: 11 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"mcpServers": {
"code-review-graph": {
"command": "code-review-graph",
"args": [
"serve"
],
"type": "stdio"
}
}
}
12 changes: 12 additions & 0 deletions .opencode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"mcpServers": {
"code-review-graph": {
"command": "code-review-graph",
"args": [
"serve"
],
"type": "stdio",
"env": []
}
}
}
38 changes: 38 additions & 0 deletions .windsurfrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- code-review-graph MCP tools -->
## MCP Tools: code-review-graph

**IMPORTANT: This project has a knowledge graph. ALWAYS use the
code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore
the codebase.** The graph is faster, cheaper (fewer tokens), and gives
you structural context (callers, dependents, test coverage) that file
scanning cannot.

### When to use graph tools FIRST

- **Exploring code**: `semantic_search_nodes` or `query_graph` instead of Grep
- **Understanding impact**: `get_impact_radius` instead of manually tracing imports
- **Code review**: `detect_changes` + `get_review_context` instead of reading entire files
- **Finding relationships**: `query_graph` with callers_of/callees_of/imports_of/tests_for
- **Architecture questions**: `get_architecture_overview` + `list_communities`

Fall back to Grep/Glob/Read **only** when the graph doesn't cover what you need.

### Key Tools

| Tool | Use when |
|------|----------|
| `detect_changes` | Reviewing code changes — gives risk-scored analysis |
| `get_review_context` | Need source snippets for review — token-efficient |
| `get_impact_radius` | Understanding blast radius of a change |
| `get_affected_flows` | Finding which execution paths are impacted |
| `query_graph` | Tracing callers, callees, imports, tests, dependencies |
| `semantic_search_nodes` | Finding functions/classes by name or keyword |
| `get_architecture_overview` | Understanding high-level codebase structure |
| `refactor_tool` | Planning renames, finding dead code |

### Workflow

1. The graph auto-updates on file changes (via hooks).
2. Use `detect_changes` for code review.
3. Use `get_affected_flows` to understand impact.
4. Use `query_graph` pattern="tests_for" to check coverage.
Loading