diff --git a/.changeset/eighty-steaks-wink.md b/.changeset/eighty-steaks-wink.md new file mode 100644 index 000000000..dc62cd2c9 --- /dev/null +++ b/.changeset/eighty-steaks-wink.md @@ -0,0 +1,6 @@ +--- +"@cloudoperators/juno-app-heureka": patch +"@cloudoperators/juno-app-greenhouse": patch +--- + +This fixes the embedded prop handling, ensuring it is passed correctly to AppShell. diff --git a/.changeset/perfect-socks-beam.md b/.changeset/perfect-socks-beam.md new file mode 100644 index 000000000..14e8d53ad --- /dev/null +++ b/.changeset/perfect-socks-beam.md @@ -0,0 +1,5 @@ +--- +"@cloudoperators/juno-ui-components": minor +--- + +Migrate the Search Input component to TypeScript diff --git a/.changeset/stale-wasps-hammer.md b/.changeset/stale-wasps-hammer.md new file mode 100644 index 000000000..dd71e3998 --- /dev/null +++ b/.changeset/stale-wasps-hammer.md @@ -0,0 +1,6 @@ +--- +"@cloudoperators/juno-app-heureka": minor +"@cloudoperators/juno-app-greenhouse": patch +--- + +Improved overall performance of Services and IssueMatches views by optimizing the underlying GraphQL queries diff --git a/.github/scripts/build-vite-app.sh b/.github/scripts/build-vite-app.sh new file mode 100755 index 000000000..8dca35dd0 --- /dev/null +++ b/.github/scripts/build-vite-app.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +# collect the necessary information +entry_file=$(jq -r '.module // .main' $PACKAGE_PATH/package.json) +build_folder=$(dirname $entry_file) +package_name=$(jq -r '.name' $PACKAGE_PATH/package.json) + +# Run build using turbo +npx turbo run build:static --filter $package_name + +# Copy build folder to deploy path +mkdir -p "$DEPLOY_PATH/$TARGET_FOLDER" +cp -r "$PACKAGE_PATH/$build_folder/." "$DEPLOY_PATH/$TARGET_FOLDER" + +# Generate appProps.json if APP_PROPS_BASE64 is non-empty +if [ -n "$APP_PROPS_BASE64" ]; then + echo "$APP_PROPS_BASE64" | base64 -d > "$DEPLOY_PATH/$TARGET_FOLDER/appProps.json" +fi diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 73a8dc041..d6ebb898c 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -43,16 +43,21 @@ jobs: needs: [run-detect-changes] runs-on: [default] steps: - - name: Output changes - id: filter - run: | - changes='${{ needs.run-detect-changes.outputs.changes }}' - echo "====" - echo $changes - echo "===" - - uses: actions/checkout@v4 + - name: Precompile ENVs + if: github.event.action != 'closed' + id: compile-envs + run: | + #setup ENVs for each app to preview + echo "IS_STORYBOOK_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'ui-components') }}" >> $GITHUB_ENV + echo "IS_SUPERNOVA_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'supernova') }}" >> $GITHUB_ENV + echo "IS_HEUREKA_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'heureka') }}" >> $GITHUB_ENV + echo "IS_DOOP_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'doop') }}" >> $GITHUB_ENV + echo "IS_CARBON_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'carbon') }}" >> $GITHUB_ENV + echo "IS_GREENHOUSE_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'greenhouse') }}" >> $GITHUB_ENV + echo "IS_EXAMPLE_CHANGED=${{ contains(needs.run-detect-changes.outputs.changes, 'example') || contains(needs.run-detect-changes.outputs.changes, 'ui-components') }}" >> $GITHUB_ENV + - uses: actions/setup-node@v4 if: github.event.action != 'closed' with: @@ -63,20 +68,25 @@ jobs: run: | npm install --force - - name: Create a tmp folder with all compiled apps and pkgs + - name: Create a folder with all compiled apps and pkgs if: github.event.action != 'closed' run: | mkdir -p ${{ env.DEPLOY_PATH }} - - name: Build storybook if changes detected - if: github.event.action != 'closed' && contains(needs.run-detect-changes.outputs.changes, 'ui-components') + - name: Build STORYBOOK if changes detected + id: build-storybook + if: github.event.action != 'closed' && env.IS_STORYBOOK_CHANGED == 'true' run: | npm -w @cloudoperators/juno-ui-components run build-storybook - cp -r packages/ui-components/storybook-static ${{ env.DEPLOY_PATH }}/ui-components + cp -r ${{ env.PACKAGE_PATH }}/storybook-static ${{ env.DEPLOY_PATH }}/${{ env.TARGET_FOLDER }} + env: + PACKAGE_PATH: packages/ui-components + TARGET_FOLDER: storybook continue-on-error: true - - name: Build supernova if changes detected - if: github.event.action != 'closed' && contains(needs.run-detect-changes.outputs.changes, 'supernova') + - name: Build SUPERNOVA if changes detected + id: build-supernova + if: github.event.action != 'closed' && env.IS_SUPERNOVA_CHANGED == 'true' run: | ./.github/scripts/build-app.sh env: @@ -85,23 +95,10 @@ jobs: APP_PROPS_BASE64: ${{ secrets.SUPERNOVA_APP_PROPS_BASE64 }} continue-on-error: true - - name: Build heureka if changes detected - if: github.event.action != 'closed' && contains(needs.run-detect-changes.outputs.changes, 'heureka') - run: | - # collect the necessary information - entry_file=$(jq -r '.module // .main' $PACKAGE_PATH/package.json) - build_folder=$(dirname $entry_file) - package_name=$(jq -r '.name' $PACKAGE_PATH/package.json) - - # Run build using turbo - npx turbo run build:static --filter $package_name - - # Copy build folder to deploy path - mkdir -p "$DEPLOY_PATH/$TARGET_FOLDER" - cp -r "$PACKAGE_PATH/$build_folder/." "$DEPLOY_PATH/$TARGET_FOLDER" - - # Generate appProps.json - echo "$APP_PROPS_BASE64" | base64 -d > "$DEPLOY_PATH/$TARGET_FOLDER/appProps.json" + - name: Build HEUREKA if changes detected + id: build-heureka + if: github.event.action != 'closed' && env.IS_HEUREKA_CHANGED == 'true' + run: ./.github/scripts/build-vite-app.sh env: PACKAGE_PATH: apps/heureka TARGET_FOLDER: heureka @@ -109,111 +106,85 @@ jobs: continue-on-error: true - name: Build DOOP if changes detected - if: github.event.action != 'closed' && contains(needs.run-detect-changes.outputs.changes, 'doop') - run: | - # collect the necessary information - entry_file=$(jq -r '.module // .main' $PACKAGE_PATH/package.json) - build_folder=$(dirname $entry_file) - package_name=$(jq -r '.name' $PACKAGE_PATH/package.json) - - # Run build using turbo - npx turbo run build:static --filter $package_name - - # Copy build folder to deploy path - mkdir -p "$DEPLOY_PATH/$TARGET_FOLDER" - cp -r "$PACKAGE_PATH/$build_folder/." "$DEPLOY_PATH/$TARGET_FOLDER" - - # Generate appProps.json - echo "$APP_PROPS_BASE64" | base64 -d > "$DEPLOY_PATH/$TARGET_FOLDER/appProps.json" + id: build-doop + if: github.event.action != 'closed' && env.IS_DOOP_CHANGED == 'true' + run: ./.github/scripts/build-vite-app.sh env: PACKAGE_PATH: apps/doop TARGET_FOLDER: doop APP_PROPS_BASE64: ${{ secrets.DOOP_APP_PROPS_BASE64 }} continue-on-error: true - - name: Build Carbon if changes detected - if: github.event.action != 'closed' && contains(needs.run-detect-changes.outputs.changes, 'carbon') - run: | - # collect the necessary information - entry_file=$(jq -r '.module // .main' $PACKAGE_PATH/package.json) - build_folder=$(dirname $entry_file) - package_name=$(jq -r '.name' $PACKAGE_PATH/package.json) - - # Run build using turbo - npx turbo run build:static --filter $package_name - - # Copy build folder to deploy path - mkdir -p "$DEPLOY_PATH/$TARGET_FOLDER" - cp -r "$PACKAGE_PATH/$build_folder/." "$DEPLOY_PATH/$TARGET_FOLDER" - - # Generate appProps.json if APP_PROPS_BASE64 is non-empty - if [ -n "$APP_PROPS_BASE64" ]; then - echo "$APP_PROPS_BASE64" | base64 -d > "$DEPLOY_PATH/$TARGET_FOLDER/appProps.json" - fi + - name: Build CARBON if changes detected + id: build-carbon + if: github.event.action != 'closed' && env.IS_CARBON_CHANGED == 'true' + run: ./.github/scripts/build-vite-app.sh env: PACKAGE_PATH: apps/carbon TARGET_FOLDER: carbon - APP_PROPS_BASE64: ${{ secrets.CARBON_APP_PROPS_BASE64 }} continue-on-error: true - name: Build GREENHOUSE if changes detected - if: github.event.action != 'closed' && contains(needs.run-detect-changes.outputs.changes, 'greenhouse') + id: build-greenhouse + if: github.event.action != 'closed' && env.IS_GREENHOUSE_CHANGED == 'true' run: | - # collect the necessary information - entry_file=$(jq -r '.module // .main' $PACKAGE_PATH/package.json) - build_folder=$(dirname $entry_file) - package_name=$(jq -r '.name' $PACKAGE_PATH/package.json) - - # Run build using turbo - npx turbo run build --filter $package_name - - # Copy the necessary files - mkdir -p "$DEPLOY_PATH/$TARGET_FOLDER" - cp -r "$PACKAGE_PATH/$build_folder" "$DEPLOY_PATH/$TARGET_FOLDER/$build_folder" - cp "$PACKAGE_PATH/public/favicon.ico" "$DEPLOY_PATH/$TARGET_FOLDER/" - cp "$PACKAGE_PATH/public/favicon.svg" "$DEPLOY_PATH/$TARGET_FOLDER/" - - # Generate index.html and appProps.json - cp "$PACKAGE_PATH/docker/index.html" "$DEPLOY_PATH/$TARGET_FOLDER/index.html" - entry_file_escaped=$(echo "$entry_file" | sed 's/\//\\\//g') + ./.github/scripts/build-app.sh + + # Specific changes for greenhouse sed -i 's|/appProps.json?%VERSION%|./appProps.json|g' "$DEPLOY_PATH/$TARGET_FOLDER/index.html" sed -i "s|/index.js?%VERSION%|./$entry_file_escaped|g" "$DEPLOY_PATH/$TARGET_FOLDER/index.html" - echo "$APP_PROPS_BASE64" | base64 -d > "$DEPLOY_PATH/$TARGET_FOLDER/appProps.json" env: PACKAGE_PATH: apps/greenhouse TARGET_FOLDER: greenhouse APP_PROPS_BASE64: ${{ secrets.GREENHOUSE_APP_PROPS_BASE64 }} continue-on-error: true + - name: Build EXAMPLE if changes detected + id: build-example + if: github.event.action != 'closed' && env.IS_EXAMPLE_CHANGED == 'true' + run: ./.github/scripts/build-vite-app.sh + env: + PACKAGE_PATH: apps/example + TARGET_FOLDER: example + continue-on-error: true + - name: Generate index.html for Deployed Apps if: github.event.action != 'closed' env: - UI_COMPONENTS_CHANGED: ${{ contains(needs.run-detect-changes.outputs.changes, 'ui-components') }} - SUPERNOVA_CHANGED: ${{ contains(needs.run-detect-changes.outputs.changes, 'supernova') }} - HEUREKA_CHANGED: ${{ contains(needs.run-detect-changes.outputs.changes, 'heureka') }} - DOOP_CHANGED: ${{ contains(needs.run-detect-changes.outputs.changes, 'doop') }} - CARBON_CHANGED: ${{ contains(needs.run-detect-changes.outputs.changes, 'carbon') }} - GREENHOUSE_CHANGED: ${{ contains(needs.run-detect-changes.outputs.changes, 'greenhouse') }} + STORYBOOK_OUTCOME: "${{ steps.build-storybook.outcome }}" + SUPERNOVA_OUTCOME: "${{ steps.build-supernova.outcome }}" + HEUREKA_OUTCOME: "${{ steps.build-heureka.outcome }}" + DOOP_OUTCOME: "${{ steps.build-doop.outcome }}" + CARBON_OUTCOME: "${{ steps.build-carbon.outcome }}" + GREENHOUSE_OUTCOME: "${{ steps.build-greenhouse.outcome }}" + EXAMPLE_OUTCOME: "${{ steps.build-example.outcome }}" run: | - echo "PR Prview

Deployed Packages for PR ${GITHUB_HEAD_REF}