diff --git a/.github/workflows/awx-e2e.yml b/.github/workflows/awx-e2e.yml deleted file mode 100644 index cd31bfb061..0000000000 --- a/.github/workflows/awx-e2e.yml +++ /dev/null @@ -1,179 +0,0 @@ -name: AWX E2E - -on: - workflow_call: - inputs: - AWX_SERVER: - type: string - required: true - SKIP_JOB: - type: boolean - required: false - default: false - TAGS: - type: string - required: false - secrets: - AWX_PASSWORD: - required: true - AWX_PROJECT_ID: - required: true - AWX_RECORD_KEY: - required: true - -jobs: - awx-ui-image: - name: AWX UI Image - runs-on: ubuntu-latest - # timeout-minutes: 10 - env: - DOCKER_BUILDKIT: 1 - steps: - - uses: actions/checkout@v4 - if: ${{ !inputs.SKIP_JOB }} - with: - fetch-depth: 1 - - - name: PreCache - if: ${{ !inputs.SKIP_JOB }} - run: npm version 0.0.0 --no-git-tag-version - - - name: Cache dependencies - if: ${{ !inputs.SKIP_JOB }} - id: cache - uses: actions/cache@v4 - with: - path: | - ./node_modules - /home/runner/.cache/Cypress - key: modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' && !inputs.SKIP_JOB - run: npm ci - - - name: NPM Build - if: ${{ !inputs.SKIP_JOB }} - run: npm run build:awx - - - name: Build Image - if: ${{ !inputs.SKIP_JOB }} - run: npm run docker:build:awx - - - name: Save Image - if: ${{ !inputs.SKIP_JOB }} - run: docker save awx-ui > awx-ui.tar - - - name: Upload Image - if: ${{ !inputs.SKIP_JOB }} - uses: actions/upload-artifact@v4 - with: - name: awx-ui.tar - path: awx-ui.tar - - generate-matrix: - name: Generate Test Matrix - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.MATRIX }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Generate matrix - id: set-matrix - run: | - matrix=$(find cypress/e2e/awx -maxdepth 1 -type d -not -path 'cypress/e2e/awx' | sed 's|cypress/e2e/awx/||' | jq -R . | jq -s -c .) - echo "Matrix value: $matrix" - echo "MATRIX=$matrix" >> $GITHUB_OUTPUT - - awx-e2e: - name: AWX E2E - runs-on: ubuntu-latest - needs: - - awx-ui-image - - generate-matrix - strategy: - fail-fast: false - matrix: - containers: ${{ contains(github.event.pull_request.labels.*.name, 'dashboard') && fromJson('[1,2,3,4]') || fromJson(needs.generate-matrix.outputs.MATRIX) }} - steps: - - name: Download container image - if: ${{ !inputs.SKIP_JOB }} - uses: actions/download-artifact@v4 - with: - name: awx-ui.tar - - - name: Load container image - if: ${{ !inputs.SKIP_JOB }} - run: docker load --input awx-ui.tar - - - name: Checkout - if: ${{ !inputs.SKIP_JOB }} - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Setup node - if: ${{ !inputs.SKIP_JOB }} - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: PreCache - if: ${{ !inputs.SKIP_JOB }} - run: npm version 0.0.0 --no-git-tag-version - - - name: Cache dependencies - if: ${{ !inputs.SKIP_JOB }} - id: cache - uses: actions/cache@v4 - with: - path: | - ./node_modules - /home/runner/.cache/Cypress - key: modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' && !inputs.SKIP_JOB - run: npm ci - - - name: Cypress with Recording - if: ${{ !inputs.SKIP_JOB && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'dashboard')) }} - uses: cypress-io/github-action@v6 - with: - install: false - start: npm run docker:run:awx - wait-on: 'https://localhost:4101' - record: true - parallel: true - config-file: cypress.awx.config.ts - tag: ${{ inputs.TAGS }} - env: - AWX_SERVER: ${{ inputs.AWX_SERVER }} - AWX_USERNAME: e2e - AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }} - CYPRESS_PROJECT_ID: ${{ secrets.AWX_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.AWX_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_TLS_REJECT_UNAUTHORIZED: 0 - CYPRESS_LABELS: '!flaky' - - - name: Cypress without Recording - if: ${{ !inputs.SKIP_JOB && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'dashboard') }} - uses: cypress-io/github-action@v6 - with: - install: false - start: npm run docker:run:awx - wait-on: 'https://localhost:4101' - config-file: cypress.awx.config.ts - spec: cypress/e2e/awx/${{ matrix.containers }}/**/*.cy.ts - tag: ${{ inputs.TAGS }} - env: - AWX_SERVER: ${{ inputs.AWX_SERVER }} - AWX_USERNAME: e2e - AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_TLS_REJECT_UNAUTHORIZED: 0 - CYPRESS_LABELS: '!flaky' - diff --git a/.github/workflows/awx-update-server.yml b/.github/workflows/awx-update-server.yml deleted file mode 100644 index 2cdf9ebd75..0000000000 --- a/.github/workflows/awx-update-server.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: AWX Update E2E Server - -on: - workflow_dispatch: - inputs: - AWX_SERVER: - type: string - description: 'AWX Server' - UPDATE_SERVER: - type: boolean - required: true - default: false - description: 'Update server on success' - schedule: - - cron: '0 8 * * *' - -jobs: - setup: - name: Setup - runs-on: ubuntu-latest - outputs: - AWX_SERVER: ${{ steps.step1.outputs.AWX_SERVER }} - UPDATE_SERVER: ${{ steps.step1.outputs.UPDATE_SERVER }} - steps: - - id: step1 - run: | - CURRENTDATE=$(date +'%Y%m%d') - if([ "${{ github.event_name }}" == "workflow_dispatch" ]); then - echo "AWX_SERVER=${{ github.event.inputs.AWX_SERVER || 'https://awx.ci-ui-${CURRENTDATE}.gcp.testing.ansible.com' }}" >> "$GITHUB_OUTPUT" - echo "UPDATE_SERVER=${{ github.event.inputs.UPDATE_SERVER }}" >> "$GITHUB_OUTPUT" - else - echo "AWX_SERVER=https://awx.ci-ui-${CURRENTDATE}.gcp.testing.ansible.com" >> "$GITHUB_OUTPUT" - echo "UPDATE_SERVER=true" >> "$GITHUB_OUTPUT" - fi - - awx-e2e: - name: AWX E2E - needs: setup - uses: ./.github/workflows/awx-e2e.yml - with: - AWX_SERVER: ${{ needs.setup.outputs.AWX_SERVER }} - secrets: - AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }} - AWX_PROJECT_ID: ${{ secrets.AWX_PROJECT_ID }} - AWX_RECORD_KEY: ${{ secrets.AWX_RECORD_KEY }} - - awx-update-server: - name: AWX Update Server - if: ${{ needs.setup.outputs.UPDATE_SERVER == 'true' }} - needs: - - awx-e2e - - setup - runs-on: ubuntu-latest - steps: - - name: Update Server Variable - run: | - curl -f -L -X PATCH -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/${{ github.repository }}/actions/variables/AWX_SERVER" \ - -d '{"name":"AWX_SERVER","value":"${{ needs.setup.outputs.AWX_SERVER }}"}' - - name: Slack Notification - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "attachments": - [ - { - "color": "#00DD00", - "blocks": - [ - { - "type": "section", - "text": - { - "type": "mrkdwn", - "text": "*Ansible-UI AWX E2E Server Updated* - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Success> - <${{ needs.setup.outputs.AWX_SERVER }}|Server>" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - slack-failure-notification: - name: Slack Failure Notification - if: ${{ failure() && needs.setup.outputs.UPDATE_SERVER == 'true' }} - needs: - - awx-update-server - - setup - runs-on: ubuntu-latest - steps: - - name: Slack Notification - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "attachments": - [ - { - "color": "#FF0000", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Ansible-UI AWX E2E Server Update Failed* - *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Failure>* - <${{ needs.setup.outputs.AWX_SERVER }}|Server>" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index 3d22302555..63c90862d9 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.yml @@ -1,42 +1,53 @@ -name: Pull Request +name: Component on: workflow_call: - secrets: - COMPONENT_PROJECT_ID: - required: true - COMPONENT_RECORD_KEY: + inputs: + directory: + description: 'The base directory to search for .cy.tsx files' required: true + type: string + jobs: + generate-matrix: + name: Generate Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.MATRIX }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate matrix + id: set-matrix + run: | + BASE_DIR="${{ inputs.directory }}" + matrix=$(find "$BASE_DIR" -type f -name '*.cy.tsx' -exec dirname {} \; | sed "s|^$BASE_DIR/||" | awk -F'/' '{print $1}' | sort -u | jq -R . | jq -s -c .) + echo "Matrix value: $matrix" + echo "MATRIX=$matrix" >> $GITHUB_OUTPUT + component: name: Component runs-on: ubuntu-latest + needs: generate-matrix strategy: - fail-fast: true + fail-fast: false matrix: - task: [ - "awx:access", - "awx:administration", - "awx:common", - "awx:overview", - "awx:resources", - "awx:views", - "eda", - "hub", - "common", - "framework" - ] + directory: ${{ fromJson(needs.generate-matrix.outputs.MATRIX) }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 1 + - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20 + - name: PreCache run: npm version 0.0.0 --no-git-tag-version + - name: Cache dependencies id: cache uses: actions/cache@v4 @@ -45,8 +56,14 @@ jobs: ./node_modules /home/runner/.cache/Cypress key: modules-${{ hashFiles('package-lock.json') }} + - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm ci - - name: Run Cypress component tests ${{ matrix.task }} - run: npm run component:${{ matrix.task }} + + - name: Cypress + uses: cypress-io/github-action@v6 + with: + install: false + component: true + spec: ${{ inputs.directory }}/${{ matrix.directory }}/**/*.cy.tsx diff --git a/.github/workflows/eda-e2e.yml b/.github/workflows/eda-e2e.yml deleted file mode 100644 index b16e9d1633..0000000000 --- a/.github/workflows/eda-e2e.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: EDA E2E - -on: - workflow_call: - inputs: - EDA_SERVER: - type: string - required: true - SKIP_JOB: - type: boolean - required: false - default: false - TAGS: - type: string - required: false - secrets: - EDA_PASSWORD: - required: true - EDA_PROJECT_ID: - required: true - EDA_RECORD_KEY: - required: true - -jobs: - eda-ui-image: - name: EDA UI Image - runs-on: ubuntu-latest - # timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - if: ${{ !inputs.SKIP_JOB }} - with: - fetch-depth: 1 - - name: PreCache - if: ${{ !inputs.SKIP_JOB }} - run: npm version 0.0.0 --no-git-tag-version - - name: Cache dependencies - if: ${{ !inputs.SKIP_JOB }} - id: cache - uses: actions/cache@v4 - with: - path: | - ./node_modules - /home/runner/.cache/Cypress - key: modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' && !inputs.SKIP_JOB - run: npm ci - - name: NPM Build - if: ${{ !inputs.SKIP_JOB }} - run: npm run build:eda - - name: Build Image - if: ${{ !inputs.SKIP_JOB }} - run: npm run docker:build:eda - - name: Save Image - if: ${{ !inputs.SKIP_JOB }} - run: docker save eda-ui > eda-ui.tar - - name: Upload Image - if: ${{ !inputs.SKIP_JOB }} - uses: actions/upload-artifact@v4 - with: - name: eda-ui.tar - path: eda-ui.tar - - eda-e2e: - name: EDA E2E - runs-on: ubuntu-latest - # timeout-minutes: 15 - needs: eda-ui-image - strategy: - fail-fast: false - matrix: - containers: [1] - steps: - - name: Checkout - if: ${{ !inputs.SKIP_JOB }} - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Download container image - if: ${{ !inputs.SKIP_JOB }} - uses: actions/download-artifact@v4 - with: - name: eda-ui.tar - - name: Load container image - if: ${{ !inputs.SKIP_JOB }} - run: docker load --input eda-ui.tar - - name: Setup Node - if: ${{ !inputs.SKIP_JOB }} - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: PreCache - if: ${{ !inputs.SKIP_JOB }} - run: npm version 0.0.0 --no-git-tag-version - - name: Cache dependencies - if: ${{ !inputs.SKIP_JOB }} - id: cache - uses: actions/cache@v4 - with: - path: | - ./node_modules - /home/runner/.cache/Cypress - key: modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' && !inputs.SKIP_JOB - run: npm ci - - name: Cypress - if: ${{ !inputs.SKIP_JOB }} - uses: cypress-io/github-action@v6 - with: - install: false - start: npm run docker:run:eda - wait-on: 'https://localhost:4103' - record: true - parallel: true - # auto-cancel-after-failures: 1 - config-file: cypress.eda.config.ts - tag: ${{ inputs.TAGS }} - env: - EDA_SERVER: ${{ inputs.EDA_SERVER }} - EDA_USERNAME: e2e - EDA_PASSWORD: ${{ secrets.EDA_PASSWORD }} - CYPRESS_PROJECT_ID: ${{ secrets.EDA_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.EDA_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_TLS_REJECT_UNAUTHORIZED: 0 - CYPRESS_LABELS: '!flaky' diff --git a/.github/workflows/eda-update-server.yml b/.github/workflows/eda-update-server.yml deleted file mode 100644 index 0c77975cbe..0000000000 --- a/.github/workflows/eda-update-server.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: EDA Update E2E Server - -on: - workflow_dispatch: - inputs: - EDA_SERVER: - type: string - description: 'EDA Server' - UPDATE_SERVER: - type: boolean - required: true - default: false - description: 'Update server on success' - schedule: - - cron: '0 8 * * *' - -jobs: - setup: - name: Setup - runs-on: ubuntu-latest - outputs: - EDA_SERVER: ${{ steps.step1.outputs.EDA_SERVER }} - UPDATE_SERVER: ${{ steps.step1.outputs.UPDATE_SERVER }} - steps: - - id: step1 - run: | - CURRENTDATE=$(date +'%Y%m%d') - if([ "${{ github.event_name }}" == "workflow_dispatch" ]); then - echo "EDA_SERVER=${{ github.event.inputs.EDA_SERVER || 'https://eda.ci-ui-${CURRENTDATE}.gcp.testing.ansible.com' }}" >> "$GITHUB_OUTPUT" - echo "UPDATE_SERVER=${{ github.event.inputs.UPDATE_SERVER }}" >> "$GITHUB_OUTPUT" - else - echo "EDA_SERVER=https://eda.ci-ui-${CURRENTDATE}.gcp.testing.ansible.com" >> "$GITHUB_OUTPUT" - echo "UPDATE_SERVER=true" >> "$GITHUB_OUTPUT" - fi - - eda-e2e: - name: EDA E2E - needs: setup - uses: ./.github/workflows/eda-e2e.yml - with: - EDA_SERVER: ${{ needs.setup.outputs.EDA_SERVER }} - secrets: - EDA_PASSWORD: ${{ secrets.EDA_PASSWORD }} - EDA_PROJECT_ID: ${{ secrets.EDA_PROJECT_ID }} - EDA_RECORD_KEY: ${{ secrets.EDA_RECORD_KEY }} - - eda-update-server: - name: EDA Update Server - if: ${{ needs.setup.outputs.UPDATE_SERVER == 'true' }} - needs: - - eda-e2e - - setup - runs-on: ubuntu-latest - steps: - - name: Update Server Variable - run: | - curl -f -L -X PATCH -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/${{ github.repository }}/actions/variables/EDA_SERVER" \ - -d '{"name":"EDA_SERVER","value":"${{ needs.setup.outputs.EDA_SERVER }}"}' - - name: Slack Notification - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "attachments": - [ - { - "color": "#00DD00", - "blocks": - [ - { - "type": "section", - "text": - { - "type": "mrkdwn", - "text": "*Ansible-UI EDA E2E Server Updated* - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Success> - <${{ needs.setup.outputs.EDA_SERVER }}|Server>" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - slack-failure-notification: - name: Slack Failure Notification - if: ${{ failure() && needs.setup.outputs.UPDATE_SERVER == 'true' }} - needs: - - eda-update-server - - setup - runs-on: ubuntu-latest - steps: - - name: Slack Notification - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "attachments": - [ - { - "color": "#FF0000", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Ansible-UI EDA E2E Server Update Failed* - *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Failure>* - <${{ needs.setup.outputs.EDA_SERVER }}|Server>" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file diff --git a/.github/workflows/hub-e2e.yml b/.github/workflows/hub-e2e.yml deleted file mode 100644 index b2782ee917..0000000000 --- a/.github/workflows/hub-e2e.yml +++ /dev/null @@ -1,142 +0,0 @@ -name: HUB E2E - -on: - workflow_call: - inputs: - HUB_SERVER: - type: string - required: true - SKIP_JOB: - type: boolean - required: false - default: false - TAGS: - type: string - required: false - secrets: - HUB_PASSWORD: - required: true - HUB_PROJECT_ID: - required: true - HUB_RECORD_KEY: - required: true - -jobs: - hub-ui-image: - name: HUB UI Image - runs-on: ubuntu-latest - # timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - if: ${{ !inputs.SKIP_JOB }} - with: - fetch-depth: 1 - - name: PreCache - if: ${{ !inputs.SKIP_JOB }} - run: npm version 0.0.0 --no-git-tag-version - - name: Cache dependencies - if: ${{ !inputs.SKIP_JOB }} - id: cache - uses: actions/cache@v4 - with: - path: | - ./node_modules - /home/runner/.cache/Cypress - key: modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' && !inputs.SKIP_JOB - run: npm ci - - name: NPM Build - if: ${{ !inputs.SKIP_JOB }} - run: npm run build:hub - env: - HUB_API_PREFIX: '/api/galaxy' - - name: Build Image - if: ${{ !inputs.SKIP_JOB }} - run: npm run docker:build:hub - - name: Save Image - if: ${{ !inputs.SKIP_JOB }} - run: docker save hub-ui > hub-ui.tar - - name: Upload Image - if: ${{ !inputs.SKIP_JOB }} - uses: actions/upload-artifact@v4 - with: - name: hub-ui.tar - path: hub-ui.tar - - hub-e2e: - name: HUB E2E - runs-on: ubuntu-latest - # timeout-minutes: 20 - needs: hub-ui-image - strategy: - fail-fast: false - matrix: - containers: [1] - steps: - - name: Checkout - if: ${{ !inputs.SKIP_JOB }} - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Download container image - if: ${{ !inputs.SKIP_JOB }} - uses: actions/download-artifact@v4 - with: - name: hub-ui.tar - - name: Load container image - if: ${{ !inputs.SKIP_JOB }} - run: docker load --input hub-ui.tar - - name: Setup Node - if: ${{ !inputs.SKIP_JOB }} - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: PreCache - if: ${{ !inputs.SKIP_JOB }} - run: npm version 0.0.0 --no-git-tag-version - - name: Cache dependencies - if: ${{ !inputs.SKIP_JOB }} - id: cache - uses: actions/cache@v4 - with: - path: | - ./node_modules - /home/runner/.cache/Cypress - key: modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' && !inputs.SKIP_JOB - run: npm ci - - # galaxykit needs pip 23+, Ubuntu 22.04's default Python uses pip 22 - - name: "Install python 3.11" - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Install galaxykit - run: | - # pip3 install galaxykit - # pending a release with https://github.com/ansible/galaxykit/pull/116 - pip3 install git+https://github.com/ansible/galaxykit.git@main - - - name: Cypress - if: ${{ !inputs.SKIP_JOB }} - uses: cypress-io/github-action@v6 - with: - install: false - start: npm run docker:run:hub - wait-on: 'https://localhost:4102' - record: true - parallel: true - config-file: cypress.hub.config.ts - tag: ${{ inputs.TAGS }} - env: - HUB_SERVER: ${{ inputs.HUB_SERVER }} - HUB_USERNAME: e2e - HUB_PASSWORD: ${{ secrets.HUB_PASSWORD }} - HUB_API_PREFIX: '/api/galaxy' - CYPRESS_PROJECT_ID: ${{ secrets.HUB_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.HUB_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_TLS_REJECT_UNAUTHORIZED: 0 - CYPRESS_LABELS: '!flaky' diff --git a/.github/workflows/hub-update-server.yml b/.github/workflows/hub-update-server.yml deleted file mode 100644 index 8a4c5e12e7..0000000000 --- a/.github/workflows/hub-update-server.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: HUB Update E2E Server - -on: - workflow_dispatch: - inputs: - HUB_SERVER: - type: string - description: 'HUB Server' - UPDATE_SERVER: - type: boolean - required: true - default: false - description: 'Update server on success' - schedule: - - cron: '0 8 * * *' - -jobs: - setup: - name: Setup - runs-on: ubuntu-latest - outputs: - HUB_SERVER: ${{ steps.step1.outputs.HUB_SERVER }} - UPDATE_SERVER: ${{ steps.step1.outputs.UPDATE_SERVER }} - steps: - - id: step1 - run: | - CURRENTDATE=$(date +'%Y%m%d') - if([ "${{ github.event_name }}" == "workflow_dispatch" ]); then - echo "HUB_SERVER=${{ github.event.inputs.HUB_SERVER || 'https://galaxy.ci-ui-${CURRENTDATE}.gcp.testing.ansible.com' }}" >> "$GITHUB_OUTPUT" - echo "UPDATE_SERVER=${{ github.event.inputs.UPDATE_SERVER }}" >> "$GITHUB_OUTPUT" - else - echo "HUB_SERVER=https://galaxy.ci-ui-${CURRENTDATE}.gcp.testing.ansible.com" >> "$GITHUB_OUTPUT" - echo "UPDATE_SERVER=true" >> "$GITHUB_OUTPUT" - fi - - hub-e2e: - name: HUB E2E - needs: setup - uses: ./.github/workflows/hub-e2e.yml - with: - HUB_SERVER: ${{ needs.setup.outputs.HUB_SERVER }} - secrets: - HUB_PASSWORD: ${{ secrets.HUB_PASSWORD }} - HUB_PROJECT_ID: ${{ secrets.HUB_PROJECT_ID }} - HUB_RECORD_KEY: ${{ secrets.HUB_RECORD_KEY }} - - hub-update-server: - name: HUB Update Server - if: ${{ needs.setup.outputs.UPDATE_SERVER == 'true' }} - needs: - - hub-e2e - - setup - runs-on: ubuntu-latest - steps: - - name: Update Server Variable - run: | - curl -f -L -X PATCH -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/${{ github.repository }}/actions/variables/HUB_SERVER" \ - -d '{"name":"HUB_SERVER","value":"${{ needs.setup.outputs.HUB_SERVER }}"}' - - name: Slack Notification - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "attachments": - [ - { - "color": "#00DD00", - "blocks": - [ - { - "type": "section", - "text": - { - "type": "mrkdwn", - "text": "*Ansible-UI Galaxy E2E Server Updated* - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Success> - <${{ needs.setup.outputs.HUB_SERVER }}|Server>" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - slack-failure-notification: - name: Slack Failure Notification - if: ${{ failure() && needs.setup.outputs.UPDATE_SERVER == 'true' }} - needs: - - hub-update-server - - setup - runs-on: ubuntu-latest - steps: - - name: Slack Notification - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "attachments": - [ - { - "color": "#FF0000", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Ansible-UI Galaxy E2E Server Update Failed* - *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Failure>* - <${{ needs.setup.outputs.HUB_SERVER }}|Server>" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index e79e048893..77bd21cfbe 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -10,4 +10,4 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v4 \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index fda27d953a..abe2dc76f1 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,10 +2,6 @@ name: Pull Request on: pull_request: - types: [opened, synchronize, labeled, unlabeled] - -env: - IS_GITHUB_ACTION: true concurrency: group: ${{ github.ref }} @@ -15,15 +11,8 @@ jobs: packages: name: Packages runs-on: ubuntu-latest - # timeout-minutes: 10 - outputs: - awx: ${{ steps.changed-awx.outputs.changed == 'true' }} - hub: ${{ steps.changed-hub.outputs.changed == 'true' }} - eda: ${{ steps.changed-eda.outputs.changed == 'true' }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 100 - uses: actions/setup-node@v4 with: node-version: 20 @@ -40,47 +29,13 @@ jobs: - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm ci - - id: changed-awx - run: | - if $(git diff --quiet HEAD^ HEAD -- frontend/awx frontend/common cypress/e2e/awx framework cypress/support package.json); then - echo "changed=false" >> "$GITHUB_OUTPUT" - else - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - id: changed-hub - run: | - if $(git diff --quiet HEAD^ HEAD -- frontend/hub frontend/common cypress/e2e/hub framework cypress/support package.json); then - echo "changed=false" >> "$GITHUB_OUTPUT" - else - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - id: changed-eda - run: | - if $(git diff --quiet HEAD^ HEAD -- frontend/eda frontend/common cypress/e2e/eda framework cypress/support package.json); then - echo "changed=false" >> "$GITHUB_OUTPUT" - else - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - pr-queue: - name: PR Queue - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ahmadnassri/action-workflow-queue@v1 - with: - delay: 60000 - timeout: 14400000 checks: name: ESLint - Prettier - TSC runs-on: ubuntu-latest - # timeout-minutes: 10 needs: packages steps: - uses: actions/checkout@v4 - with: - fetch-depth: 1 - uses: actions/setup-node@v4 with: node-version: 20 @@ -99,65 +54,51 @@ jobs: run: npm ci - run: npm run checks - awx-e2e: - name: AWX E2E - needs: - - packages - - pr-queue - uses: ./.github/workflows/awx-e2e.yml + awx: + name: AWX + needs: packages + uses: ./.github/workflows/component.yml + with: + directory: frontend/awx + + eda: + name: EDA + needs: packages + uses: ./.github/workflows/component.yml with: - AWX_SERVER: ${{ vars.AWX_SERVER }} - SKIP_JOB: ${{ needs.packages.outputs.awx != 'true' }} - secrets: - AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }} - AWX_PROJECT_ID: ${{ secrets.AWX_PROJECT_ID }} - AWX_RECORD_KEY: ${{ secrets.AWX_RECORD_KEY }} - - # eda-e2e: - # name: EDA E2E - # needs: - # - packages - # - pr-queue - # uses: ./.github/workflows/eda-e2e.yml - # with: - # EDA_SERVER: ${{ vars.EDA_SERVER }} - # SKIP_JOB: ${{ needs.packages.outputs.eda != 'true' }} - # secrets: - # EDA_PASSWORD: ${{ secrets.EDA_PASSWORD }} - # EDA_PROJECT_ID: ${{ secrets.EDA_PROJECT_ID }} - # EDA_RECORD_KEY: ${{ secrets.EDA_RECORD_KEY }} - - hub-e2e: - name: HUB E2E - needs: - - packages - - pr-queue - uses: ./.github/workflows/hub-e2e.yml + directory: frontend/eda + + hub: + name: HUB + needs: packages + uses: ./.github/workflows/component.yml with: - HUB_SERVER: ${{ vars.HUB_SERVER }} - SKIP_JOB: ${{ needs.packages.outputs.hub != 'true' }} - secrets: - HUB_PASSWORD: ${{ secrets.HUB_PASSWORD }} - HUB_PROJECT_ID: ${{ secrets.HUB_PROJECT_ID }} - HUB_RECORD_KEY: ${{ secrets.HUB_RECORD_KEY }} + directory: frontend/hub - component: - name: Component + common: + name: Common needs: packages uses: ./.github/workflows/component.yml - secrets: - COMPONENT_PROJECT_ID: ${{ secrets.COMPONENT_PROJECT_ID }} - COMPONENT_RECORD_KEY: ${{ secrets.COMPONENT_RECORD_KEY }} - + with: + directory: frontend/common + + framework: + name: Framework + needs: packages + uses: ./.github/workflows/component.yml + with: + directory: framework + success: name: Success runs-on: ubuntu-latest if: ${{ success() }} needs: - checks - - component - - awx-e2e - # - eda-e2e - - hub-e2e + - awx + - eda + - hub + - common + - framework steps: - run: echo Success diff --git a/.github/workflows/sync-downstream.yml b/.github/workflows/sync-downstream.yml index 8a9ef9bdeb..bdcef0abba 100644 --- a/.github/workflows/sync-downstream.yml +++ b/.github/workflows/sync-downstream.yml @@ -25,4 +25,4 @@ jobs: -H "Authorization: Bearer ${GH_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/ansible/aap-ui/dispatches \ - -d '{"event_type":"sync"}' + -d '{"event_type":"sync"}' \ No newline at end of file diff --git a/.github/workflows/upgrade-dependencies.yml b/.github/workflows/upgrade-dependencies.yml deleted file mode 100644 index be774264a4..0000000000 --- a/.github/workflows/upgrade-dependencies.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Upgrade Dependencies - -on: - workflow_dispatch: - schedule: - - cron: '15 20 * * *' - -concurrency: upgrade - -jobs: - upgrade-dependencies: - name: Upgrade Package Dependencies - if: (github.event_name == 'schedule' && github.repository == 'ansible/ansible-ui') || (github.event_name != 'schedule') - runs-on: ubuntu-latest - # timeout-minutes: 110 - steps: - - run: sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_TOKEN }} - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: npm run upgrade - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Upgraded package dependencies [skip ci] diff --git a/cypress/support/auth.ts b/cypress/support/auth.ts index 1f8514f09e..9b449b138a 100644 --- a/cypress/support/auth.ts +++ b/cypress/support/auth.ts @@ -3,10 +3,6 @@ import { edaAPI } from './formatApiPathForEDA'; import { hubAPI } from './formatApiPathForHub'; Cypress.Commands.add('requiredVariablesAreSet', (requiredVariables: string[]) => { - if (Cypress.env('IS_GITHUB_ACTION') || process.env.IS_GITHUB_ACTION) { - cy.log('Skipping requiredVariablesAreSet check in GitHub Actions'); - return; - } requiredVariables.forEach((variable) => { if (!Cypress.env(variable)) { throw new Error(`Missing required environment variable: ${variable}`); diff --git a/frontend/awx/access/organizations/OrganizationForm.tsx b/frontend/awx/access/organizations/OrganizationForm.tsx index 3b5ac83f2e..eadf965774 100644 --- a/frontend/awx/access/organizations/OrganizationForm.tsx +++ b/frontend/awx/access/organizations/OrganizationForm.tsx @@ -11,15 +11,15 @@ import { import { PageFormTextInput } from '../../../../framework/PageForm/Inputs/PageFormTextInput'; import { requestGet, requestPatch, swrOptions } from '../../../common/crud/Data'; import { usePostRequest } from '../../../common/crud/usePostRequest'; -import { useInvalidateCacheOnUnmount } from '../../../common/useInvalidateCache'; +import { useInvalidateCacheOnUnmount } from '../../../common/useInvalidateCache/useInvalidateCache'; import { PageFormSelectExecutionEnvironment } from '../../administration/execution-environments/components/PageFormSelectExecutionEnvironment'; import { PageFormInstanceGroupSelect } from '../../administration/instance-groups/components/PageFormInstanceGroupSelect'; import { AwxPageForm } from '../../common/AwxPageForm'; import { awxAPI } from '../../common/api/awx-utils'; +import { getAddedAndRemoved } from '../../common/util/getAddedAndRemoved'; import { InstanceGroup } from '../../interfaces/InstanceGroup'; import { Organization } from '../../interfaces/Organization'; import { AwxRoute } from '../../main/AwxRoutes'; -import { getAddedAndRemoved } from '../../common/util/getAddedAndRemoved'; type IOrganizationData = Organization & { instanceGroups?: InstanceGroup[]; diff --git a/frontend/awx/access/roles/RoleForm.tsx b/frontend/awx/access/roles/RoleForm.tsx index 4b065eb451..966b96a6d4 100644 --- a/frontend/awx/access/roles/RoleForm.tsx +++ b/frontend/awx/access/roles/RoleForm.tsx @@ -1,3 +1,4 @@ +import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useNavigate, useParams } from 'react-router-dom'; import { @@ -9,18 +10,17 @@ import { useGetPageUrl, usePageNavigate, } from '../../../../framework'; +import { PageFormMultiSelect } from '../../../../framework/PageForm/Inputs/PageFormMultiSelect'; +import { PageFormHidden } from '../../../../framework/PageForm/Utils/PageFormHidden'; import { useGet } from '../../../common/crud/useGet'; import { usePatchRequest } from '../../../common/crud/usePatchRequest'; import { usePostRequest } from '../../../common/crud/usePostRequest'; -import { useInvalidateCacheOnUnmount } from '../../../common/useInvalidateCache'; +import { useInvalidateCacheOnUnmount } from '../../../common/useInvalidateCache/useInvalidateCache'; import { AwxPageForm } from '../../common/AwxPageForm'; import { awxAPI } from '../../common/api/awx-utils'; import { AwxRbacRole } from '../../interfaces/AwxRbacRole'; import { AwxRoute } from '../../main/AwxRoutes'; import { AwxContentTypes, useAwxRoleMetadata } from './hooks/useAwxRoleMetadata'; -import { PageFormMultiSelect } from '../../../../framework/PageForm/Inputs/PageFormMultiSelect'; -import { PageFormHidden } from '../../../../framework/PageForm/Utils/PageFormHidden'; -import { useWatch } from 'react-hook-form'; export function CreateRole(props: { breadcrumbLabelForPreviousPage?: string }) { const { t } = useTranslation(); diff --git a/frontend/awx/main/AwxLogin.tsx b/frontend/awx/main/AwxLogin.tsx index 2fcc6cfc02..acc90b12f5 100644 --- a/frontend/awx/main/AwxLogin.tsx +++ b/frontend/awx/main/AwxLogin.tsx @@ -1,7 +1,7 @@ import { Page } from '@patternfly/react-core'; import useSWR, { mutate } from 'swr'; import { LoadingState } from '../../../framework/components/LoadingState'; -import { AnsibleLogin } from '../../common/AnsibleLogin'; +import { AnsibleLogin } from '../../common/AnsibleLogin/AnsibleLogin'; import type { AuthOption } from '../../common/SocialAuthLogin'; import { requestGet } from '../../common/crud/Data'; import { awxAPI } from '../common/api/awx-utils'; diff --git a/frontend/common/AnsibleLogin.cy.tsx b/frontend/common/AnsibleLogin/AnsibleLogin.cy.tsx similarity index 100% rename from frontend/common/AnsibleLogin.cy.tsx rename to frontend/common/AnsibleLogin/AnsibleLogin.cy.tsx diff --git a/frontend/common/AnsibleLogin.tsx b/frontend/common/AnsibleLogin/AnsibleLogin.tsx similarity index 94% rename from frontend/common/AnsibleLogin.tsx rename to frontend/common/AnsibleLogin/AnsibleLogin.tsx index cfad95b65a..bbd91739b2 100644 --- a/frontend/common/AnsibleLogin.tsx +++ b/frontend/common/AnsibleLogin/AnsibleLogin.tsx @@ -10,15 +10,15 @@ import { LoginMainHeader, } from '@patternfly/react-core'; import { ExclamationCircleIcon } from '@patternfly/react-icons'; -import { ReactNode, useCallback, useState, useEffect } from 'react'; -import { useLocation } from 'react-router'; +import { ReactNode, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { useLocation } from 'react-router'; import styled from 'styled-components'; -import { ErrorBoundary } from '../../framework/components/ErrorBoundary'; -import { useFrameworkTranslations } from '../../framework/useFrameworkTranslations'; -import { AuthOption, SocialAuthLogin } from './SocialAuthLogin'; -import { RequestError, createRequestError } from './crud/RequestError'; -import { getCookie } from './crud/cookie'; +import { useFrameworkTranslations } from '../../../framework'; +import { ErrorBoundary } from '../../../framework/components/ErrorBoundary'; +import { getCookie } from '../crud/cookie'; +import { createRequestError, RequestError } from '../crud/RequestError'; +import { AuthOption, SocialAuthLogin } from '../SocialAuthLogin'; export function AnsibleLogin(props: { /** Title for the login main body header of the login page */ diff --git a/frontend/common/crud/useDeleteRequest.tsx b/frontend/common/crud/useDeleteRequest.tsx index eb3dd9a7e9..7d8d8f01b6 100644 --- a/frontend/common/crud/useDeleteRequest.tsx +++ b/frontend/common/crud/useDeleteRequest.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef } from 'react'; -import { useClearCache } from '../useInvalidateCache'; +import { useClearCache } from '../useInvalidateCache/useInvalidateCache'; import { createRequestError } from './RequestError'; import { requestCommon } from './requestCommon'; diff --git a/frontend/common/crud/usePatchRequest.tsx b/frontend/common/crud/usePatchRequest.tsx index 339988d7ce..2c3a9716a9 100644 --- a/frontend/common/crud/usePatchRequest.tsx +++ b/frontend/common/crud/usePatchRequest.tsx @@ -1,4 +1,4 @@ -import { useClearCache } from '../useInvalidateCache'; +import { useClearCache } from '../useInvalidateCache/useInvalidateCache'; import { createRequestError } from './RequestError'; import { requestCommon } from './requestCommon'; diff --git a/frontend/common/crud/usePostRequest.tsx b/frontend/common/crud/usePostRequest.tsx index 13ab19fcfd..ff5249f128 100644 --- a/frontend/common/crud/usePostRequest.tsx +++ b/frontend/common/crud/usePostRequest.tsx @@ -1,4 +1,4 @@ -import { useClearCache } from '../useInvalidateCache'; +import { useClearCache } from '../useInvalidateCache/useInvalidateCache'; import { createRequestError } from './RequestError'; import { requestCommon } from './requestCommon'; diff --git a/frontend/common/crud/usePutRequest.tsx b/frontend/common/crud/usePutRequest.tsx index e114ec1838..3cd0e7a7e2 100644 --- a/frontend/common/crud/usePutRequest.tsx +++ b/frontend/common/crud/usePutRequest.tsx @@ -1,4 +1,4 @@ -import { useClearCache } from '../useInvalidateCache'; +import { useClearCache } from '../useInvalidateCache/useInvalidateCache'; import { createRequestError } from './RequestError'; import { requestCommon } from './requestCommon'; diff --git a/frontend/common/useInvalidateCache.cy.tsx b/frontend/common/useInvalidateCache/useInvalidateCache.cy.tsx similarity index 100% rename from frontend/common/useInvalidateCache.cy.tsx rename to frontend/common/useInvalidateCache/useInvalidateCache.cy.tsx diff --git a/frontend/common/useInvalidateCache.tsx b/frontend/common/useInvalidateCache/useInvalidateCache.tsx similarity index 100% rename from frontend/common/useInvalidateCache.tsx rename to frontend/common/useInvalidateCache/useInvalidateCache.tsx diff --git a/frontend/eda/access/organizations/OrganizationPage/OrganizationForm.tsx b/frontend/eda/access/organizations/OrganizationPage/OrganizationForm.tsx index 5379f1107b..55b6970279 100644 --- a/frontend/eda/access/organizations/OrganizationPage/OrganizationForm.tsx +++ b/frontend/eda/access/organizations/OrganizationPage/OrganizationForm.tsx @@ -11,11 +11,11 @@ import { import { PageFormTextInput } from '../../../../../framework/PageForm/Inputs/PageFormTextInput'; import { requestGet, requestPatch, swrOptions } from '../../../../common/crud/Data'; import { usePostRequest } from '../../../../common/crud/usePostRequest'; -import { useInvalidateCacheOnUnmount } from '../../../../common/useInvalidateCache'; +import { useInvalidateCacheOnUnmount } from '../../../../common/useInvalidateCache/useInvalidateCache'; +import { edaAPI } from '../../../common/eda-utils'; import { EdaPageForm } from '../../../common/EdaPageForm'; import { EdaOrganization, EdaOrganizationCreate } from '../../../interfaces/EdaOrganization'; import { EdaRoute } from '../../../main/EdaRoutes'; -import { edaAPI } from '../../../common/eda-utils'; export function CreateOrganization() { const { t } = useTranslation(); diff --git a/frontend/eda/access/roles/RoleForm.tsx b/frontend/eda/access/roles/RoleForm.tsx index b727d01dab..388bb56798 100644 --- a/frontend/eda/access/roles/RoleForm.tsx +++ b/frontend/eda/access/roles/RoleForm.tsx @@ -1,3 +1,4 @@ +import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useNavigate, useParams } from 'react-router-dom'; import { @@ -9,18 +10,17 @@ import { useGetPageUrl, usePageNavigate, } from '../../../../framework'; +import { PageFormMultiSelect } from '../../../../framework/PageForm/Inputs/PageFormMultiSelect'; +import { PageFormHidden } from '../../../../framework/PageForm/Utils/PageFormHidden'; import { useGet } from '../../../common/crud/useGet'; import { usePatchRequest } from '../../../common/crud/usePatchRequest'; import { usePostRequest } from '../../../common/crud/usePostRequest'; -import { useInvalidateCacheOnUnmount } from '../../../common/useInvalidateCache'; +import { useInvalidateCacheOnUnmount } from '../../../common/useInvalidateCache/useInvalidateCache'; import { EdaPageForm } from '../../common/EdaPageForm'; import { edaAPI } from '../../common/eda-utils'; import { EdaRbacRole } from '../../interfaces/EdaRbacRole'; import { EdaRoute } from '../../main/EdaRoutes'; import { EdaContentTypes, useEdaRoleMetadata } from './hooks/useEdaRoleMetadata'; -import { PageFormMultiSelect } from '../../../../framework/PageForm/Inputs/PageFormMultiSelect'; -import { PageFormHidden } from '../../../../framework/PageForm/Utils/PageFormHidden'; -import { useWatch } from 'react-hook-form'; export function CreateRole(props: { breadcrumbLabelForPreviousPage?: string }) { const { t } = useTranslation(); diff --git a/frontend/eda/access/teams/TeamPage/TeamForm.tsx b/frontend/eda/access/teams/TeamPage/TeamForm.tsx index 609ab3b405..2605701cac 100644 --- a/frontend/eda/access/teams/TeamPage/TeamForm.tsx +++ b/frontend/eda/access/teams/TeamPage/TeamForm.tsx @@ -11,13 +11,13 @@ import { import { PageFormTextInput } from '../../../../../framework/PageForm/Inputs/PageFormTextInput'; import { requestGet, requestPatch, swrOptions } from '../../../../common/crud/Data'; import { usePostRequest } from '../../../../common/crud/usePostRequest'; -import { useInvalidateCacheOnUnmount } from '../../../../common/useInvalidateCache'; +import { useInvalidateCacheOnUnmount } from '../../../../common/useInvalidateCache/useInvalidateCache'; +import { edaAPI } from '../../../common/eda-utils'; import { EdaPageForm } from '../../../common/EdaPageForm'; +import { EdaOrganization } from '../../../interfaces/EdaOrganization'; +import { EdaResult } from '../../../interfaces/EdaResult'; import { EdaTeam, EdaTeamCreate, EdaTeamDetail } from '../../../interfaces/EdaTeam'; import { EdaRoute } from '../../../main/EdaRoutes'; -import { edaAPI } from '../../../common/eda-utils'; -import { EdaResult } from '../../../interfaces/EdaResult'; -import { EdaOrganization } from '../../../interfaces/EdaOrganization'; import { PageFormSelectOrganization } from '../../organizations/components/PageFormOrganizationSelect'; export function CreateTeam() { diff --git a/frontend/eda/main/EdaLogin.tsx b/frontend/eda/main/EdaLogin.tsx index f7234203c0..7a26072f47 100644 --- a/frontend/eda/main/EdaLogin.tsx +++ b/frontend/eda/main/EdaLogin.tsx @@ -1,7 +1,7 @@ import { Page } from '@patternfly/react-core'; import { mutate } from 'swr'; import { LoadingState } from '../../../framework/components/LoadingState'; -import { AnsibleLogin } from '../../common/AnsibleLogin'; +import { AnsibleLogin } from '../../common/AnsibleLogin/AnsibleLogin'; import { edaAPI } from '../common/eda-utils'; import { useEdaActiveUser } from '../common/useEdaActiveUser'; diff --git a/frontend/hub/access/roles/RolePage/HubRoleForm.tsx b/frontend/hub/access/roles/RolePage/HubRoleForm.tsx index 7587b69cde..713d00a974 100644 --- a/frontend/hub/access/roles/RolePage/HubRoleForm.tsx +++ b/frontend/hub/access/roles/RolePage/HubRoleForm.tsx @@ -1,6 +1,6 @@ +import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useNavigate, useParams } from 'react-router-dom'; -import { useWatch } from 'react-hook-form'; import { PageFormSelect, PageFormSubmitHandler, @@ -10,18 +10,18 @@ import { useGetPageUrl, usePageNavigate, } from '../../../../../framework'; -import { useInvalidateCacheOnUnmount } from '../../../../common/useInvalidateCache'; +import { PageFormMultiSelect } from '../../../../../framework/PageForm/Inputs/PageFormMultiSelect'; +import { PageFormHidden } from '../../../../../framework/PageForm/Utils/PageFormHidden'; +import { useGet } from '../../../../common/crud/useGet'; +import { usePatchRequest } from '../../../../common/crud/usePatchRequest'; import { usePostRequest } from '../../../../common/crud/usePostRequest'; -import { HubRbacRole } from '../../../interfaces/expanded/HubRbacRole'; +import { useInvalidateCacheOnUnmount } from '../../../../common/useInvalidateCache/useInvalidateCache'; import { hubAPI } from '../../../common/api/formatPath'; -import { HubRoute } from '../../../main/HubRoutes'; import { HubPageForm } from '../../../common/HubPageForm'; -import { useHubRoleMetadata } from '../hooks/useHubRoleMetadata'; -import { PageFormHidden } from '../../../../../framework/PageForm/Utils/PageFormHidden'; -import { PageFormMultiSelect } from '../../../../../framework/PageForm/Inputs/PageFormMultiSelect'; import { ContentTypeEnum } from '../../../interfaces/expanded/ContentType'; -import { useGet } from '../../../../common/crud/useGet'; -import { usePatchRequest } from '../../../../common/crud/usePatchRequest'; +import { HubRbacRole } from '../../../interfaces/expanded/HubRbacRole'; +import { HubRoute } from '../../../main/HubRoutes'; +import { useHubRoleMetadata } from '../hooks/useHubRoleMetadata'; import { useIsValidRoleName } from '../hooks/useIsValidRoleName'; export function CreateRole(props: { breadcrumbLabelForPreviousPage?: string }) { diff --git a/frontend/hub/administration/remote-registries/RemoteRegistryForm.tsx b/frontend/hub/administration/remote-registries/RemoteRegistryForm.tsx index 2b9522f763..dade635207 100644 --- a/frontend/hub/administration/remote-registries/RemoteRegistryForm.tsx +++ b/frontend/hub/administration/remote-registries/RemoteRegistryForm.tsx @@ -18,7 +18,7 @@ import { PageFormSecret } from '../../../../framework/PageForm/Inputs/PageFormSe import { PageFormExpandableSection } from '../../../../framework/PageForm/PageFormExpandableSection'; import { useGet } from '../../../common/crud/useGet'; import { usePostRequest } from '../../../common/crud/usePostRequest'; -import { useClearCache } from '../../../common/useInvalidateCache'; +import { useClearCache } from '../../../common/useInvalidateCache/useInvalidateCache'; import { useIsValidUrl } from '../../../common/validation/useIsValidUrl'; import { HubError } from '../../common/HubError'; import { HubPageForm } from '../../common/HubPageForm'; diff --git a/frontend/hub/administration/remotes/RemoteForm.tsx b/frontend/hub/administration/remotes/RemoteForm.tsx index c1e5814edf..37554463ce 100644 --- a/frontend/hub/administration/remotes/RemoteForm.tsx +++ b/frontend/hub/administration/remotes/RemoteForm.tsx @@ -21,7 +21,7 @@ import { PageFormSection } from '../../../../framework/PageForm/Utils/PageFormSe import { LoadingPage } from '../../../../framework/components/LoadingPage'; import { useGet } from '../../../common/crud/useGet'; import { usePostRequest } from '../../../common/crud/usePostRequest'; -import { useClearCache } from '../../../common/useInvalidateCache'; +import { useClearCache } from '../../../common/useInvalidateCache/useInvalidateCache'; import { useIsValidUrl } from '../../../common/validation/useIsValidUrl'; import { HubError } from '../../common/HubError'; import { HubPageForm } from '../../common/HubPageForm'; diff --git a/frontend/hub/main/HubLogin.tsx b/frontend/hub/main/HubLogin.tsx index 4f31b4a3a2..10e14f8dc5 100644 --- a/frontend/hub/main/HubLogin.tsx +++ b/frontend/hub/main/HubLogin.tsx @@ -1,7 +1,7 @@ import { Page } from '@patternfly/react-core'; import { mutate } from 'swr'; import { LoadingState } from '../../../framework/components/LoadingState'; -import { AnsibleLogin } from '../../common/AnsibleLogin'; +import { AnsibleLogin } from '../../common/AnsibleLogin/AnsibleLogin'; import { useHubActiveUser } from '../../hub/common/useHubActiveUser'; import { hubAPI } from '../common/api/formatPath'; import { HubContextProvider } from '../common/useHubContext'; diff --git a/frontend/hub/namespaces/HubNamespaceForm.tsx b/frontend/hub/namespaces/HubNamespaceForm.tsx index 6addd4dd22..97e95f650a 100644 --- a/frontend/hub/namespaces/HubNamespaceForm.tsx +++ b/frontend/hub/namespaces/HubNamespaceForm.tsx @@ -14,7 +14,7 @@ import { PageFormSection } from '../../../framework/PageForm/Utils/PageFormSecti import { useGet } from '../../common/crud/useGet'; import { usePostRequest } from '../../common/crud/usePostRequest'; import { usePutRequest } from '../../common/crud/usePutRequest'; -import { useClearCache } from '../../common/useInvalidateCache'; +import { useClearCache } from '../../common/useInvalidateCache/useInvalidateCache'; import { HubError } from '../common/HubError'; import { HubPageForm } from '../common/HubPageForm'; import { hubAPI } from '../common/api/formatPath';