Skip to content

Commit

Permalink
Merge pull request #889 from cloud-pi-native/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
clairenollet authored Jan 25, 2024
2 parents 15adbb5 + 7540d27 commit a5ffb44
Show file tree
Hide file tree
Showing 214 changed files with 6,777 additions and 6,373 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:
env:
REGISTRY: "ghcr.io"
NAMESPACE: "${{ github.repository }}"
MULTI_ARCH: true
# TODO : remettre à true quand runner restaurés
MULTI_ARCH: false
USE_QEMU: false
NODE_VERSION: "20.10.0"
NODE_VERSION: "20.11.0"
PNPM_VERSION: "8"

jobs:
Expand Down
2 changes: 1 addition & 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: "20.10.0"
NODE_VERSION: "20.11.0"
PNPM_VERSION: "8"
REGISTRY: "ghcr.io"
NAMESPACE: "${{ github.repository }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: Nodejs version used to run tests
required: true
type: string
default: "20.10.0"
default: "20.11.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
NODE_VERSION:
required: true
type: string
default: "20.10.0"
default: "20.11.0"
MAJOR_TAG:
type: string
description: "Major version tag"
Expand All @@ -29,7 +29,7 @@ on:
NODE_VERSION:
required: true
type: string
default: "20.10.0"
default: "20.11.0"
MAJOR_TAG:
type: string
description: "Major version tag"
Expand All @@ -52,26 +52,28 @@ jobs:
steps:
- name: Checks-out repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ inputs.NODE_VERSION }}"
registry-url: https://registry.npmjs.org/

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: "${{ inputs.PNPM_VERSION }}"
run_install: true

- name: Prepare packages
run: |
pnpm run db:generate
echo '//registry.npmjs.org/:_authToken=${npm_token}' >> .npmrc
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc
- name: Publish on npmjs.org
run: |
pnpm publish --no-git-checks --access public \
--filter server \
--filter client \
--filter shared
env:
npm_token: ${{secrets.NPM_TOKEN}}
--filter server \
--filter client \
--filter shared
2 changes: 1 addition & 1 deletion .github/workflows/tests-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
description: Nodejs version used to run tests
required: true
type: string
default: "20.10.0"
default: "20.11.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
description: Nodejs version used to run tests
required: true
type: string
default: "20.10.0"
default: "20.11.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
description: Nodejs version used to run tests
required: true
type: string
default: "20.10.0"
default: "20.11.0"
PNPM_VERSION:
description: Pnpm version used to run tests
required: true
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
-Dsonar.scm.provider=git
${{ 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
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ keycloak/data
# dist
dist
build
auto-imports.d.ts
components.d.ts

#types
apps/server/types/
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Format
"editor.wordWrap": "on",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll": "explicit"
},
"eslint.packageManager": "pnpm",
"eslint.enable": true,
Expand Down Expand Up @@ -34,6 +34,7 @@
"scss.validate": false,
// JS
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifierEnding": "js",
"javascript.preferences.quoteStyle": "single",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
Expand Down
88 changes: 88 additions & 0 deletions apps/client/.eslintrc-auto-import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"WritableComputedRef": true,
"acceptHMRUpdate": true,
"computed": true,
"createApp": true,
"createPinia": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"defineStore": true,
"effectScope": true,
"getActivePinia": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"mapActions": true,
"mapGetters": true,
"mapState": true,
"mapStores": true,
"mapWritableState": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeRouteLeave": true,
"onBeforeRouteUpdate": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"setActivePinia": true,
"setMapStoreSuffix": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"storeToRefs": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCssModule": true,
"useCssVars": true,
"useLink": true,
"useRoute": true,
"useRouter": true,
"useScheme": true,
"useSlots": true,
"useTabs": true,
"watch": true,
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"OhVueIcon": true,
"addIcons": true
}
}
3 changes: 2 additions & 1 deletion apps/client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"extends": [
"@dso-console/eslint-config-base",
"plugin:vue/vue3-recommended",
"@vue/eslint-config-typescript"
"@vue/eslint-config-typescript",
"./.eslintrc-auto-import.json"
],
"plugins": [
"vue",
Expand Down
1 change: 0 additions & 1 deletion apps/client/.stylelintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
],
},
],
'declaration-block-trailing-semicolon': null,
'no-descending-specificity': null,
'selector-class-pattern': '^((sm|md|lg|xl|2xl):)?[a-z][-_/a-z0-9]*$'
},
Expand Down
7 changes: 4 additions & 3 deletions apps/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Dev stage
FROM docker.io/node:20.10.0-bullseye-slim AS dev
FROM docker.io/node:20.11.0-bullseye-slim AS dev

WORKDIR /app
RUN npm install --location=global pnpm@8.6.10
RUN npm install --ignore-scripts --location=global pnpm@8.14.1
COPY --chown=node:root package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc ./
COPY --chown=node:root patches ./patches
COPY --chown=node:root apps/client/package.json ./apps/client/package.json
COPY --chown=node:root packages/eslintconfig/package.json ./packages/eslintconfig/package.json
COPY --chown=node:root packages/shared/package.json ./packages/shared/package.json
COPY --chown=node:root packages/test-utils/package.json ./packages/test-utils/package.json
COPY --chown=node:root packages/tsconfig/package.json ./packages/tsconfig/package.json
RUN pnpm install --no-optional
RUN pnpm install --ignore-scripts # --no-optional
COPY --chown=node:root packages/ ./packages/
RUN pnpm --filter shared run build
COPY --chown=node:root apps/client/ ./apps/client/
Expand Down
2 changes: 1 addition & 1 deletion apps/client/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineConfig({
},

component: {
specPattern: 'cypress/components/specs/**/*.{cy,ct}.{j,t}s',
specPattern: '{cypress/components/specs,src/components}/**/*.{cy,ct}.{j,t}s',
supportFile: 'cypress/components/support/index.ts',
indexHtmlFile: 'cypress/components/support/component-index.html',
video: false,
Expand Down
17 changes: 11 additions & 6 deletions apps/client/cypress/components/specs/cluster-form.ct.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { Pinia, createPinia, setActivePinia } from 'pinia'
import { type Pinia, createPinia, setActivePinia } from 'pinia'
import { getRandomCluster, getRandomEnv, getRandomProject, getRandomStage, repeatFn } from '@dso-console/test-utils'

import '@gouvfr/dsfr/dist/dsfr.min.css'
import '@gouvfr/dsfr/dist/utility/icons/icons.min.css'
import '@gouvfr/dsfr/dist/utility/utility.main.min.css'
import '@gouvminint/vue-dsfr/styles'
import '@/main.css'

import ClusterForm from '@/components/ClusterForm.vue'
import { getRandomCluster, getRandomEnv, getRandomProject, getRandomStage, repeatFn } from '@dso-console/test-utils'
import { useSnackbarStore } from '@/stores/snackbar.js'
import { useAdminClusterStore } from '@/stores/admin/cluster.js'

const repeatFn5Times = repeatFn(5)
const get5RandomProjects = () => repeatFn5Times(getRandomProject)

describe('ClusterForm.vue', () => {
let pinia: Pinia

Expand All @@ -21,7 +26,7 @@ describe('ClusterForm.vue', () => {
it('Should mount a new cluster ClusterForm', () => {
useSnackbarStore()

const allProjects = repeatFn(5)(getRandomProject)
const allProjects = get5RandomProjects()
const allStages = repeatFn(4)(getRandomStage)

const props = {
Expand Down Expand Up @@ -53,7 +58,7 @@ describe('ClusterForm.vue', () => {
useSnackbarStore()
const adminClusterStore = useAdminClusterStore()

const allProjects = repeatFn(5)(getRandomProject)
const allProjects = get5RandomProjects()
const allStages = repeatFn(2)(getRandomStage)
adminClusterStore.clusters = [getRandomCluster([allProjects[0].id], [allStages[1].id])]

Expand Down Expand Up @@ -103,7 +108,7 @@ describe('ClusterForm.vue', () => {
useSnackbarStore()
const adminClusterStore = useAdminClusterStore()

const allProjects = repeatFn(5)(getRandomProject)
const allProjects = get5RandomProjects()
const allStages = repeatFn(2)(getRandomStage)
// @ts-ignore
adminClusterStore.clusters = [getRandomCluster([allProjects[0].id], [allStages[1].id])]
Expand Down Expand Up @@ -152,7 +157,7 @@ describe('ClusterForm.vue', () => {
it('Should disable project selector when privacy is public', () => {
useSnackbarStore()

const allProjects = repeatFn(5)(getRandomProject)
const allProjects = get5RandomProjects()

const props = {
allProjects,
Expand Down
8 changes: 5 additions & 3 deletions apps/client/cypress/components/specs/environment-form.ct.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Pinia, createPinia, setActivePinia } from 'pinia'
import { type Pinia, createPinia, setActivePinia } from 'pinia'
import { createRandomDbSetup } from '@dso-console/test-utils'

import '@gouvfr/dsfr/dist/dsfr.min.css'
import '@gouvfr/dsfr/dist/utility/icons/icons.min.css'
import '@gouvfr/dsfr/dist/utility/utility.main.min.css'
import '@gouvminint/vue-dsfr/styles'
import '@/main.css'

import EnvironmentForm from '@/components/EnvironmentForm.vue'
import { createRandomDbSetup } from '@dso-console/test-utils'
import { useSnackbarStore } from '@/stores/snackbar.js'
import { useProjectEnvironmentStore } from '@/stores/project-environment.js'

Expand Down Expand Up @@ -62,7 +64,7 @@ describe('EnvironmentForm.vue', () => {
cy.getByDataTestid('cancelEnvironmentBtn').should('be.enabled')

cy.getByDataTestid('environmentNameInput')
.clear().type('prod-0')
.clear().type('prod0')
cy.get('select#stage-select > option')
.should('have.length', randomDbSetup.stages.length + 1)
cy.get('select#stage-select')
Expand Down
Loading

0 comments on commit a5ffb44

Please sign in to comment.