Skip to content

Commit

Permalink
Merge pull request #170 from SpineEventEngine/required-field-errors
Browse files Browse the repository at this point in the history
Required field errors
  • Loading branch information
alexander-yevsyukov authored Dec 18, 2024
2 parents 868284c + 8e31138 commit 87012df
Show file tree
Hide file tree
Showing 46 changed files with 720 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v4
73 changes: 73 additions & 0 deletions .github/workflows/remove-obsolete-artifacts-from-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# Periodically removes obsolete artifacts from GitHub Packages.
#
# Only non-release artifacts—those containing "SNAPSHOT" in their version name—are eligible
# for removal. The latest non-release artifacts will be retained, with the exact number determined
# by the `VERSION_COUNT_TO_KEEP` environment variable.
#
# Please note the following details:
#
# 1. An artifact cannot be deleted if it is public and has been downloaded more than 5,000 times.
# In this scenario, contact GitHub support for further assistance.
#
# 2. This workflow only applies to artifacts published from this repository.
#
# 3. A maximum of 100 artifacts can be removed per run from each package;
# if there are more than 100 obsolete artifacts, either manually restart the workflow
# or wait for the next scheduled removal.
#
# 4. When artifacts with version `x.x.x-SNAPSHOT` are published, GitHub automatically appends
# the current timestamp, resulting in versions like `x.x.x-SNAPSHOT.20241024.173759`.
# All such artifacts are grouped into one package and treated as a single package
# in GitHub Packages with the version `x.x.x-SNAPSHOT`. Consequently, it is not possible
# to remove obsolete versions within a package; only the entire package can be deleted.
#

name: Remove obsolete Maven artifacts from GitHub Packages

on:
schedule:
- cron: '0 0 * * *' # Run every day at midnight.

env:
VERSION_COUNT_TO_KEEP: 5 # Number of most recent SNAPSHOT versions to retain.

jobs:
retrieve-package-names:
name: Retrieve the package names published from this repository
runs-on: ubuntu-latest
outputs:
package-names: ${{ steps.request-package-names.outputs.package-names }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Retrieve the names of packages
id: request-package-names
shell: bash
run: |
repoName=$(echo ${{ github.repository }} | cut -d '/' -f2)
chmod +x ./config/scripts/request-package-names.sh
./config/scripts/request-package-names.sh ${{ github.token }} \
$repoName ${{ github.repository_owner }} ./package-names.json
echo "package-names=$(<./package-names.json)" >> $GITHUB_OUTPUT
delete-obsolete-artifacts:
name: Remove obsolete artifacts published from this repository to GitHub Packages
needs: retrieve-package-names
runs-on: ubuntu-latest
strategy:
matrix:
package-name: ${{ fromJson(needs.retrieve-package-names.outputs.package-names) }}
steps:
- name: Remove obsolete artifacts from '${{ matrix.package-name }}' package
uses: actions/delete-package-versions@v5
with:
owner: ${{ github.repository_owner }}
package-name: ${{ matrix.package-name }}
package-type: 'maven'
token: ${{ github.token }}
min-versions-to-keep: ${{ env.VERSION_COUNT_TO_KEEP }}
# Ignores artifacts that do not contain the word "SNAPSHOT".
ignore-versions: '^(?!.+SNAPSHOT).*$'
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

package io.spine.dependency.build


// https://errorprone.info/
@Suppress("unused", "ConstPropertyName")
object ErrorProne {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object AutoServiceKsp {
/**
* The latest version compatible with Kotlin 1.8.22.
*
* @see Ksp.version
* @see io.spine.dependency.build.Ksp.version
*/
private const val version = "1.1.0"
const val processor = "dev.zacsweers.autoservice:auto-service-ksp:$version"
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ object KotlinX {
object Coroutines {

// https://github.com/Kotlin/kotlinx.coroutines
const val version = "1.7.3"
const val version = "1.9.0"
const val core = "$group:kotlinx-coroutines-core:$version"
const val jdk8 = "$group:kotlinx-coroutines-jdk8:$version"
const val test = "$group:kotlinx-coroutines-test:$version"
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package io.spine.dependency.lib
/**
* An open-source logging framework.
*
* Spine uses its own [logging library][Spine.Logging], but also
* Spine uses its own [logging library][io.spine.dependency.local.Logging], but also
* provides a backend implementation for [Log4j2]. This is why
* this dependency is needed.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ object ArtifactVersion {
*
* @see <a href="https://github.com/SpineEventEngine/model-compiler">spine-model-compiler</a>
*/
@Suppress("unused")
@Deprecated(
message = "Please use `ModelCompiler.version` instead.",
ReplaceWith("ModelCompiler.version")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package io.spine.dependency.local
@Suppress("ConstPropertyName", "unused")
object CoreJava {
const val group = Spine.group
const val version = "2.0.0-SNAPSHOT.182"
const val version = "2.0.0-SNAPSHOT.191"

const val coreArtifact = "spine-core"
const val clientArtifact = "spine-client"
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ object Logging {
const val grpcContext = "$group:spine-logging-grpc-context:$version"
const val smokeTest = "$group:spine-logging-smoke-test:$version"

const val testLib = "${Spine.toolsGroup}:spine-logging-testlib:$version"

// Transitive dependencies.
// Make `public` and use them to force a version in a particular repository, if needed.
internal const val julBackend = "$group:spine-logging-jul-backend:$version"
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ object McJava {
/**
* The version used to in the build classpath.
*/
const val dogfoodingVersion = "2.0.0-SNAPSHOT.258"
const val dogfoodingVersion = "2.0.0-SNAPSHOT.259"

/**
* The version to be used for integration tests.
*/
const val version = "2.0.0-SNAPSHOT.258"
const val version = "2.0.0-SNAPSHOT.259"

/**
* The ID of the Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package io.spine.dependency.local
@Suppress("ConstPropertyName", "unused")
object ToolBase {
const val group = Spine.toolsGroup
const val version = "2.0.0-SNAPSHOT.234"
const val version = "2.0.0-SNAPSHOT.240"

const val lib = "$group:spine-tool-base:$version"
const val pluginBase = "$group:spine-plugin-base:$version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ package io.spine.dependency.local
*
* See [`SpineEventEngine/validation`](https://github.com/SpineEventEngine/validation/).
*/
@Suppress("ConstPropertyName")
@Suppress("ConstPropertyName", "unused")
object Validation {
/**
* The version of the Validation library artifacts.
*/
const val version = "2.0.0-SNAPSHOT.176"
const val version = "2.0.0-SNAPSHOT.178"

const val group = "io.spine.validation"
private const val prefix = "spine-validation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ fun KotlinJvmProjectExtension.applyJvmToolchain(version: String) =
*/
@Suppress("unused", "MagicNumber" /* Kotlin Compiler version. */)
fun KotlinCompile.setFreeCompilerArgs() {
// Avoid the "unsupported flag warning" for Kotlin compilers pre 1.9.20.
// Avoid the "unsupported flag warning" for Kotlin compilers pre 1.9.20 and after 2.0.0.
// See: https://youtrack.jetbrains.com/issue/KT-61573
val expectActualClasses =
if (KotlinVersion.CURRENT.isAtLeast(1, 9, 20)) "-Xexpect-actual-classes" else ""
val expectActualClasses = KotlinVersion.CURRENT.run {
if (isAtLeast(1, 9, 20) && major < 2) "-Xexpect-actual-classes"
else ""
}
kotlinOptions {
freeCompilerArgs = listOf(
"-Xskip-prerelease-check",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import io.spine.gradle.Repository
*
* There is a special treatment for this repository. Usually, fetching and publishing of artifacts
* is performed via the same URL. But it is not true for CloudRepo. Fetching is performed via
* public repository, and publishing via private one. Their URLs differ in `/public` infix.
* the public repository, and publishing via the private one. Their URLs differ in `/public` infix.
*/
internal object CloudRepo {

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/jvm-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import io.spine.dependency.lib.Guava
import io.spine.dependency.lib.JavaX
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.Logging
import io.spine.dependency.local.Spine
import io.spine.dependency.local.Reflect
import io.spine.dependency.local.TestLib
import io.spine.dependency.test.JUnit
import io.spine.dependency.test.Jacoco
Expand Down Expand Up @@ -162,7 +162,7 @@ fun Module.forceConfigurations() {
JUnit.bom,
JUnit.runner,
Dokka.BasePlugin.lib,
Spine.reflect
Reflect.lib,
)
}
}
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ fun Module.forceConfigurations() {
Logging.libJvm,
Logging.middleware,
CoreJava.server,
CoreJava.testUtilServer,
Validation.runtime,

Jackson.core,
Expand Down
2 changes: 1 addition & 1 deletion config
Submodule config updated 32 files
+1 −1 .github/workflows/gradle-wrapper-validation.yml
+3 −2 buildSrc/src/main/kotlin/DependencyResolution.kt
+9 −6 buildSrc/src/main/kotlin/io/spine/dependency/build/ErrorProne.kt
+6 −5 buildSrc/src/main/kotlin/io/spine/dependency/lib/Asm.kt
+1 −1 buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt
+13 −12 buildSrc/src/main/kotlin/io/spine/dependency/lib/Grpc.kt
+3 −2 buildSrc/src/main/kotlin/io/spine/dependency/lib/Guava.kt
+4 −1 buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaPoet.kt
+2 −1 buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaX.kt
+2 −1 buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt
+1 −1 buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt
+1 −1 buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt
+3 −2 buildSrc/src/main/kotlin/io/spine/dependency/lib/Roaster.kt
+29 −9 buildSrc/src/main/kotlin/io/spine/dependency/local/ArtifactVersion.kt
+42 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt
+40 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt
+40 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/Change.kt
+10 −4 buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt
+7 −2 buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt
+2 −2 buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt
+40 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/ModelCompiler.kt
+5 −3 buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt
+40 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/Reflect.kt
+45 −16 buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt
+40 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt
+40 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/Text.kt
+43 −0 buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt
+1 −1 buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt
+7 −4 buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt
+5 −3 buildSrc/src/main/kotlin/io/spine/gradle/kotlin/KotlinConfig.kt
+1 −1 buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudRepo.kt
+4 −3 buildSrc/src/main/kotlin/jvm-module.gradle.kts
Loading

0 comments on commit 87012df

Please sign in to comment.