Skip to content

Commit

Permalink
Upgrade and Refactor UI for 3.0 (#3899)
Browse files Browse the repository at this point in the history
* Upgrade to Patternfly 5.  Switch to Vite.  Update all UI dependencies.  Restructure UI.  Separate UI from backend.

* Upgrade oidc-client-ts

* Remove UI from Quarkus config and web.xml

* Fixed some workflows and failing tests

* Removed old UI tests (will replace with Playwright based tests).

* Added basic playwright tests.  Added UI build to workflows.

* Add UI integration tests

* Update verify UI build workflow

* Upgrade deps

* Fixed an error in the verify and integration test workflow configs

* Fixed another config issue with the integration tests for UI

* Try to get the UI integration tests working.

* Enable CORS allowed origins in UI integration tests

* Update/create readmes.
  • Loading branch information
EricWittmann authored Nov 1, 2023
1 parent ca1ae79 commit bcc1310
Show file tree
Hide file tree
Showing 441 changed files with 23,629 additions and 51,717 deletions.
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,31 @@ updates:
- dependency-name: com.squareup.okhttp3:okhttp
versions:
- 4.9.1

- package-ecosystem: npm
directory: "/ui"
schedule:
interval: daily
open-pull-requests-limit: 10
versioning-strategy: increase

- package-ecosystem: npm
directory: "/ui/ui-app"
schedule:
interval: daily
open-pull-requests-limit: 10
versioning-strategy: increase

- package-ecosystem: npm
directory: "/ui/ui-docs"
schedule:
interval: daily
open-pull-requests-limit: 10
versioning-strategy: increase

- package-ecosystem: npm
directory: "/ui/tests"
schedule:
interval: daily
open-pull-requests-limit: 10
versioning-strategy: increase
133 changes: 113 additions & 20 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
IMAGE_TAG: 1d
run: make build-sql-image push-sql-image


prepare-kafkasql-tests:
name: Prepare for KafkaSQL Integration Tests
runs-on: ubuntu-20.04
Expand All @@ -72,7 +71,7 @@ jobs:
run: mvn -N io.takari:maven:wrapper -Dmaven=3.8.2

- name: Build kafkasql Variant
run: make SKIP_TESTS=true BUILD_FLAGS='-DskipUiBuild=true -Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-kafkasql
run: make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-kafkasql

- name: Build and Push kafkasql image
env:
Expand All @@ -81,6 +80,70 @@ jobs:
IMAGE_TAG: 1d
run: make build-kafkasql-image push-kafkasql-image

prepare-ui-tests:
name: Prepare for UI Integration Tests
runs-on: ubuntu-20.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Show Actor
run: echo ${{github.actor}}

- name: Checkout Code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: 'ui/**/package-lock.json'

- name: Get maven wrapper
run: mvn -N io.takari:maven:wrapper -Dmaven=3.8.2

- name: Build In-Memory Variant
run: make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-in-memory

- name: Build and Push In-Memory image
env:
IMAGE_REPO: ttl.sh/${{ github.sha }}
# maximum allowed
IMAGE_TAG: 1d
run: make build-mem-image push-mem-image

- name: Install UI Dependencies
run: |
cd ui
npm install
- name: Lint UI Code
run: |
cd ui
npm run lint
- name: Build and Package UI
run: |
cd ui
npm run build
npm run package
- name: Build and Push UI image
env:
IMAGE_REPO: ttl.sh/${{ github.sha }}
# maximum allowed
IMAGE_TAG: 1d
run: |
cd ui
docker build -t $IMAGE_REPO/apicurio/apicurio-registry-ui:$IMAGE_TAG .
docker push $IMAGE_REPO/apicurio/apicurio-registry-ui:$IMAGE_TAG
integration-tests-sql:
name: Integration Tests SQL
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -173,37 +236,67 @@ jobs:
integration-tests-ui:
name: Integration Tests UI
runs-on: ubuntu-20.04
needs: prepare-sql-tests
needs: prepare-ui-tests
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Setup Minikube
uses: manusa/actions-setup-[email protected]
- name: Set up Node
uses: actions/setup-node@v3
with:
minikube version: 'v1.31.1'
kubernetes version: 'v1.26.3'
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker

- name: Prepare minikube tunnel
run: minikube tunnel &> /dev/null &
node-version: 16
cache: 'npm'
cache-dependency-path: 'ui/tests/package-lock.json'

- name: Run UI tests
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql:1d' run-ui-tests
run: |
echo "Starting Registry App (In Memory)"
docker run -it -p 8080:8080 -d --env CORS_ALLOWED_ORIGINS=* ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-mem:1d
echo "Starting Registry UI"
docker run -it -p 8888:8080 -d ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-ui:1d
cd ui/tests
npm install
npx playwright install --with-deps
echo "App System Info:"
echo "--"
curl -s http://localhost:8080/apis/registry/v2/system/info
echo "--"
echo ""
echo "UI Config Info:"
echo "--"
curl -s http://localhost:8888/config.js
echo "--"
echo ""
echo "UI Version Info:"
curl -s http://localhost:8888/version.js
echo "--"
echo "UI index.html:"
echo "--"
curl -s http://localhost:8888
echo "--"
echo ""
echo "-------------------------"
echo "Running Playwright tests!"
echo "-------------------------"
npm run test
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ui/tests/playwright-report/
retention-days: 30

- name: Collect logs
if: failure()
run: ./.github/scripts/collect_logs.sh

- name: Upload tests logs artifacts
if: failure()
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v3
with:
name: tests-logs
path: artifacts
34 changes: 29 additions & 5 deletions .github/workflows/release-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
tag:
description: 'Release tag name'
required: true

release:
types: [released, prereleased]

Expand All @@ -25,7 +24,6 @@ jobs:
env:
RELEASE_TYPE: release
steps:

- name: View Disk Usage
run: df -h

Expand Down Expand Up @@ -95,12 +93,25 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Build Project
- name: Set up Node.js v16
uses: actions/setup-node@v1
with:
node-version: 16

- name: Build Registry
run: cd registry && make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-all


- name: Build Registry UI
run: |
cd registry/ui
npm install
npm run lint
npm run build
npm run package
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

- name: Build and Push Multi-arch Images to Docker.io
run: cd registry && ./.github/scripts/build-and-push-multiarch-images.sh ${BRANCH} docker.io multiarch-registry-images ${RELEASE_TYPE} ${RELEASE_VERSION}

Expand All @@ -110,6 +121,19 @@ jobs:
- name: Build and Push Multi-arch Images to Quay.io
run: cd registry && ./.github/scripts/build-and-push-multiarch-images.sh ${BRANCH} quay.io multiarch-registry-images ${RELEASE_TYPE} ${RELEASE_VERSION}

- name: Build and Push UI Multi-arch Images
if: github.event_name == 'push'
run: |
cd registry/ui
docker buildx build --push -f ./Dockerfile \
-t docker.io/apicurio/apicurio-registry-ui:latest \
-t docker.io/apicurio/apicurio-registry-ui:latest-release \
-t docker.io/apicurio/apicurio-registry-ui:$RELEASE_VERSION \
-t quay.io/apicurio/apicurio-registry-ui:latest \
-t quay.io/apicurio/apicurio-registry-ui:latest-release \
-t quay.io/apicurio/apicurio-registry-ui:$RELEASE_VERSION \
--platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le .
- name: Google Chat Notification
if: ${{ failure() }}
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
Expand Down
61 changes: 36 additions & 25 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
echo "Releasing Apicurio Registry version ${{ github.event.inputs.release-version }} from branch ${{ github.event.inputs.branch }}"
echo "Next Snapshot version will be ${{ github.event.inputs.snapshot-version }}"
- name: Set up Node.js v12
uses: actions/setup-node@v1
with:
node-version: 12

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Node.js v16
uses: actions/setup-node@v1
with:
node-version: 16

- name: Set up settings.xml
run: |
pwd
Expand Down Expand Up @@ -82,11 +82,30 @@ jobs:
PYTHON_SDK_VERSION=$(echo "${{ github.event.inputs.release-version}}" | awk -F '.' '{print $1"."$2"."$3}')
sed -i "s/^version.*/version \= \"${PYTHON_SDK_VERSION}\"/" python-sdk/pyproject.toml
# take only the major, minor and patch
UI_VERSION=$(echo "${{ github.event.inputs.release-version}}" | awk -F '.' '{print $1"."$2"."$3}')
cd ui
npm version $UI_VERSION
cd ui-app
npm version $UI_VERSION
cd ../ui-docs
npm version $UI_VERSION
cd ../tests
npm version $UI_VERSION
- name: Build Registry (All Variants)
run: |
cd registry
make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-all
- name: Build Registry UI
run: |
cd registry/ui
npm install
npm run lint
npm run build
npm run package
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@f6f458f535f4ccdf100400ee0755c0e857226a66
env:
Expand All @@ -111,7 +130,6 @@ jobs:
uses: snok/install-poetry@d45b6d76012debf457ab49dffc7fb7b2efe8071d
if: github.event.inputs.skip-python-sdk == 'false'


- name: Release Python SDK
run: |
cd registry
Expand Down Expand Up @@ -165,38 +183,31 @@ jobs:
sed -i "5s/\"version\"\:\s\".*\"/\"version\": \"${DOCS_VERSION}\"/g" app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi.json
# take only the major, minor and patch
PYTHON_SDK_VERSION=$(echo "${{ github.event.inputs.release-version}}" | awk -F '.' '{print $1"."$2"."$3}')
PYTHON_SDK_VERSION=$(echo "${{ github.event.inputs.snapshot-version}}" | awk -F '.' '{print $1"."$2"."$3}')
sed -i "s/^version.*/version \= \"${PYTHON_SDK_VERSION}\"/" python-sdk/pyproject.toml
# take only the major, minor and patch
UI_VERSION=$(echo "${{ github.event.inputs.snapshot-version}}" | awk -F '.' '{print $1"."$2"."$3}')
cd ui
npm version $UI_VERSION
cd ui-app
npm version $UI_VERSION
cd ../ui-docs
npm version $UI_VERSION
cd ../tests
npm version $UI_VERSION
- name: Commit Snapshot Version ${{ github.event.inputs.snapshot-version}}
run: |
cd registry
git add .
git commit -m "Automated update to next Snapshot Version: ${{ github.event.inputs.snapshot-version}}"
git push
# TODO: ${{ steps.create_release.outputs.html_url }} will not be available, since we're now using script to do github release. Need to explicitly fetch
# - name: Tweet About The Release
# uses: ethomson/send-tweet-action@v1
# with:
# status: "Apicurio Registry version ${{ github.event.inputs.release-version}} is out! Check out the release notes here: ${{ steps.create_release.outputs.html_url }}"
# consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
# consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
# access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
# access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}

- name: Google Chat Notification
if: ${{ failure() }}
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
with:
name: ${{ github.workflow }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}


job-trigger:
needs: [release]
uses: ./.github/workflows/tag-registry-examples.yaml
with:
release-version: ${{ github.event.inputs.release-version}}
snapshot-version: ${{ github.event.inputs.snapshot-version}}
Loading

0 comments on commit bcc1310

Please sign in to comment.