Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #798

Merged
merged 25 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
67179ff
ci: :construction_worker: enable manual trigger on unit tests in ci
this-is-tobi Oct 27, 2023
073d2c6
ci: :construction_worker: fix cypress cache in ci
this-is-tobi Oct 27, 2023
3119f3a
ci: :construction_worker: enable multi browsers tests through cypress
this-is-tobi Oct 28, 2023
47321cc
Merge pull request #799 from cloud-pi-native/tech/multi-browsers-e2e-…
this-is-tobi Oct 30, 2023
80ce642
feat: :sparkles: add quota and stage management for admin
clairenollet Oct 24, 2023
c451d65
Merge pull request #783 from cloud-pi-native/feat/admin-stage-quotas
this-is-tobi Oct 30, 2023
df63ec6
build: :arrow_up: upgrade nodejs to v20.9.0
this-is-tobi Oct 30, 2023
5d724c2
build: :arrow_up: upgrade nodejs dependencies
this-is-tobi Oct 30, 2023
7b9ef4b
Merge pull request #801 from cloud-pi-native/tech/upgrade-dependencies
this-is-tobi Oct 31, 2023
6faacae
refactor: :wrench: update ES module or lib to benefit from latest arr…
clairenollet Oct 31, 2023
96b9ae8
Merge pull request #804 from cloud-pi-native/refactor/esnext-for-new-…
clairenollet Oct 31, 2023
9e85c0d
refactor: :children_crossing: reword infra repository description
this-is-tobi Oct 31, 2023
215023b
Merge pull request #803 from cloud-pi-native/refactor/enhance-infra-r…
this-is-tobi Oct 31, 2023
e133853
feat: :sparkles: add stage management for admin
clairenollet Oct 31, 2023
36235c1
Merge pull request #806 from cloud-pi-native/feat/stage-management-ad…
clairenollet Nov 10, 2023
461c6bd
fix: :bug: fix endless redirect on login if authenticated
clairenollet Nov 10, 2023
1f4d94f
Merge pull request #812 from cloud-pi-native/fix/endless-redirect-on-…
clairenollet Nov 12, 2023
ccd66f8
fix: :bug: should not set caData if skipTLSVerify is true
ArnaudTA Nov 10, 2023
dd05757
Merge pull request #811 from cloud-pi-native/fix/argo-cluster-secret
this-is-tobi Nov 13, 2023
f1bf907
fix: :bug: add missing await in gitlab createProjectMirror
clairenollet Nov 13, 2023
75c6fd3
Merge pull request #819 from cloud-pi-native/fix/missing-await-gitlab
clairenollet Nov 13, 2023
c92ea8b
fix: :lock: root token is not used in new repo credential when synced
ArnaudTA Nov 13, 2023
07fdcb3
Merge pull request #817 from cloud-pi-native/tech/do-not-use-gitlab-r…
ArnaudTA Nov 13, 2023
cdccbcb
ci: :construction_worker: fix branch name on manually triggered sonar…
this-is-tobi Nov 13, 2023
8c49d49
Merge pull request #822 from cloud-pi-native/tech/fix-manual-sonar-scan
this-is-tobi Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ on:
types:
- closed
workflow_dispatch:
inputs:
PR_NUMBER:
description: ID number of the pull request assiocited with the cache
required: false
type: number
BRANCH_NAME:
description: Branch name assiocited with the cache
required: false
type: string

jobs:
cleanup-cache:
Expand All @@ -19,7 +28,11 @@ jobs:
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
if [ -n "${{ inputs.BRANCH_NAME }}" ]; then
BRANCH="${{ inputs.BRANCH_NAME }}"
else
BRANCH="refs/pull/${{ github.event.pull_request.number || inputs.PR_NUMBER }}/merge"
fi

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
Expand All @@ -37,6 +50,7 @@ jobs:
matrix:
name: Generate matrix for build & scan
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.number || github.event.number }}
outputs:
build-matrix: ${{ steps.build-matrix.outputs.BUILD_MATRIX }}
steps:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:

env:
NODE_VERSION: "18.18.0"
NODE_VERSION: "20.9.0"
PNPM_VERSION: "8"
REGISTRY: "ghcr.io"
NAMESPACE: "${{ github.repository }}"
Expand Down Expand Up @@ -82,6 +82,7 @@ jobs:
with:
NODE_VERSION: ${{ needs.expose-vars.outputs.NODE_VERSION }}
PNPM_VERSION: ${{ needs.expose-vars.outputs.PNPM_VERSION }}
BROWSERS: "${{ github.base_ref == 'main' && 'electron,firefox' || 'electron' }}"

build:
uses: ./.github/workflows/build.yml
Expand All @@ -105,6 +106,7 @@ jobs:
NODE_VERSION: ${{ needs.expose-vars.outputs.NODE_VERSION }}
PNPM_VERSION: ${{ needs.expose-vars.outputs.PNPM_VERSION }}
TAG: pr-${{ github.event.pull_request.number || github.event.number }}
BROWSERS: "${{ github.base_ref == 'main' && 'electron,firefox' || 'electron' }}"

deploy-tests:
uses: ./.github/workflows/tests-deploy.yml
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ on:
PNPM_VERSION:
required: false
type: string
workflow_dispatch:
inputs:
NODE_VERSION:
description: Nodejs version used to run tests
required: true
type: string
default: "18.18.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
type: string
default: "8"

jobs:
lint:
Expand Down
56 changes: 53 additions & 3 deletions .github/workflows/tests-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,48 @@ on:
PNPM_VERSION:
required: true
type: string
BROWSERS:
required: true
type: string
workflow_dispatch:
inputs:
NODE_VERSION:
description: Nodejs version used to run tests
required: true
type: string
default: "18.18.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
type: string
default: "8"
BROWSERS:
description: Comma separeted browser list to run tests on (Options are 'electron', 'chrome', 'edge', 'firefox')
required: false
type: string
default: "electron"

jobs:
unit-tests:
matrix:
name: Generate browsers matrix
runs-on: ubuntu-latest
outputs:
browsers: ${{ steps.build-matrix.outputs.BROWSERS }}
steps:
- name: Generate matrix for build
id: build-matrix
run: |
BROWSERS=$(echo "\"${{ inputs.BROWSERS }}\"" | jq -c 'split(",")')
echo "BROWSERS=$BROWSERS" >> $GITHUB_OUTPUT

component-tests:
name: Component tests
runs-on: ubuntu-latest
needs:
- matrix
strategy:
matrix:
browsers: ${{ fromJson(needs.matrix.outputs.browsers) }}
steps:
- name: Checks-out repository
uses: actions/checkout@v3
Expand All @@ -30,6 +67,18 @@ jobs:
with:
node-version: "${{ inputs.NODE_VERSION }}"

- name: Setup firefox
uses: browser-actions/setup-firefox@v1
if: ${{ matrix.browsers == 'firefox' }}

- name: Setup chrome
uses: browser-actions/setup-chrome@v1
if: ${{ matrix.browsers == 'chrome' }}

- name: Setup edge
uses: browser-actions/setup-edge@v1
if: ${{ matrix.browsers == 'edge' }}

- name: Get pnpm store directory
id: pnpm-store
run: |
Expand All @@ -50,8 +99,9 @@ jobs:
with:
path: |
./.turbo/cache
key: turbo-component-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('apps/**/src/**','packages/**/src/**') }}
key: turbo-component-${{ runner.os }}-${{ runner.arch }}-${{ matrix.browsers }}-${{ hashFiles('apps/**/src/**','apps/client/cypress/**','packages/**/src/**') }}
restore-keys: |
turbo-component-${{ runner.os }}-${{ runner.arch }}-${{ matrix.browsers }}-
turbo-component-${{ runner.os }}-${{ runner.arch }}-

- name: Install dependencies
Expand All @@ -60,7 +110,7 @@ jobs:
- name: Run component tests
run: |
./ci/scripts/init-env.sh
./ci/scripts/run-tests.sh -c
./ci/scripts/run-tests.sh -c -b "${{ matrix.browsers }}"

- name: Upload cypress artifacts
if: ${{ failure() }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/tests-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
TAG:
required: true
type: string
workflow_dispatch:
inputs:
TAG:
description: Image tag used ti run tests
required: true
type: string
default: "latest"

jobs:
deploy-check:
Expand Down
59 changes: 57 additions & 2 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,53 @@ on:
TAG:
required: true
type: string
BROWSERS:
required: true
type: string
workflow_dispatch:
inputs:
NODE_VERSION:
description: Nodejs version used to run tests
required: true
type: string
default: "18.18.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
type: string
default: "8"
TAG:
description: Image tag used to run tests
required: true
type: string
default: "latest"
BROWSERS:
description: Comma separeted browser list to run tests on (Options are 'electron', 'chrome', 'edge', 'firefox')
required: false
type: string
default: "electron"

jobs:
matrix:
name: Generate browsers matrix
runs-on: ubuntu-latest
outputs:
browsers: ${{ steps.build-matrix.outputs.BROWSERS }}
steps:
- name: Generate matrix for build
id: build-matrix
run: |
BROWSERS=$(echo "\"${{ inputs.BROWSERS }}\"" | jq -c 'split(",")')
echo "BROWSERS=$BROWSERS" >> $GITHUB_OUTPUT

e2e-tests:
name: End to end tests
runs-on: ubuntu-latest
needs:
- matrix
strategy:
matrix:
browsers: ${{ fromJson(needs.matrix.outputs.browsers) }}
steps:
- name: Checks-out repository
uses: actions/checkout@v3
Expand All @@ -33,6 +75,18 @@ jobs:
with:
node-version: "${{ inputs.NODE_VERSION }}"

- name: Setup firefox
uses: browser-actions/setup-firefox@v1
if: ${{ matrix.browsers == 'firefox' }}

- name: Setup chrome
uses: browser-actions/setup-chrome@v1
if: ${{ matrix.browsers == 'chrome' }}

- name: Setup edge
uses: browser-actions/setup-edge@v1
if: ${{ matrix.browsers == 'edge' }}

- name: Get pnpm store directory
id: pnpm-store
run: |
Expand All @@ -53,8 +107,9 @@ jobs:
with:
path: |
./.turbo/cache
key: turbo-e2e-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('apps/**/src/**','packages/**/src/**') }}
key: turbo-e2e-${{ runner.os }}-${{ runner.arch }}-${{ matrix.browsers }}-${{ hashFiles('apps/**/src/**','apps/client/cypress/**','packages/**/src/**') }}
restore-keys: |
turbo-e2e-${{ runner.os }}-${{ runner.arch }}-${{ matrix.browsers }}-
turbo-e2e-${{ runner.os }}-${{ runner.arch }}-

- name: Install dependencies
Expand All @@ -63,7 +118,7 @@ jobs:
- name: Run e2e tests
run: |
./ci/scripts/init-env.sh
./ci/scripts/run-tests.sh -e -t "${{ inputs.TAG }}"
./ci/scripts/run-tests.sh -e -t "${{ inputs.TAG }}" -b "${{ matrix.browsers }}"

- name: Upload cypress artifacts
if: ${{ failure() }}
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ on:
required: false
SONAR_PROJECT_KEY:
required: false
workflow_dispatch:
inputs:
NODE_VERSION:
description: Nodejs version used to run tests
required: true
type: string
default: "18.18.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
type: string
default: "8"

jobs:
unit-tests:
Expand Down Expand Up @@ -154,6 +166,12 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Set sonarqube args
id: sonar-args
run: |
echo "SONAR_ARGS_PR=-Dsonar.pullrequest.provider=github -Dsonar.pullrequest.key=${{ github.event.number }} -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.github.repository=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "SONAR_ARGS_BRANCH=-Dsonar.branch.name=${{ github.ref_name }}" >> $GITHUB_OUTPUT

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
Expand All @@ -168,12 +186,7 @@ jobs:
-Dsonar.javascript.lcov.reportPaths=coverage/apps/server/coverage/lcov.info,coverage/apps/client/coverage/lcov.info,coverage/packages/shared/coverage/lcov.info
-Dsonar.coverage.exclusions=**/*.spec.js,**/*.spec.ts,**/*.vue,**/assets/**,**/cypress/**,**/packages/test-utils/**,apps/server/src/plugins/**
-Dsonar.scm.provider=git
-Dsonar.pullrequest.provider=github
-Dsonar.pullrequest.key=${{ github.event.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}
-Dsonar.pullrequest.github.repository=${{ github.repository }}
# -Dsonar.branch.name=${{ github.event.pull_request.head.ref }}
${{ github.event_name == 'pull_request' && steps.sonar-args.outputs.SONAR_ARGS_PR || steps.sonar-args.outputs.SONAR_ARGS_BRANCH }}
continue-on-error: true

- name: SonarQube Quality Gate check
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"projectInit"
],
"sonarlint.connectedMode.project": {
"connectionId": "https://test-sonarqube.osc-secnum-fr1.scalingo.io",
"projectKey": "dso-console"
"connectionId": "https://sonarqube.fabrique-numerique.fr",
"projectKey": "cloud-pi-native_console_AYsa46O31ebDtzs-pYyZ"
},
}
2 changes: 1 addition & 1 deletion apps/client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"vue/setup-compiler-macros": true,
"cypress/globals": true,
"browser": true,
"es2022": true
"es2023": true
},
"rules": {
"vue/no-v-html": 0,
Expand Down
2 changes: 1 addition & 1 deletion apps/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dev stage
FROM docker.io/node:18.18.0-bullseye-slim AS dev
FROM docker.io/node:20.9.0-bullseye-slim AS dev

WORKDIR /app
RUN npm install --location=global [email protected]
Expand Down
16 changes: 8 additions & 8 deletions apps/client/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { defineConfig } from 'cypress'
import viteConfig from './vite.config'

const argocdUrl = process.env.ARGOCD_URL || 'https://argo-cd.readthedocs.io'
const gitlabUrl = process.env.GITLAB_URL || 'https://gitlab.com'
const harborUrl = process.env.HARBOR_URL || 'https://goharbor.io'
const nexusUrl = process.env.NEXUS_URL || 'https://sonatype.com/products/nexus-repository'
const sonarqubeUrl = process.env.SONARQUBE_URL || 'https://www.sonarqube.org'
const vaultUrl = process.env.VAULT_URL || 'https://www.vaultproject.io'
const clientHost = process.env.CLIENT_HOST || 'localhost'
const clientPort = process.env.CLIENT_PORT || '8080'
const argocdUrl = process.env.ARGOCD_URL ?? 'https://argo-cd.readthedocs.io'
const gitlabUrl = process.env.GITLAB_URL ?? 'https://gitlab.com'
const harborUrl = process.env.HARBOR_URL ?? 'https://goharbor.io'
const nexusUrl = process.env.NEXUS_URL ?? 'https://sonatype.com/products/nexus-repository'
const sonarqubeUrl = process.env.SONARQUBE_URL ?? 'https://www.sonarqube.org'
const vaultUrl = process.env.VAULT_URL ?? 'https://www.vaultproject.io'
const clientHost = process.env.CLIENT_HOST ?? 'localhost'
const clientPort = process.env.CLIENT_PORT ?? '8080'

// @ts-ignore server does exist!
viteConfig.server.host = '127.0.0.1'
Expand Down
Loading
Loading