Skip to content

Commit

Permalink
feat: EDC 0.7.2 migration (WIP)
Browse files Browse the repository at this point in the history
Co-authored-by: Christophe Loiseau <christophe.loiseau@sovity.de>
  • Loading branch information
richardtreier and ununhexium committed Nov 14, 2024
1 parent 739508f commit 7e57b98
Show file tree
Hide file tree
Showing 276 changed files with 7,607 additions and 9,136 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Feel free to edit this release checklist in-progress depending on what tasks nee
- [ ] Set the UI release version for `EDC_UI_IMAGE` of
the [docker-compose's .env file](https://github.com/sovity/edc-ce/blob/main/.env).
- [ ] If the Eclipse EDC version changed, update
the [eclipse-edc-management-api.yaml file](https://github.com/sovity/edc-ce/blob/main/docs/api/eclipse-edc-management-api.yaml).
the [eclipse-edc-management-api.yaml file](https://github.com/sovity/edc-ce/blob/main/docs/api/eclipse-edc-management-api.yaml) with [the official one](https://app.swaggerhub.com/apis/eclipse-edc-bot/management-api/).
- [ ] Run all tests locally as long as the [GH flaky tests](https://github.com/sovity/edc-ce/issues/870) are a problem.
- [ ] Merge the `release-prep` PR.
- [ ] Wait for the main branch to be green. You can check the status in GH [actions](https://github.com/sovity/edc-ce/actions).
Expand Down
4 changes: 3 additions & 1 deletion .github/markdown-link-checker-config.jq
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
{"pattern": "^https://www\\.linkedin\\.com"},
{"pattern": "https://(.*?)\\.azure\\.sovity\\.io"},
{"pattern": "http://edc2?:"},
{"pattern": "^https?://connector:"}
{"pattern": "^https?://connector:"},
{"pattern": "^https://app.swaggerhub.com/apis/eclipse-edc-bot/management-api/.*?"},
{"pattern": "^http://www.w3.org/ns/dcat.*"}
],
"replacementPatterns": [
{
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:
- name: "Gradle: Overwrite Artifact Version (Release Only)"
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
GRADLE_ARGS="-PsovityEdcExtensionsVersion=${GITHUB_REF#refs/tags/v}"
echo "GRADLE_ARGS=$GRADLE_ARGS" >> $GITHUB_ENV
sed -i "s/sovityCeVersion = \"[^\"]*\"/sovityCeVersion = \"${GITHUB_REF#refs/tags/v}\"/" gradle/libs.versions.toml
- name: "Gradle: Build"
uses: gradle/gradle-build-action@v2.10.0
with:
Expand Down
4 changes: 2 additions & 2 deletions UPDATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These are not easily testable and require a manual check.

After each EDC version update

- [ ] Check if `org.eclipse.edc.spi.types.domain.asset.Asset.toBuilder` added a new
- [ ] Check if `org.eclipse.edc.connector.controlplane.asset.spi.domain.Asset.toBuilder` added a new
field and adjust the builder in `de.sovity.edc.ext.wrapper.api.ui.pages.asset.AssetBuilder.fromEditMetadataRequest` accordingly

## Context
Expand All @@ -28,5 +28,5 @@ will remove that hypothetical new field.

#### Workaround

On the EDC version update, check that `org.eclipse.edc.spi.types.domain.asset.Asset.toBuilder` doesn't set more
On the EDC version update, check that `org.eclipse.edc.connector.controlplane.asset.spi.domain.Asset.toBuilder` doesn't set more
fields than what we set. If a new field was added, add it to this function too.
76 changes: 26 additions & 50 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,10 @@ dependencies {
testRuntimeOnly(libs.junit.engine)
}

val downloadArtifact: Configuration by configurations.creating {
isTransitive = false
}


val identityHubVersion: String by project
val registrationServiceVersion: String by project

// task that downloads the RegSrv CLI and IH CLI
val getJars by tasks.registering(Copy::class) {
outputs.upToDateWhen { false } //always download

from(downloadArtifact)
// strip away the version string
.rename { s ->
s.replace("-${identityHubVersion}", "")
.replace("-${registrationServiceVersion}", "")
.replace("-all", "")
}
into(layout.projectDirectory.dir("libs/cli-tools"))
}

// run the download jars task after the "jar" task
tasks {
jar {
finalizedBy(getJars)
}
}

allprojects {
apply(plugin = "java")
apply(plugin = "checkstyle")

configurations.all {
resolutionStrategy.force("org.eclipse.edc:runtime-metamodel:0.2.1")
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = JavaVersion.VERSION_17.toString()
Expand All @@ -60,7 +27,7 @@ allprojects {

useJUnitPlatform {
if (runningOnGithub) {
excludeTags = setOf("not-on-github")
excludeTags = setOf("exclude-on-github")
}
}

Expand All @@ -70,6 +37,7 @@ allprojects {
showExceptions = true
showCauses = true
}

failFast = true
}

Expand All @@ -88,17 +56,11 @@ allprojects {
}
maven {
url = uri("https://maven.pkg.github.com/truzzt/mds-ap3")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
withGitHubCredentials()
}
maven {
url = uri("https://maven.pkg.github.com/ids-basecamp/ids-infomodel-java")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
withGitHubCredentials()
}
maven {
url =
Expand All @@ -109,31 +71,45 @@ allprojects {
}

subprojects {
val libs = rootProject.libs

apply(plugin = "maven-publish")

val sovityEdcExtensionsVersion: String by project
version = sovityEdcExtensionsVersion
version = libs.versions.sovityCeVersion.get()

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/sovity/edc-ce")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
withGitHubCredentials()
}
}
}

tasks.register("printClasspath") {
group = libs.versions.edcGroup.get()
description = "The EdcRuntimeExtension JUnit Extension requires the gradle task 'printClasspath'"
group = libs.versions.sovityEdcGroup.get()
description = "Prints the classpath so EDC Integration tests can load a runtime of a full EDC including modules in tests"
println(sourceSets.main.get().runtimeClasspath.asPath)
}

java {
withSourcesJar()
}
}

fun MavenArtifactRepository.withGitHubCredentials() {
val gitHubUser = System.getenv("USERNAME")
?: project.findProperty("gpr.user") as String?
val gitHubToken = System.getenv("TOKEN")
?: project.findProperty("gpr.key") as String?

if (gitHubUser.isNullOrBlank() || gitHubToken.isNullOrBlank()) {
error("Need Gradle Properties 'gpr.user' and 'gpr.key' or environment variables 'USERNAME' and 'TOKEN' with a GitHub PAT to access the GitHub Maven Repository.")
}

credentials {
username = gitHubUser
password = gitHubToken
}
}
Loading

0 comments on commit 7e57b98

Please sign in to comment.