Skip to content

Commit

Permalink
Merge branch 'main' into fix-scala-steward
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro authored Apr 30, 2024
2 parents 53fb1f2 + a002269 commit 9afab8a
Show file tree
Hide file tree
Showing 79 changed files with 3,521 additions and 3,038 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
username: hyperledger-bot
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install Compose
uses: ndeloof/install-compose-action@v0.0.1
Expand All @@ -54,8 +54,8 @@ jobs:
env:
CLOUD_AGENT_PATH: "../.."
ENV_FILE: "infrastructure/local/.env"
GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd "${CLOUD_AGENT_PATH}" || exit 129
sbt docker:publishLocal
Expand All @@ -71,16 +71,25 @@ jobs:
env:
PRISM_NODE_VERSION: ${{ steps.build_local_cloud_agent.outputs.prism_node_version }}
OPEN_ENTERPRISE_AGENT_VERSION: ${{ steps.build_local_cloud_agent.outputs.open_enterprise_agent_version }}
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
continue-on-error: true
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# continue-on-error: true
run: |
./gradlew test --tests "IntegrationTestsRunner"
- name: Make report of integration tests
if: always()
env:
PRISM_NODE_VERSION: ${{ steps.build_local_cloud_agent.outputs.prism_node_version }}
OPEN_ENTERPRISE_AGENT_VERSION: ${{ steps.build_local_cloud_agent.outputs.open_enterprise_agent_version }}
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew test --tests "IntegrationTestsRunner" || true
./gradlew reports
- name: Extract test results
id: analyze_test_results
if: github.ref_name == 'main'
if: github.ref_name == 'main' && always()
run: |
JSON_RESULTS="target/site/serenity/serenity-summary.json"
CONCLUSION=failure
Expand Down Expand Up @@ -118,14 +127,14 @@ jobs:
check_name: "Integration Test Results"

- name: Upload artifacts
if: github.ref_name == 'main' || steps.analyze_test_results.outputs.conclusion == 'failure'
if: github.ref_name == 'main' || failure()
uses: actions/upload-artifact@v4
with:
name: integration-tests-result
path: ${{ env.REPORTS_DIR }}

- name: Slack Notification
if: github.ref_name == 'main' && steps.analyze_test_results.outputs.conclusion == 'failure'
if: github.ref_name == 'main' && failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ steps.analyze_test_results.outputs.conclusion }}
Expand Down
66 changes: 43 additions & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
---
name: Linter

# Default shell is `sh`
# which is old, use bourne-again version instead
defaults:
run:
shell: bash
name: MegaLinter

on:
pull_request:

env: # Comment env block if you don't want to apply fixes
# Apply linter fixes configuration
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
APPLY_FIXES_MODE: pull_request # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
lint:
name: Lint changes
runs-on: self-hosted
container:
image: ghcr.io/input-output-hk/atala-qa-automation
volumes:
- /nix:/nix
credentials:
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
APPLY_FIXES: none
megalinter:
name: Megalinter

runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
# Git Chekcout
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Mega-Linter

- name: MegaLinter
id: ml
uses: megalinter/megalinter@v7.1.0
uses: oxsecurity/megalinter@v7.1.0

- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
Expand All @@ -42,3 +46,19 @@ jobs:
megalinter-reports
mega-linter.log
overwrite: true

# Create pull request if applicable (for now works only on PR from same repository, not from forks)
- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "style: Apply linters automatic fixes"
title: "style: Apply linters automatic fixes"
labels: "hyperledger-bot"
- name: Create PR output
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
10 changes: 5 additions & 5 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: "Validate PR Title"

on:
pull_request_target:
Expand All @@ -12,9 +12,9 @@ permissions:

jobs:
main:
name: Validate PR title
runs-on: self-hosted
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.4.0
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 13 additions & 13 deletions .github/workflows/release-clients.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Publish prism-agent clients
name: Publish Identus-cloud-agent clients

on:
workflow_dispatch:
inputs:
releaseTag:
description: "Tag to release clients (e.g. prism-agent-v1.31.0)"
description: "Tag to release clients (e.g. identus-cloud-agent-v1.33.0)"
required: true
type: string
push:
tags:
- "prism-agent-v*"
- "identus-cloud-agent-v*"

jobs:
publish-clients:
name: 'Build and publish Prism-Agent clients'
name: 'Build and publish Identus-cloud-Agent clients'
runs-on: ubuntu-latest
env:
VERSION_TAG: ${{inputs.releaseTag || github.ref_name}}
ATALA_GITHUB_ACTOR: ${{secrets.ATALA_GITHUB_ACTOR}}
ATALA_GITHUB_TOKEN: ${{secrets.ATALA_GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
GITHUB_ACTOR: "hyperledger-bot"
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

steps:
- name: Checkout
Expand All @@ -30,7 +30,7 @@ jobs:
with:
node-version: "lts/*"
registry-url: https://npm.pkg.github.com/
scope: "@hyperledger-labs"
scope: "@hyperledger"

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -44,20 +44,20 @@ jobs:
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
username: ${{ env.GITHUB_ACTOR }}
password: ${{ env.GITHUB_TOKEN }}

- name: Setup yq - portable yaml processor
uses: mikefarah/yq@v4.34.2

- name: Install generator dependencies
working-directory: prism-agent/client/generator
working-directory: cloud-agent/client/generator
run: yarn install

- name: Generate clients
working-directory: prism-agent/client/generator
working-directory: cloud-agent/client/generator
run: yarn generate:all

- name: Publish clients
working-directory: prism-agent/client/generator
working-directory: cloud-agent/client/generator
run: yarn publish:clients
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ target/
**.env.*
workspace.json
docs/architecture/structurizr/.structurizr/
cloud-agent/client/typescript
cloud-agent/client/kotlin/src/main/kotlin/
!cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/CredentialSubject.kt
!cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/Service.kt
!cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceAction.kt
6 changes: 3 additions & 3 deletions cloud-agent/client/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prism-agent client generator
# Cloud-agent client generator

This project goal is to generate the models based on the OpenAPI Specification.

Expand All @@ -18,9 +18,9 @@ cd generator
yarn publish:clients
```

## Prism-agent lifecycle
## Cloud-agent lifecycle

`prism-client-generator` creates the clients after the `prism-agent-v*` tag is created.
`identus-client-generator` creates the clients after the `cloud-agent-v*` tag is created.

## Supported clients

Expand Down
2 changes: 1 addition & 1 deletion cloud-agent/client/generator/generate-clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yarn openapi-generator-cli generate \
-i ../../service/api/http/cloud-agent-openapi-spec.yaml \
-o ../kotlin \
--ignore-file-override ../kotlin/.openapi-generator-ignore \
--additional-properties=packageName=io.iohk.atala.prism,serializationLibrary=gson,enumPropertyNaming=UPPERCASE
--additional-properties=packageName=org.hyperledger.identus.client,serializationLibrary=gson,enumPropertyNaming=UPPERCASE

# generate typescript models
yarn openapi-generator-cli generate \
Expand Down
12 changes: 6 additions & 6 deletions cloud-agent/client/kotlin/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ build.gradle
docs

# igore broken files
src/main/kotlin/io/iohk/atala/prism/models/UpdateManagedDIDServiceAction.kt
src/main/kotlin/io/iohk/atala/prism/models/UpdateManagedDIDServiceActionType.kt
src/main/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceAction.kt
src/main/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceActionType.kt

src/main/kotlin/io/iohk/atala/prism/models/Service.kt
src/main/kotlin/io/iohk/atala/prism/models/ServiceType.kt
src/main/kotlin/org/hyperledger/identus/client/models/Service.kt
src/main/kotlin/org/hyperledger/identus/client/models/ServiceType.kt

src/main/kotlin/io/iohk/atala/prism/models/StatusPurpose.kt
src/main/kotlin/io/iohk/atala/prism/models/CredentialSubject.kt
src/main/kotlin/org/hyperledger/identus/client/models/StatusPurpose.kt
src/main/kotlin/org/hyperledger/identus/client/models/CredentialSubject.kt
8 changes: 4 additions & 4 deletions cloud-agent/client/kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group 'io.iohk.atala.prism'
group 'org.hyperledger.identus'

wrapper {
gradleVersion = '7.5'
Expand Down Expand Up @@ -51,10 +51,10 @@ publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/hyperledger-labs/open-enterprise-agent/"
url = "https://maven.pkg.github.com/hyperledger/identus-cloud-agent/"
credentials {
username = System.getenv("ATALA_GITHUB_ACTOR")
password = System.getenv("ATALA_GITHUB_TOKEN")
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cloud-agent/client/kotlin/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

rootProject.name = 'prism-kotlin-client'
rootProject.name = 'cloud-agent-client-kotlin'
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"UnusedImport"
)

package org.hyperledger.identus.prism.models
package org.hyperledger.identus.client.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"UnusedImport"
)

package org.hyperledger.identus.prism.models
package org.hyperledger.identus.client.models

import org.hyperledger.identus.prism.models.Json
import org.hyperledger.identus.client.models.Json

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"UnusedImport"
)

package org.hyperledger.identus.prism.models
package org.hyperledger.identus.client.models

import org.hyperledger.identus.prism.models.Json
import org.hyperledger.identus.client.models.Json

import com.google.gson.annotations.SerializedName

Expand Down
12 changes: 6 additions & 6 deletions cloud-agent/client/python/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
Prism Agent
Identus Cloud Agent
No description provided
Expand All @@ -11,7 +11,7 @@

from setuptools import setup, find_packages # noqa: H301

NAME = "open-enterprise-agent-python-client"
NAME = "cloud-agent-client-python"
VERSION = "0.0.1"

REQUIRES = [
Expand All @@ -26,16 +26,16 @@
setup(
name=NAME,
version=VERSION,
description="Prism Agent Client",
description="Identus Cloud Agent Client",
author="Allain Magyar",
author_email="",
url="https://github.com/hyperledger-labs/open-enterprise-agent",
keywords=["Prism Agent"],
url="https://github.com/hyperledger/identus-cloud-agent",
keywords=["Identus Cloud Agent Client"],
python_requires=">=3.7",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
long_description="""\
Prism-agent models generated from OpenAPI Specification
Identus Cloud Agent models generated from the OpenAPI Specification
"""
)
Loading

0 comments on commit 9afab8a

Please sign in to comment.