Skip to content

Commit

Permalink
Merge branch 'core-sprint-2' into SLS-19
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-cialini authored Apr 12, 2023
2 parents 4eb159b + c7823bc commit b9183e4
Show file tree
Hide file tree
Showing 15 changed files with 368 additions and 117 deletions.
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!--- Please always add a PR description as if nobody knows anything about the context these changes come from. -->
<!--- Even if we are all from our internal team, we may not be on the same page. -->
<!--- Write this PR as you were contributing to a public OSS project, where nobody knows you and you have to earn their trust. -->
<!--- This will improve our projects in the long run! Thanks. -->

#### List of Changes

<!--- Describe your changes in detail -->

#### Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

#### How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

#### Screenshots (if appropriate):

#### Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as
expected)

#### Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
36 changes: 36 additions & 0 deletions .github/workflows/pr_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check Build and Anchore on PR

on:
pull_request:

env:
DOCKERFILE: Dockerfile.test-only

jobs:
pr_scan:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
with:
fetch-depth: 0
- name: Setup Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Run build with Gradle Wrapper
run: ./gradlew build
- name: Build the Docker image
run: docker build . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest
- name: Run the Anchore Grype scan action
uses: anchore/scan-action@d5aa5b6cb9414b0c7771438046ff5bcfa2854ed7
id: scan
with:
image: "localbuild/testimage:latest"
fail-build: true
severity-cutoff: "high"
- name: Upload Anchore Scan Report
uses: github/codeql-action/upload-sarif@9885f86fab4879632b7e44514f19148225dfbdcd
if: always()
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: cache
with:
key: OpenJDK11U-jdk_x64_linux_hotspot_11.0.18_10.tar.gz
path: |
- ${{ runner.temp }}/jdkfile.tar.gz
- ${{ runner.temp }}/jdkfile.sha256
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
# jdkfile version hash was locally computed and checked against https://github.com/paketo-buildpacks/adoptium/releases
- if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "4a29efda1d702b8ff38e554cf932051f40ec70006caed5c4857a8cbc7a0b7db7 ${{ runner.temp }}/jdkfile.tar.gz" >> ${{ runner.temp }}/jdkfile.sha256
echo {{ runner.temp }}/jdkfile.sha256
curl -L "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.18_10.tar.gz" -o "${{ runner.temp }}/jdkfile.tar.gz"
sha256sum --check --status "${{ runner.temp }}/jdkfile.sha256"
- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
with:
distribution: "jdkfile"
jdkFile: "${{ runner.temp }}/jdkfile.tar.gz"
java-version: "11"
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Publish package
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# see https://help.github.com/en/articles/about-code-owners#example-of-a-codeowners-file

* @pagopa/pagopa-tech
9 changes: 9 additions & 0 deletions Dockerfile.test-only
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM amazoncorretto:11

RUN mkdir /app

COPY core/build/libs/*.jar /app/
COPY http-verifier/build/libs/*.jar /app/
COPY redis-storage/build/libs/*.jar /app/
COPY identity-service-rest-client-native/build/libs/*.jar /app/
COPY assertion-rest-client-native/build/libs/*.jar /app/
2 changes: 0 additions & 2 deletions assertion-rest-client-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ plugins {
/*id("org.openapi.generator") version "6.5.0"*/
}

group 'it.pagopa.commons'

repositories {
mavenLocal()
mavenCentral()
Expand Down
30 changes: 29 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,31 @@ repositories {

allprojects {
version = "1.0.0-SNAPSHOT"
group = 'it.pagopa.tech'
group = 'it.pagopa.tech.lollipop-consumer-java-sdk'
sourceCompatibility = '11'
targetCompatibility = '11'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'nebula.lint'
gradleLint.rules = ['all-dependency']

configurations {
spotless {
resolutionStrategy {
disableDependencyVerification()
}
}
gradleLint {
resolutionStrategy {
disableDependencyVerification()
}
}
gradleEnterprise {
resolutionStrategy {
disableDependencyVerification()
}
}
}

spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'
Expand Down Expand Up @@ -102,6 +120,16 @@ subprojects {
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/pagopa/eng-lollipop-consumer-java-sdk"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

}
Expand Down
2 changes: 0 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ plugins {
id("io.freefair.lombok") version "8.0.0"
}

group 'it.pagopa.tech'

repositories {
mavenLocal()
mavenCentral()
Expand Down
42 changes: 42 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@
</artifact>
<artifact name="jackson-annotations-2.14.0.module">
<sha256 value="13632b3dd22a1f5379ba8c46f1ea321ea182253055dfad2be53cd6cb653ffe3d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-annotations" version="2.13.4">
<artifact name="jackson-annotations-2.13.4.jar">
<sha256 value="ac5b27a634942391ca113850ee7db01df1499a240174021263501c05fc653b44" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-annotations-2.13.4.module">
<sha256 value="649d6a2770182c6361ed8e2d6ea546e5f7123ef7a62fe7fad135d43184156d8f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-annotations" version="2.14.2">
Expand Down Expand Up @@ -276,6 +284,14 @@
</artifact>
<artifact name="jackson-core-2.14.0.module">
<sha256 value="e1724ae6ca921ecd06195fa80d180a6ad724069a97e54f3d13b25e9f08dba3c3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.13.4">
<artifact name="jackson-core-2.13.4.jar">
<sha256 value="4c2e043200edd9ee7ba6fc378bd5c17784a5bf2388e152d208068b51fd0839cf" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-core-2.13.4.module">
<sha256 value="7b2d5efa46a913848ea9a7c12a5a5c1e112e610499c9a17299d42092e35b67f0" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.14.2">
Expand Down Expand Up @@ -311,6 +327,14 @@
<artifact name="jackson-databind-2.14.0.module">
<sha256 value="1f8c85b4416c77c27273b169f237d05ad472106647af8706f8aba293ff804171" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.13.4.1">
<artifact name="jackson-databind-2.13.4.1.jar">
<sha256 value="18743ec8bf2a80b8ed2c2b269748d2417ea45e644e2ec8b18a2e32df0a0508ad" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-databind-2.13.4.1.module">
<sha256 value="48af5ff4cb7e93b8822ddce85ab1313c7f014d5b14c457c8e7ef08d684c28218" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.14.0-rc2">
<artifact name="jackson-databind-2.14.0-rc2.module">
Expand Down Expand Up @@ -808,6 +832,19 @@
<sha256 value="5f5dac5174f84c60a2e99e7a83c7826f734981fbc20ea1d437f7a6fcf8aada16" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.gradle" name="gradle-enterprise-gradle-plugin" version="3.9">
<artifact name="gradle-enterprise-gradle-plugin-3.9.jar">
<sha256 value="3aa47c96881210de7cd2c4e9fb3fe26a19b618c4506b8c462d4e988e3745e183" origin="Generated by Gradle"/>
</artifact>
<artifact name="gradle-enterprise-gradle-plugin-3.9.pom">
<sha256 value="f1fd493a23e9582026a42c6efaa99a167770d8b755c1e173d45adf30aaefab6f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.gradle.enterprise" name="com.gradle.enterprise.gradle.plugin" version="3.9">
<artifact name="com.gradle.enterprise.gradle.plugin-3.9.pom">
<sha256 value="84bab2512df76198aaf0955fde4fd7b3c6d252c4c3fb6ebb862f427aa838a087" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.jayway.jsonpath" name="json-path" version="2.7.0">
<artifact name="json-path-2.7.0.jar">
<sha1 value="f9d7d9659f2694e61142046ff8a216c047f263e8" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -2600,6 +2637,10 @@
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.7.1">
<artifact name="junit-bom-5.7.1.module">
<sha1 value="94767e8fb0c5c41a3502cd5cdd77dd35ed67bbfa" origin="Generated by Gradle"/>
<sha256 value="9854e3894d64b2485207e0046bca07b3d42d169e782f4fa8c9ce229a78faee04" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.7.1.pom">
<sha1 value="ea517dcd1a0692cf193264d3e3ef0cc1a4a7b410" origin="Generated by Gradle"/>
<sha256 value="0b9b14a3d62106fafe8c68a717b87b87ad18685899451b753c04fa41b6857784" origin="Generated by Gradle"/>
Expand All @@ -2608,6 +2649,7 @@
<component group="org.junit" name="junit-bom" version="5.7.2">
<artifact name="junit-bom-5.7.2.module">
<sha256 value="f3bceb1c59dd4f6993f4304dffa580172b8df65a76cd36fa4fd92c0578d28ad8" origin="Generated by Gradle"/>
<sha1 value="8e74668340163582c9520dfaf9c71579f556a15d" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.7.2.pom">
<sha1 value="e8848369738c03e40af5507686216f9b8b44b6a3" origin="Generated by Gradle"/>
Expand Down
2 changes: 1 addition & 1 deletion http-verifier/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
id("io.freefair.lombok") version "8.0.0"
}

group 'it.pagopa.tech'
group 'it.pagopa.tech.lollipop.sdk.impls'

repositories {
mavenLocal()
Expand Down
2 changes: 1 addition & 1 deletion identity-service-rest-client-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
/*id("org.openapi.generator") version "6.5.0"*/
}

group 'it.pagopa.tech'
group 'it.pagopa.tech.lollipop.sdk.impls'

repositories {
mavenLocal()
Expand Down
2 changes: 0 additions & 2 deletions redis-storage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ plugins {
id("io.freefair.lombok") version "8.0.0"
}

group 'it.pagopa.tech'

repositories {
mavenLocal()
mavenCentral()
Expand Down
6 changes: 2 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ application {
mainClassName = "it.pagopa.tech.sample.LollipopConsumerSample"
}

group 'it.pagopa.tech'

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
implementation 'it.pagopa.tech:core:1.0.0-SNAPSHOT'
implementation 'it.pagopa.tech:http-verifier:1.0.0-SNAPSHOT'
implementation 'it.pagopa.tech.lollipop-consumer-java-sdk:core:1.0.0-SNAPSHOT'
implementation 'it.pagopa.tech.lollipop-consumer-java-sdk:http-verifier:1.0.0-SNAPSHOT'
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
}
Expand Down
Loading

0 comments on commit b9183e4

Please sign in to comment.