Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/release_jasync_sql/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Follow the canonical release runbook in [RELEASING.md](../../../RELEASING.md) st
1. **Read [RELEASING.md](../../../RELEASING.md) first** to confirm exact branch names, file locations, and command flags.
2. **Execute local preparation autonomously (Steps 1–3)**:
- Fetch `origin --prune --tags`, fast-forward local `master` to `origin/master`, verify recent `CI` workflow runs on `master` passed, confirm `version = "X.Y.Z"` in `build.gradle.kts`, and rebase local `github-release` onto `master`.
- Run `./.agents/skills/release_jasync_sql/scripts/check_cves.sh` to audit all published runtime/compile dependencies in `gradle.properties` against the GitHub Advisory Database. **Halt and report to the user** before releasing if any open advisory is found.
- Preview release notes via `gh api --method POST repos/jasync-sql/jasync-sql/releases/generate-notes` (`target_commitish=master` or `github-release`) and prepare a concise curated draft (preserving feature/fix/doc PRs and `New Contributors`).
3. **Pause for explicit user approval before irreversible remote actions** (unless the user already approved them in the prompt):
- **Gate 1 — Push `github-release` (`Step 4`)**: Confirm before running `git push origin github-release`, since this triggers `.github/workflows/cd.yml` to publish all 6 `jasync-*` artifacts (`X.Y.Z`) to Sonatype Maven Central.
Expand Down
70 changes: 70 additions & 0 deletions .agents/skills/release_jasync_sql/scripts/check_cves.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
PROPS_FILE="${1:-${REPO_ROOT}/gradle.properties}"

if [[ ! -f "${PROPS_FILE}" ]]; then
echo "ERROR: gradle.properties not found at ${PROPS_FILE}" >&2
exit 1
fi

prop() {
local key="$1"
local val
val="$(grep -E "^${key}=" "${PROPS_FILE}" | head -n 1 | cut -d'=' -f2- | tr -d '[:space:]')"
if [[ -z "${val}" ]]; then
echo "ERROR: Missing required property '${key}' in ${PROPS_FILE}" >&2
exit 1
fi
printf '%s' "${val}"
}

NETTY_VERSION="$(prop NETTY_VERSION)"
KOTLIN_VERSION="$(prop KOTLIN_VERSION)"
KOTLIN_COROUTINES_VERSION="$(prop KOTLIN_COROUTINES_VERSION)"
SL4J_VERSION="$(prop SL4J_VERSION)"
KOTLIN_LOGGING_VERSION="$(prop KOTLIN_LOGGING_VERSION)"
JODA_VERSION="$(prop JODA_VERSION)"
JODA_CONVERT_VERSION="$(prop JODA_CONVERT_VERSION)"
SCRAM_CLIENT_VERSION="$(prop SCRAM_CLIENT_VERSION)"
THREETEN_EXTRA="$(prop THREETEN_EXTRA)"
JTS_VERSION="$(prop JTS_VERSION)"
R2DBC_SPI_VERSION="$(prop R2DBC_SPI_VERSION)"
REACTOR_CORE_VERSION="$(prop REACTOR_CORE_VERSION)"
REACTOR_KOTLIN_EXTENSION="$(prop REACTOR_KOTLIN_EXTENSION)"

AFFECTS="$(IFS=,; echo "\
io.netty:netty-common@${NETTY_VERSION},\
io.netty:netty-buffer@${NETTY_VERSION},\
io.netty:netty-resolver@${NETTY_VERSION},\
io.netty:netty-codec@${NETTY_VERSION},\
io.netty:netty-transport@${NETTY_VERSION},\
io.netty:netty-handler@${NETTY_VERSION},\
io.netty:netty-transport-native-unix-common@${NETTY_VERSION},\
org.jetbrains.kotlin:kotlin-stdlib@${KOTLIN_VERSION},\
org.jetbrains.kotlin:kotlin-stdlib-jdk8@${KOTLIN_VERSION},\
org.jetbrains.kotlin:kotlin-reflect@${KOTLIN_VERSION},\
org.jetbrains.kotlinx:kotlinx-coroutines-core@${KOTLIN_COROUTINES_VERSION},\
org.jetbrains.kotlinx:kotlinx-coroutines-jdk8@${KOTLIN_COROUTINES_VERSION},\
org.slf4j:slf4j-api@${SL4J_VERSION},\
io.github.oshai:kotlin-logging-jvm@${KOTLIN_LOGGING_VERSION},\
joda-time:joda-time@${JODA_VERSION},\
org.joda:joda-convert@${JODA_CONVERT_VERSION},\
com.ongres.scram:client@${SCRAM_CLIENT_VERSION},\
org.threeten:threeten-extra@${THREETEN_EXTRA},\
org.locationtech.jts:jts-core@${JTS_VERSION},\
io.r2dbc:r2dbc-spi@${R2DBC_SPI_VERSION},\
io.projectreactor:reactor-core@${REACTOR_CORE_VERSION},\
io.projectreactor.kotlin:reactor-kotlin-extensions@${REACTOR_KOTLIN_EXTENSION}")"

RESULT="$(gh api "advisories?ecosystem=maven&per_page=100&affects=${AFFECTS}" \
--jq 'map({ghsa_id, cve_id, severity, summary, vulnerabilities: [.vulnerabilities[] | {package: .package.name, vulnerable_version_range, first_patched_version}]})')"

if [[ "${RESULT}" != "[]" ]]; then
echo "ERROR: Open security advisories found in published runtime dependencies:" >&2
echo "${RESULT}" >&2
exit 1
fi

echo "OK: 0 open security advisories across published runtime dependencies."
6 changes: 6 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ Verify recent CI checks on `master` passed:
gh run list --repo jasync-sql/jasync-sql --branch master --workflow ci.yml --limit 3
```

Verify published runtime dependencies in [`gradle.properties`](gradle.properties) have 0 open CVEs in the GitHub Advisory Database:

```bash
./.agents/skills/release_jasync_sql/scripts/check_cves.sh
```

### 2. Verify `version` in `build.gradle.kts`

Inspect `version = "..."` in [`build.gradle.kts`](build.gradle.kts):
Expand Down
Loading