From ed4b89c4fcbe115f184d6f737d099e26ce025487 Mon Sep 17 00:00:00 2001 From: Qodana Application Date: Wed, 6 Aug 2025 10:40:16 +0000 Subject: [PATCH 1/4] Add qodana.yaml file --- qodana.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 qodana.yaml diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 000000000..8ac0c551e --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,6 @@ +version: "1.0" +linter: jetbrains/qodana-jvm:2025.1 +profile: + name: qodana.recommended +include: + - name: CheckDependencyLicenses \ No newline at end of file From b4d54ef797ef52aeb8cfc2fbed3349d919df0211 Mon Sep 17 00:00:00 2001 From: Qodana Application Date: Wed, 6 Aug 2025 10:40:17 +0000 Subject: [PATCH 2/4] Add github workflow file --- .github/workflows/qodana_code_quality.yml | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/qodana_code_quality.yml diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml new file mode 100644 index 000000000..d83619061 --- /dev/null +++ b/.github/workflows/qodana_code_quality.yml @@ -0,0 +1,28 @@ +name: Qodana +on: + workflow_dispatch: + pull_request: + push: + branches: # Specify your branches here + - main # The 'main' branch + - 'releases/*' # The release branches + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2025.1 + with: + pr-mode: false + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_14297613 }} + QODANA_ENDPOINT: 'https://qodana.cloud' \ No newline at end of file From 76e77efee72daa86213e17ffaf6f553b8bdc8f78 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Wed, 6 Aug 2025 12:43:44 +0200 Subject: [PATCH 3/4] Add license headers to `qodana.yaml` and GitHub Actions workflow files --- .github/workflows/qodana_code_quality.yml | 25 ++++++++++++++++++++++- qodana.yaml | 21 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index d83619061..f057276a2 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -1,3 +1,26 @@ +# "Commons Clause" License Condition v1.0 +# +# The Software is provided to you by the Licensor under the License, as defined +# below, subject to the following condition. +# +# Without limiting other conditions in the License, the grant of rights under the +# License will not include, and the License does not grant to you, the right to +# Sell the Software. +# +# For purposes of the foregoing, “Sell” means practicing any or all of the rights +# granted to you under the License to provide to third parties, for a fee or +# other consideration (including without limitation fees for hosting or +# consulting/ support services related to the Software), a product or service +# whose value derives, entirely or substantially, from the functionality of the +# Software. Any license notice or attribution required by the License must also +# include this Commons Clause License Condition notice. +# +# Software: Infinitic +# +# License: MIT License (https://opensource.org/licenses/MIT) +# +# Licensor: infinitic.io + name: Qodana on: workflow_dispatch: @@ -25,4 +48,4 @@ jobs: pr-mode: false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_14297613 }} - QODANA_ENDPOINT: 'https://qodana.cloud' \ No newline at end of file + QODANA_ENDPOINT: 'https://qodana.cloud' diff --git a/qodana.yaml b/qodana.yaml index 8ac0c551e..38c2cda81 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,3 +1,24 @@ +# "Commons Clause" License Condition v1.0 +# +# The Software is provided to you by the Licensor under the License, as defined below, subject to +# the following condition. +# +# Without limiting other conditions in the License, the grant of rights under the License will not +# include, and the License does not grant to you, the right to Sell the Software. +# +# For purposes of the foregoing, "Sell" means practicing any or all of the rights granted to you +# under the License to provide to third parties, for a fee or other consideration (including +# without limitation fees for hosting or consulting/ support services related to the Software), a +# product or service whose value derives, entirely or substantially, from the functionality of the +# Software. Any license notice or attribution required by the License must also include this +# Commons Clause License Condition notice. +# +# Software: Infinitic +# +# License: MIT License (https://opensource.org/licenses/MIT) +# +# Licensor: infinitic.io + version: "1.0" linter: jetbrains/qodana-jvm:2025.1 profile: From db8a294657cc81f74bfadda0c56f2db4f7edf310 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Wed, 6 Aug 2025 12:53:12 +0200 Subject: [PATCH 4/4] Refactor `publish.gradle.kts` for consistent formatting --- publish.gradle.kts | 78 ++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/publish.gradle.kts b/publish.gradle.kts index a2e1b853f..2d075fd9d 100644 --- a/publish.gradle.kts +++ b/publish.gradle.kts @@ -20,7 +20,6 @@ * * Licensor: infinitic.io */ - import okhttp3.RequestBody.Companion.toRequestBody // https://proandroiddev.com/publishing-a-maven-artifact-3-3-step-by-step-instructions-to-mavencentral-publishing-bd661081645d @@ -31,7 +30,8 @@ import okhttp3.RequestBody.Companion.toRequestBody // * login to https://central.sonatype.com/publishing/deployments // * once the new version is uploaded then publish it // -// curl -u ossSonatypeOrgUsername:ossSonatypeOrgPassword -X POST https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.infinitic +// curl -u ossSonatypeOrgUsername:ossSonatypeOrgPassword -X POST +// https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.infinitic // // You must have a gradle.properties file with // ossSonatypeOrgUsername= @@ -60,9 +60,7 @@ buildscript { maven(url = uri("https://central.sonatype.com/repository/maven-snapshots/")) maven(url = uri("https://plugins.gradle.org/m2/")) } - dependencies { - classpath("com.squareup.okhttp3:okhttp:4.12.0") - } + dependencies { classpath("com.squareup.okhttp3:okhttp:4.12.0") } } repositories { mavenCentral() } @@ -93,8 +91,7 @@ publishing { repositories { val releasesRepoUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/") - val snapshotsRepoUrl = - uri("https://central.sonatype.com/repository/maven-snapshots/") + val snapshotsRepoUrl = uri("https://central.sonatype.com/repository/maven-snapshots/") maven { name = "ossrh-staging-api" url = if (Ci.isRelease) releasesRepoUrl else snapshotsRepoUrl @@ -139,39 +136,44 @@ publishing { } // === Notify Central Portal === -val notifyCentralPortal = if (rootProject.tasks.findByName("notifyCentralPortal") == null) { - rootProject.tasks.register("notifyCentralPortal") { - group = "publishing" - description = "Notify Central Portal after Maven publish" - - doLast { - val groupId = "io.infinitic" - val username = System.getenv("OSSRH_USERNAME") ?: ossSonatypeOrgUsername - val password = System.getenv("OSSRH_PASSWORD") ?: ossSonatypeOrgPassword - - if (username == null || password == null) throw GradleException("Missing OSSRH credentials.") - - val auth = okhttp3.Credentials.basic(username, password) - val client = okhttp3.OkHttpClient() - - val request = okhttp3.Request.Builder() - .url("https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$groupId") - .post(ByteArray(0).toRequestBody(null)) - .header("Authorization", auth) - .build() - - val response = client.newCall(request).execute() - - if (!response.isSuccessful) { - throw GradleException("Failed to notify Central Portal: ${response.code} - ${response.body?.string()}") - } else { - println("✅ Successfully notified Central Portal for groupId: $groupId") +val notifyCentralPortal = + if (rootProject.tasks.findByName("notifyCentralPortal") == null) { + rootProject.tasks.register("notifyCentralPortal") { + group = "publishing" + description = "Notify Central Portal after Maven publish" + + doLast { + val groupId = "io.infinitic" + val username = System.getenv("OSSRH_USERNAME") ?: ossSonatypeOrgUsername + val password = System.getenv("OSSRH_PASSWORD") ?: ossSonatypeOrgPassword + + if (username == null || password == null) + throw GradleException("Missing OSSRH credentials.") + + val auth = okhttp3.Credentials.basic(username, password) + val client = okhttp3.OkHttpClient() + + val request = + okhttp3.Request.Builder() + .url( + "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$groupId") + .post(ByteArray(0).toRequestBody(null)) + .header("Authorization", auth) + .build() + + val response = client.newCall(request).execute() + + if (!response.isSuccessful) { + throw GradleException( + "Failed to notify Central Portal: ${response.code} - ${response.body?.string()}") + } else { + println("✅ Successfully notified Central Portal for groupId: $groupId") + } + } } + } else { + rootProject.tasks.named("notifyCentralPortal") } - } -} else { - rootProject.tasks.named("notifyCentralPortal") -} // === Hook into publishing (runs only once after all publishing is done) ===