diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index bb33389..0000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright Contributors to the Egeria project - -# ignore certain jars from this archive. -**/*javadoc.jar -**/*sources.jar diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f901fb5..bc3d2c1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,6 @@ updates: open-pull-requests-limit: 100 reviewers: - planetf1 - - wbittles - package-ecosystem: "github-actions" directory: "/" schedule: @@ -17,10 +16,3 @@ updates: open-pull-requests-limit: 25 reviewers: - planetf1 -- package-ecosystem: docker - directory: "/" - schedule: - interval: monthly - open-pull-requests-limit: 10 - reviewers: - - planetf1 diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 61f8626..698720f 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -13,8 +13,6 @@ jobs: build: runs-on: ubuntu-latest name: "Merge" - env: - RELEASE_VERSION: 3.6 steps: - uses: actions/checkout@v3 - name: Set up JDK @@ -49,50 +47,5 @@ jobs: - name: Upload Connector uses: actions/upload-artifact@v3 with: - name: Postgres Connector + name: Database Connectors path: '**/build/libs/*.jar' - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.repository == 'odpi/egeria-database-connectors' }} - - name: Login to container registry (Quay.io) - uses: docker/login-action@v2 - with: - registry: quay.io - username: ${{ secrets.QUAY_IO_USERNAME }} - password: ${{ secrets.QUAY_IO_ACCESS_TOKEN }} - if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.repository == 'odpi/egeria-database-connectors' }} - # For releases (ie not main) - - name: Build and push (not main merge) - if: github.ref != 'refs/heads/main' - id: docker_build_release - uses: docker/build-push-action@v3 - with: - push: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.repository == 'odpi/egeria-database-connectors' }} - tags: odpi/egeria-database-connectors:${{env.RELEASE_VERSION}},quay.io/odpi/egeria-database-connectors:${{env.RELEASE_VERSION}} - build-args: version=${{ env.RELEASE_VERSION }} - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - # For main code stream - - name: Build and push (main merge) - if: github.ref == 'refs/heads/main' - id: docker_build_main - uses: docker/build-push-action@v3 - with: - push: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.repository == 'odpi/egeria-database-connectors' }} - tags: odpi/egeria-database-connectors:${{ env.RELEASE_VERSION}}, odpi/egeria-database-connectors:latest, quay.io/odpi/egeria-database-connectors:${{ env.RELEASE_VERSION}}, quay.io/odpi/egeria-database-connectors:latest - build-args: version=${{ env.RELEASE_VERSION }} - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - - name: Image digest (release) - if: github.ref != 'refs/heads/main' - run: echo ${{ steps.docker_build_release.outputs.digest }} - - name: Image digest (main) - if: github.ref == 'refs/heads/main' - run: echo ${{ steps.docker_build_main.outputs.digest }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c2502d..04fb833 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,5 +47,5 @@ jobs: - name: Upload Connector uses: actions/upload-artifact@v3 with: - name: Postgres Connector + name: Database Connectors path: '**/build/libs/*.jar' diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 7087862..32926b0 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -30,6 +30,6 @@ jobs: - name: Upload Connector uses: actions/upload-artifact@v3 with: - name: Postgres Connector + name: Database Connectors path: '**/build/libs/*.jar' diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b48d313..0000000 --- a/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright Contributors to the Egeria project - -# Thes are optional tags used to add additional metadata into the docker image -# These may be supplied by the pipeline in future - until then they will default - -ARG egeriaversion=3.11-SNAPSHOT -ARG baseimage=docker.io/odpi/egeria - -# DEFER setting this for now, using the ${version}: -# ARG EGERIA_IMAGE_DEFAULT_TAG=latest - -# This Dockerfile should be run from the parent directory of the egeria-connector-sas-viya directory -# ie -# docker -f ./Dockerfile - -FROM ${baseimage}:${egeriaversion} - -ARG connectorversion=3.11-SNAPSHOT -ARG postgresurl=https://jdbc.postgresql.org/download/postgresql-42.5.0.jar - -#ENV connectorversion ${connectorversion} -#ENV egeriaversion ${egeriaversion} -#ENV postgresurl ${postgresurl} - - -# Labels from https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys (with additions prefixed ext) -# We should inherit all the base labels from the egeria image and only overwrite what is necessary. -LABEL org.opencontainers.image.description = "Egeria with Postgres connector" \ - org.opencontainers.image.documentation = "https://github.com/odpi/egeria-database-connectors" - -# copy the connector -COPY egeria-connector-postgres/build/libs/egeria-connector-postgres-${connectorversion}.jar /deployments/server/lib -# get the postgres driver hardcoded version) -ADD ${postgresurl} /deployments/server/lib -# correct permissions from file download - we can only do this as root, and ADD doesn't have an option for chmod (only chown) -# so to maintain consistency (owned by root, globally readable) we fix here -USER root -RUN chmod -R guo+r /deployments/server/lib -# And return to the original user for security -USER jboss diff --git a/build.gradle b/build.gradle index 68cafb8..6a78802 100644 --- a/build.gradle +++ b/build.gradle @@ -3,33 +3,20 @@ * Copyright Contributors to the ODPi Egeria project. */ -/* - * Used for Build scripts/plugins only -*/ - -buildscript { - repositories { - - maven { url("https://oss.sonatype.org/content/repositories/snapshots") } - mavenCentral() - } - - dependencies { - classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:3.0.1' - } - tasks.withType(JavaCompile) { - configure(options) { - options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked' // examples - } - } -} /* * Plugins for this parent module only - so just high level project related */ +plugins { + id "io.freefair.aggregate-javadoc" version "6.5.1" + // Checks for unnecessary dependencies + id 'com.autonomousapps.dependency-analysis' version "1.13.1" + // helps resolve log implementation clashes + id 'dev.jacomet.logging-capabilities' version "0.10.0" + // This plugin helps resolve jakarta/javax dev.jacomet.logging-capabilities + id 'de.jjohannes.java-ecosystem-capabilities' version "0.6" +} -/* run './gradlew aggregateJavadocs' at top level to build all docs & output to build/docs/javadoc */ -apply plugin: 'nebula-aggregate-javadocs' /* * Configuration for all projects - INCLUDING this one @@ -37,43 +24,20 @@ apply plugin: 'nebula-aggregate-javadocs' allprojects { - // Published artifact info, equired for maven publishing - this is the version of our artifact group = 'org.odpi.egeria' - version = '3.11-SNAPSHOT' - - apply plugin: 'idea' + version = '3.13-SNAPSHOT' - // This enforces version checking but is slow to process - //apply plugin: 'nebula.lint' - //gradleLint { - // rules = ['all-dependency'] // TODO: Change to criticalRules when ready to enforce - // - //} - -} - -/* - * Configuration for sub projects only - */ - -subprojects { - - ext { - egeriaVersion = '3.11-SNAPSHOT' - } - - apply plugin: 'java-library' + // Mostly java, so default to this for now apply plugin: 'java' + apply plugin: 'jacoco' + apply plugin: 'de.jjohannes.java-ecosystem-capabilities' + apply plugin: 'dev.jacomet.logging-capabilities' + // As we've migrated from maven - we'll assume all submodules publish directly to maven apply plugin: 'maven-publish' - if (System.getenv("CI")) { - apply plugin: 'signing' - } - + // Only use maven central repositories { mavenCentral() - maven { url("https://oss.sonatype.org/content/repositories/snapshots") } - mavenLocal() } // ensures we pick up the very latest snapshots when built @@ -82,51 +46,55 @@ subprojects { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } + /* + * Dependency Management - to fix versions. Pick up maven build settings for now + */ + + // Assign variables for any constraints + ext { + // add version variables here + egeriaversion='3.12' + postgresversion='42.5.0' + } + dependencies { - constraints - { - implementation "org.postgresql:postgresql:42.5.0" - implementation "org.slf4j:slf4j-api:1.7.36" - implementation "org.odpi.egeria:data-manager-client:${egeriaVersion}" - implementation "org.odpi.egeria:data-manager-api:${egeriaVersion}" - implementation "org.odpi.egeria:database-integrator-api:${egeriaVersion}" - implementation "org.odpi.egeria:open-connector-framework:${egeriaVersion}" - } - test { - useJUnitPlatform { - includeEngines 'junit-jupiter' - } + implementation platform("org.odpi.egeria:egeria:${egeriaversion}") + constraints { + // Only include versions not already defined in egeria - or which need overriding + implementation "org.postgresql:postgresql:${postgresversion}" } } - // Maven Central (technically sonatype oss) requires we distribute source and javadoc + + /* + * Java related configuration + */ java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - withJavadocJar() withSourcesJar() + withJavadocJar() } - // More Java language settings tasks.withType(JavaCompile) { + options.release = 11 options.encoding = 'UTF-8' - sourceCompatibility = "11" - targetCompatibility = "11" options.incremental = true - options.fork = true options.failOnError = true - options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' + options.compilerArgs << "-Xlint:all" } - // For later java versions this is recommended - keep conditional in case we want to build on 8 + // javadoc javadoc { - if (JavaVersion.current().isJava9Compatible()) { - options.addBooleanOption('html5', true) - } + options.addBooleanOption('html5', true) + } + + // code coverage + jacoco { + toolVersion = "0.8.8" } - //need to decide who owns the testing infrastructure - //random junit versions picked below. + // Testing test { - useJUnitPlatform() + useJUnitPlatform { + includeEngines 'junit-jupiter' + } dependencies { testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0' @@ -139,11 +107,14 @@ subprojects { reports { html.required = true } - + } + /* + * Publishing of maven artifacts -- and signing (only for CI) + */ + if (System.getenv("CI")) { + apply plugin: 'signing' } - // We only have a single artifact for now - this additional metadata is - // required for publishing to maven central. Only doing signing in 'CI' publishing { publications { connector(MavenPublication) { @@ -170,19 +141,18 @@ subprojects { } } scm { - connection = 'scm:git:git://github.com/odpi/egeria-database-connectors.git' - developerConnection = 'scm:git:ssh://github.com/odpi/egeria/egeria-database-connectors.git' - url = 'http://github.com/odpi/egeria-database-connectors/' + connection = 'scm:git:git://github.com/odpi/egeria.git' + developerConnection = 'scm:git:ssh://github.com/odpi/egeria/egeria.git' + url = 'http://github.com/odpi/egeria' } } // Override the project name & description for the pom based on properties set in the child build.gradle (hard to default & required for maven central) pom.withXml { - asNode().appendNode('name', "${project.ext.name}") + asNode().appendNode('name', "${project.name}") asNode().appendNode('description', "${project.description}") } } } - // Release versions get pushed to staging area on maven central, snapshots to snapshot repo // Secrets for credentials if (System.getenv("CI")) { @@ -202,20 +172,69 @@ subprojects { } } - // To publish to ossrh we need to sign the artifacts - only in CI - if (System.getenv("CI")) { - signing { - // This is the publication to sign - sign publishing.publications.connector - // gpg --export-secret-keys myemal@gmail.com | base64 - def signingKey = System.getenv("OSSRH_GPG_PRIVATE_KEY") - // Passphrase for key - def signingPassword = System.getenv("OSSRH_GPG_PASSPHRASE") - // public key id (last 8 characters only) - note keys also need uploading to all the main registries - def signingKeyId = System.getenv("OSSRH_GPG_KEYID") - // We use these values from secrets rather than gradle.properties - useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) + /* + * Additional useful tasks + */ + task printAllDependencies(type: DependencyReportTask) {} + task printSubDependencies(type: DependencyReportTask) {} + task findDependency(type: DependencyInsightReportTask) {} + +} // end of allProjects + + +/* + * Configuration for sub projects only + */ +subprojects { + // All tasks currently will run under allProjects - which includes root. +} + + +/* + * Additional aggregate tasks run only at parent + */ + +// Jacoco reporting -- from gradle docs +task codeCoverageReport(type: JacocoReport) { + // Gather execution data from all subprojects + executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec") + + // Add all relevant sourcesets from the subprojects + subprojects.each { + sourceSets it.sourceSets.main + } + + // enable the different report types (html, xml, csv) + reports { + // xml is usually used to integrate code coverage with + // other tools like SonarQube, Coveralls or Codecov + xml.required = true + + // HTML reports can be used to see code coverage + // without any external tools + html.required = true + csv.required = true + } + +} +// always run the tests before generating the report +codeCoverageReport.dependsOn { + subprojects*.test +} + +// Dependency checking - see https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin +dependencyAnalysis { + issues { + all { + onAny { + severity('fail') + } + onUnusedDependencies { + exclude("junit:junit", "org.junit.jupiter:junit-jupiter-api", "org.junit.jupiter:junit-jupiter-engine", "com.fasterxml.jackson.core:jackson-annotations") + } } } } +// Always run dependency check for every regular build +build.dependsOn("buildHealth") diff --git a/egeria-connector-postgres/build.gradle b/egeria-connector-postgres/build.gradle index fd8b28d..a10f53c 100644 --- a/egeria-connector-postgres/build.gradle +++ b/egeria-connector-postgres/build.gradle @@ -12,9 +12,9 @@ description = 'Postgres Connector for Egeria' dependencies { implementation 'org.postgresql:postgresql' implementation 'org.slf4j:slf4j-api' - implementation 'org.odpi.egeria:data-manager-client' - implementation 'org.odpi.egeria:data-manager-api' - implementation 'org.odpi.egeria:database-integrator-api' - implementation 'org.odpi.egeria:open-connector-framework' + compileOnly 'org.odpi.egeria:data-manager-client' + compileOnly 'org.odpi.egeria:data-manager-api' + compileOnly 'org.odpi.egeria:database-integrator-api' + compileOnly 'org.odpi.egeria:open-connector-framework' } diff --git a/jdbc-integration-connector/build.gradle b/jdbc-integration-connector/build.gradle index 79a5b6a..8d8aa11 100644 --- a/jdbc-integration-connector/build.gradle +++ b/jdbc-integration-connector/build.gradle @@ -10,10 +10,10 @@ description = 'Egeria integration connector that uses Generic JDBC resource conn dependencies { implementation 'org.slf4j:slf4j-api' - implementation 'org.odpi.egeria:data-manager-client' - implementation 'org.odpi.egeria:data-manager-api' - implementation 'org.odpi.egeria:database-integrator-api' - implementation 'org.odpi.egeria:open-connector-framework' + compileOnly 'org.odpi.egeria:data-manager-client' + compileOnly 'org.odpi.egeria:data-manager-api' + compileOnly 'org.odpi.egeria:database-integrator-api' + compileOnly 'org.odpi.egeria:open-connector-framework' implementation project(':jdbc-resource-connector') } diff --git a/jdbc-resource-connector/build.gradle b/jdbc-resource-connector/build.gradle index 1e07440..c036600 100644 --- a/jdbc-resource-connector/build.gradle +++ b/jdbc-resource-connector/build.gradle @@ -10,7 +10,7 @@ description = 'JDBC Resource Connector for Egeria' dependencies { implementation 'org.slf4j:slf4j-api' - implementation 'org.odpi.egeria:open-connector-framework' - implementation 'org.odpi.egeria:audit-log-framework' + compileOnly 'org.odpi.egeria:open-connector-framework' + compileOnly 'org.odpi.egeria:audit-log-framework' } diff --git a/office b/office deleted file mode 100644 index 981e4a3..0000000 --- a/office +++ /dev/null @@ -1,3 +0,0 @@ -thu 4pm - each week -dev/community July/Aug - update -alternate weeks