diff --git a/.github/workflows/opencode-upgrades.yml b/.github/workflows/opencode-upgrades.yml new file mode 100644 index 0000000..36584fc --- /dev/null +++ b/.github/workflows/opencode-upgrades.yml @@ -0,0 +1,35 @@ +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: "21" + 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/opencode.yml b/.github/workflows/opencode.yml new file mode 100644 index 0000000..ce8284a --- /dev/null +++ b/.github/workflows/opencode.yml @@ -0,0 +1,39 @@ +name: opencode + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +jobs: + opencode: + if: | + contains(github.event.comment.body, ' /oc') || + startsWith(github.event.comment.body, '/oc') || + contains(github.event.comment.body, ' /opencode') || + startsWith(github.event.comment.body, '/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: "21" + 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 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..0a29222 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,39 @@ +# Tasks + +## Project Layout + +- **`tasks-jvm/`** — Core Java library (`org.funfix.tasks.jvm`). Java 17+, Error Prone + NullAway enabled. +- **`tasks-kotlin-coroutines/`** — Kotlin coroutines integration, depends on `tasks-jvm`. Strict explicit API mode. +- **`buildSrc/`** — Gradle convention plugins (shared build config). + +## Java & Null Safety + +All Java code uses **JSpecify** annotations for null-safety. NullAway is configured in error mode. + +Use the **jspecify-nullness** skill when working with JSpecify annotations, null-safe generics, or NullAway conformance. + +## Acceptance Criteria + +For all work to be considered complete: +```sh +./gradlew check +``` + +## HOW-TOs + +### Update project's dependencies + +```bash +make dependency-updates-ci +``` + +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 634b4da..b368eb9 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,15 @@ dependency-updates: --refresh-dependencies && \ open build/dependencyUpdates/report.html +dependency-updates-ci: + @set -e; \ + ./gradlew dependencyUpdates --no-parallel -Drevision=release -DoutputFormatter=html --refresh-dependencies; \ + if [ -f build.sbt ]; then \ + mkdir -p ~/.sbt/1.0/plugins; \ + test -f ~/.sbt/1.0/plugins/sbt-updates.sbt || echo 'addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")' > ~/.sbt/1.0/plugins/sbt-updates.sbt; \ + sbt ";dependencyUpdatesReport ;reload plugins; dependencyUpdatesReport"; \ + fi + update-gradle: ./gradlew wrapper --gradle-version latest