diff --git a/.github/prompts/renovate-pr.md b/.github/prompts/renovate-pr.md new file mode 100644 index 0000000..b0da36f --- /dev/null +++ b/.github/prompts/renovate-pr.md @@ -0,0 +1,17 @@ +Review and fix this Renovate dependency update PR. + +Hard requirements: + +- Read and follow `AGENTS.md` and any project-specific `AGENTS.md` files. +- Treat this PR as a dependency maintenance PR only. Do not make unrelated + refactors or feature changes. +- Preserve public API and binary compatibility. +- Inspect the dependency/build-tool updates already made by Renovate. +- Run `make check-all`. +- If the build, formatting, compilation, or tests fail, fix the failures on + this PR branch. +- If no code changes are needed, leave the branch unchanged. +- Do not merge or close the PR. + +When finished, summarize what you checked, what you fixed, and whether +`make check-all` passes. diff --git a/.github/renovate-config.js b/.github/renovate-config.js new file mode 100644 index 0000000..45eb54c --- /dev/null +++ b/.github/renovate-config.js @@ -0,0 +1,46 @@ +module.exports = { + platform: "github", + repositories: ["funfix/tasks"], + gitAuthor: "Renovate Bot ", + branchPrefix: "renovate/", + onboarding: false, + requireConfig: "optional", + recreateWhen: "always", + prHourlyLimit: 0, + + extends: [":dependencyDashboard"], + + enabledManagers: ["github-actions", "gradle", "gradle-wrapper", "sbt"], + + ignorePaths: ["**/.gradle/**"], + + packageRules: [ + { + description: "Group all dependency updates into a single PR", + matchManagers: ["github-actions", "gradle", "gradle-wrapper", "sbt"], + groupName: "dependencies", + groupSlug: "all-dependencies", + group: { + commitMessageTopic: "dependencies", + commitMessageExtra: "", + }, + }, + { + description: "Only use stable dotted numeric JVM dependency versions", + matchManagers: ["gradle", "gradle-wrapper", "sbt"], + allowedVersions: "/^\\d+(?:\\.\\d+)+$/", + }, + { + description: "Keep Scala on the 3.3.x line", + matchManagers: ["sbt"], + matchPackageNames: ["org.scala-lang:scala3-library_3"], + allowedVersions: "/^3\\.3\\.\\d+$/", + }, + { + description: "Wait one week before proposing dependency updates", + matchManagers: ["github-actions", "gradle", "gradle-wrapper", "sbt"], + minimumReleaseAge: "7 days", + minimumReleaseAgeBehaviour: "timestamp-optional", + }, + ], +}; diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 745e49d..b5cd721 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,9 +16,9 @@ jobs: matrix: java-version: ['17', '21'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: cache: 'gradle' java-version: ${{ matrix.java-version }} @@ -27,11 +27,11 @@ jobs: # ./**/*.gradle.kts # ./gradle/wrapper/gradle-wrapper.properties - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@v6 - name: Test run: ./gradlew check --no-daemon - name: Upload Results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 if: always() # This ensures that test results are uploaded even if the test step fails with: name: test-results-${{ matrix.java-version }} diff --git a/.github/workflows/opencode-renovate.yml b/.github/workflows/opencode-renovate.yml new file mode 100644 index 0000000..9c674a2 --- /dev/null +++ b/.github/workflows/opencode-renovate.yml @@ -0,0 +1,54 @@ +name: opencode-renovate + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +concurrency: + group: opencode-renovate-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + opencode: + if: | + github.event.pull_request.head.repo.full_name == github.repository && + startsWith(github.event.pull_request.head.ref, 'renovate/') && + github.actor != 'github-actions[bot]' && + !github.event.pull_request.draft + runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + pull-requests: write + issues: write + steps: + - name: Checkout Renovate PR branch + uses: actions/checkout@v6 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + persist-credentials: false + + - uses: actions/setup-java@v5 + with: + java-version: "17" + distribution: temurin + - uses: sbt/setup-sbt@v1 + + - name: Load prompt file + id: load-prompt + run: | + echo "content<> $GITHUB_OUTPUT + cat .github/prompts/renovate-pr.md >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Run opencode + uses: anomalyco/opencode/github@latest + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + model: opencode-go/deepseek-v4-pro + use_github_token: true + prompt: ${{ steps.load-prompt.outputs.content }} diff --git a/.github/workflows/opencode-upgrades.yml b/.github/workflows/opencode-upgrades.yml deleted file mode 100644 index 5609cf1..0000000 --- a/.github/workflows/opencode-upgrades.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: opencode-upgrades - -on: - schedule: - - cron: "0 9 * * 1" # Every Monday at 9am UTC - workflow_dispatch: - -jobs: - opencode: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - pull-requests: read - issues: read - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - persist-credentials: false - - - uses: actions/setup-java@v5 - with: - java-version: "17" - distribution: temurin - - uses: sbt/setup-sbt@v1 - - - name: Run opencode - uses: anomalyco/opencode/github@latest - env: - OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} - with: - model: opencode-go/deepseek-v4-pro - prompt: | - Upgrade the project's dependencies according to the recipe in AGENTS.md diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index 602f6ea..bcabf2b 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -9,9 +9,9 @@ jobs: publish-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: 17 distribution: 'temurin' diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml new file mode 100644 index 0000000..cbd4510 --- /dev/null +++ b/.github/workflows/renovate.yaml @@ -0,0 +1,22 @@ +name: Renovate + +on: + workflow_dispatch: + schedule: + # Runs every Monday at 09:00 UTC + - cron: "0 9 * * 1" + +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Renovate + uses: renovatebot/github-action@v46.1.14 + with: + configurationFile: .github/renovate-config.js + token: ${{ secrets.RENOVATE_TOKEN }} + # env: + # LOG_LEVEL: debug diff --git a/AGENTS.md b/AGENTS.md index 0a29222..211b703 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,26 +14,10 @@ Use the **jspecify-nullness** skill when working with JSpecify annotations, null ## Acceptance Criteria -For all work to be considered complete: -```sh -./gradlew check -``` - -## HOW-TOs +Work is not done until `make check-all` passes. -### Update project's dependencies - -```bash -make dependency-updates-ci +```sh +make check-all ``` -This will generate these reports: -- For the Gradle project(s): - - `./build/dependencyUpdates/report.html` - - `./tasks-jvm/build/dependencyUpdates/report.html` - - `./tasks-kotlin-coroutines/build/dependencyUpdates/report.html` -RULES: -- Never upgrade major versions (semver), instead ask the user or warn them!!! -- Never upgrade to SNAPSHOT, RC, or milestone versions. -- Fix breakage, but apply good judgement. diff --git a/Makefile b/Makefile index b368eb9..8a139d8 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ -.PHONY: build +.PHONY: build check-all build: ./gradlew build +check-all: + ./gradlew check + dependency-updates: ./gradlew dependencyUpdates \ -Drevision=release \ diff --git a/settings.gradle.kts b/settings.gradle.kts index 440904e..b9aa697 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,5 +11,5 @@ pluginManagement { } plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" }