Skip to content

Commit

Permalink
cascading: main into release/12.0.0-next (#2732)
Browse files Browse the repository at this point in the history
## Proposed change

<!--
Please include a summary of the changes and the related issue.
Please also include relevant motivation and context.
-->

## Related issues

<!--
Please make sure to follow the [contribution
guidelines](https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md)
-->

*- No issue associated -*

<!-- * 🐛 Fix #issue -->
<!-- * 🐛 Fix resolves #issue -->
<!-- * 🚀 Feature #issue -->
<!-- * 🚀 Feature resolves #issue -->
<!-- * :octocat: Pull Request #issue -->
  • Loading branch information
fpaul-1A authored Jan 24, 2025
2 parents 3cf2ff3 + 97c27c5 commit 0dca177
Show file tree
Hide file tree
Showing 140 changed files with 3,731 additions and 3,202 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
with:
maven-version: ${{ inputs.mvn-version }}
- name: Set up JDK 17
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
if: inputs.install-jdk == 'true'
with:
java-version: '17'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
with:
install-jdk: 'true'
- name: Cache Jest
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
hash: ${{ hashFiles('package.json', 'tsconfig.base.json', 'tsconfig.build.json', 'nx.json') }}
with:
Expand All @@ -83,12 +83,12 @@ jobs:
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
uses: codecov/test-results-action@9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820 # 1.0.1
uses: codecov/test-results-action@4e79e65778be1cecd5df25e14af1eafb6df80ea9 # 1.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish tests reports
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ut-reports-${{ matrix.os }}
path: |
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Setup
uses: ./tools/github-actions/setup
- name: Cache Eslint
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
hash: ${{ hashFiles('yarn.lock') }}
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml

- name: Autobuild
uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: yarn update-package ${{ inputs.docFolder }}/package.json --name ${{ inputs.packageName }} --version ${{ inputs.version }}
- run: zip -q -r ${{ inputs.artifactName }}.zip "${{ inputs.docFolder }}" -x "*/node_modules/*" ".cache/*"
shell: bash
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ inputs.artifactName }}
path: ${{ inputs.artifactName }}.zip
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions:

jobs:
e2e-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
Expand All @@ -43,7 +43,9 @@ jobs:

- name: Publish tests reports
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: e2e-report
path: apps/showcase/playwright-reports
path: |
apps/chrome-devtools/playwright-reports
apps/showcase/playwright-reports
8 changes: 4 additions & 4 deletions .github/workflows/it-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: zip -r verdaccio.zip ./.verdaccio
shell: bash
- name: Publish verdaccio storage
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ inputs.ref && format('verdaccio-{0}', inputs.ref) || 'verdaccio' }}
path: verdaccio.zip
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
shell: bash
- name: Cache test-app yarn
if: inputs.ref == ''
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
.cache/test-app
Expand Down Expand Up @@ -138,13 +138,13 @@ jobs:
shell: bash
- name: Publish generated tests environment on failure
if: failure() && steps.it-tests.conclusion == 'failure'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: it-tests-${{ matrix.os }}-${{ matrix.packageManager }}-${{ inputs.ref }}
path: it-tests.zip
- name: Publish tests reports
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: it-reports-${{ matrix.os }}-${{ matrix.packageManager }}-${{ inputs.ref }}
path: 'packages/**/dist-test/it-report.xml'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
- name: Expose Chrome extension artifact
if: (success() || failure()) && !inputs.prerelease
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: chrome-extension
path: apps/chrome-devtools/chrome-extension.zip
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: results.sarif
3 changes: 2 additions & 1 deletion .renovaterc.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"extends": [
"github>AmadeusITGroup/otter//tools/renovate/base",
"github>AmadeusITGroup/otter//tools/renovate/group/design-factory",
"github>AmadeusITGroup/otter//tools/renovate/managers/github-node-version.json5",
":labels(dependencies)"
],
"timezone": "Europe/Paris",
Expand Down Expand Up @@ -131,7 +132,7 @@
],
"github-actions": {
"fileMatch": [
"/__dot__github/.*/.+\\.ya?ml$"
"/(?:__dot__|__empty__\\.)github/.*/.+\\.ya?ml$"
]
}
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"files.associations": {
"*.json5": "jsonc"
},
"files.exclude": {
"**/.git": true
},
"files.readonlyExclude": {
"**/packages/@o3r-training/*sdk/src/api/*/index.ts": true,
"**/packages/@o3r-training/*sdk/src/models/base/*/index.ts": true
Expand Down Expand Up @@ -99,6 +102,7 @@
"**/.pnp.*": true
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.tsserver.watchOptions": "vscode",
"typescript.tsdk": ".yarn/sdks/typescript/lib"
"typescript.preferences.preferTypeOnlyAutoImports": true
}
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ packageExtensions:
"@swc/types": "*"
"@typescript-eslint/rule-tester@*":
dependencies:
"@typescript-eslint/parser": ~8.19.0
"@typescript-eslint/parser": ~8.21.0
"@angular-eslint/eslint-plugin-template@*":
dependencies:
"@typescript-eslint/types": ^8.15.0
Expand Down
6 changes: 6 additions & 0 deletions apps/chrome-devtools/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Build
/dist
/dist-test
/chrome-extension.zip

# Playwright
dist-e2e-playwright
playwright-reports
test-results
15 changes: 15 additions & 0 deletions apps/chrome-devtools/e2e-playwright/playwright-config.sanity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as path from 'node:path';
import {
defineConfig,
} from '@playwright/test';
import {
default as defaultConfig,
} from './playwright-config';

const config = defineConfig({
...defaultConfig,
testDir: path.join(__dirname, 'sanity'),
testMatch: /.*\.e2e\.ts$/
});

export default config;
48 changes: 48 additions & 0 deletions apps/chrome-devtools/e2e-playwright/playwright-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import * as path from 'node:path';
import {
adjustPath,
} from '@o3r/testing/tools/path-replacement';
import {
defineConfig,
} from '@playwright/test';

adjustPath('playwright');

const reportsFolder = path.join(__dirname, '..', 'playwright-reports');

const config = defineConfig({
testDir: path.join(__dirname, '..', 'e2e-playwright'),
testMatch: /.*\.e2e-playwright-spec.ts$/,
snapshotPathTemplate: '{testDir}/screenshots/{testFilePath}/{arg}{ext}',
reporter: [
['list'],
['junit', { outputFile: path.join(reportsFolder, 'junit', 'reporter.xml') }],
['html', { open: 'never', outputFolder: path.join(reportsFolder, 'html') }]
],
retries: process.env.CI ? 3 : 0,
forbidOnly: !!process.env.CI,
navigationTimeout: 10_000,
timeout: 60_000,
use: {
ignoreHTTPSErrors: true,
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
launchOptions: {}
},
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0
}
},
projects: [
{
name: 'Chromium',
use: {
browserName: 'chromium',
channel: 'chromium'
}
}
]
});

export default config;
15 changes: 15 additions & 0 deletions apps/chrome-devtools/e2e-playwright/sanity/install-sanity.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
expect,
} from '@playwright/test';
import {
test,
} from '../test-with-extension';

const EXTENSION_ID = 'aejabgendbpckkdnjaphhlifbhepmbne';

test.describe('Install extension to chrome', () => {
test('Background service worker', ({ extensionServiceWorker, extensionId }) => {
expect(extensionServiceWorker).toBeDefined();
expect(extensionId).toBe(EXTENSION_ID);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {
expect,
} from '@playwright/test';
import {
test,
} from '../test-with-extension';

test.describe('Dummy scenario', () => {
test('Dummy test', () => {
expect(true).toBe(true);
});
});
42 changes: 42 additions & 0 deletions apps/chrome-devtools/e2e-playwright/test-with-extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import path from 'node:path';
import {
test as base,
type BrowserContext,
chromium,
type Worker,
} from '@playwright/test';

const pathToExtension = path.resolve(__dirname, '..', 'dist');

/**
* Extends playwright test to add extension access
*/
export const test = base.extend<{
context: BrowserContext;
extensionServiceWorker: Worker;
extensionId: string;
}>({
// eslint-disable-next-line no-empty-pattern -- Required for dependency injection
context: async ({}, use) => {
const context = await chromium.launchPersistentContext('', {
channel: 'chromium',
args: [
`--disable-extensions-except=${pathToExtension}`,
`--load-extension=${pathToExtension}`
]
});
await use(context);
await context.close();
},
extensionServiceWorker: async ({ context }, use) => {
let [background] = context.serviceWorkers();
if (!background) {
background = await context.waitForEvent('serviceworker');
}
await use(background);
},
extensionId: async ({ extensionServiceWorker }, use) => {
const extensionId = extensionServiceWorker.url().split('/')[2];
await use(extensionId);
}
});
16 changes: 16 additions & 0 deletions apps/chrome-devtools/eslint.local.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export default [
{
name: '@o3r/chrome-devtools/ignores',
ignores: [
'playwright-reports/**/*',
'test-results/**/*'
]
},
{
name: '@o3r/chrome-devtools/projects',
languageOptions: {
Expand Down Expand Up @@ -41,5 +48,14 @@ export default [
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off'
}
},
{
name: '@o3r/chrome-devtools/playwright',
files: ['**/e2e-playwright/**'],
languageOptions: {
globals: {
...globals.node
}
}
}
];
Loading

0 comments on commit 0dca177

Please sign in to comment.