Skip to content

Commit

Permalink
Merge branch 'develop' into use-npm-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Jun 18, 2024
2 parents 3544567 + a3cb84c commit 4054304
Show file tree
Hide file tree
Showing 1,218 changed files with 68,844 additions and 24,513 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ scripts/extensions/*/node_modules
scripts/extensions/**/dist
end-to-end-testing-helpers/dist
end-to-end-testing-helpers/node_modules
superdesk-common/node_modules
superdesk-common/dist
e2e/client/node_modules
e2e/client/dist
e2e/client/**/*.js
build-tools/**
build-tools/**
scripts/libs/*
39 changes: 35 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = Object.assign({}, sharedConfigs, {
'no-nested-ternary': 0,
'no-unused-vars': 0, // marks typescript interfaces as unused vars
'no-undef': 0, // marks interface properties as usages of undeclared variables

// field names from back-end use snake_case for naming.
// I'm not convinced it's worth using a bracket notation only to satisfy a lint rule
'camelcase': 0,
Expand All @@ -21,24 +21,49 @@ module.exports = Object.assign({}, sharedConfigs, {
// but keep internal properties unquoted unless required
'quote-props': 0,

'newline-per-chained-call': ["error", {"ignoreChainWithDepth": 3}],
'no-sequences': 2,

'newline-per-chained-call': ['error', {'ignoreChainWithDepth': 3}],

'@typescript-eslint/array-type': [
'error',
{
'default': 'generic'
}
],

// requires at least ESLint v7.1.0
'@typescript-eslint/no-loss-of-precision': 'off',

// needs work to convert
'@typescript-eslint/no-var-requires': 'off',

// TODO: re-enable the following rules
// '@typescript-eslint/no-non-null-assertion': 'error',
'prefer-const': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-this-alias': 'off',
}),
plugins: [...(sharedConfigs.plugins ?? []), '@typescript-eslint'],

extends: [...(sharedConfigs.extends ?? []), 'plugin:@typescript-eslint/recommended'],

parser: '@typescript-eslint/parser',

overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'react/prop-types': 0, // interfaces are used in TypeScript files
'no-unused-vars': 0,
'no-undef': 0,
'comma-dangle': 0,
'camelcase': 0,
'object-shorthand': 0,
'arrow-body-style': 0,
'newline-per-chained-call': 0,
'quote-props': 0,
'arrow-body-style': 0,
'max-len': 0, // handled by tslint

"comma-dangle": ["error", {
"arrays": "always-multiline",
Expand All @@ -48,6 +73,12 @@ module.exports = Object.assign({}, sharedConfigs, {
"functions": "always-multiline"
}],

"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],


// allow calling hasOwnProperty
"no-prototype-builtins": 0,
Expand Down
3 changes: 3 additions & 0 deletions .fireq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"superdesk_branch": "develop"
}
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "npm" # See documentation for possible values
directory: "/e2e/client" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/e2e/server" # Location of package manifests
schedule:
interval: "weekly"
60 changes: 0 additions & 60 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

48 changes: 39 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '14.x'

Expand All @@ -21,6 +21,8 @@ jobs:

- run: npm ci
- run: npm run test
env:
TZ: "Europe/Prague"

e2e:
runs-on: ubuntu-latest
Expand All @@ -31,34 +33,62 @@ jobs:
suite: [a, b]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '14.x'


- name: Start e2e server
run: |
docker-compose pull
docker-compose build
docker-compose up -d
docker compose pull
docker compose build
docker compose up -d
working-directory: e2e/server

- name: Build client
run: npm install && npm run build && npm run specs--compile && npm run start-client-server
working-directory: e2e/client

# playwright start

- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: e2e/client

- name: Run Playwright tests
run: npx playwright test
working-directory: e2e/client

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: e2e/client/playwright-report/
retention-days: 30

# playwright end

# protractor start

- name: Protractor
run: ./node_modules/.bin/protractor protractor.conf.js --suite=${{ matrix.suite }}
run: npx protractor-flake --parser standard --max-attempts=3 -- protractor.conf.js --suite=${{ matrix.suite }}
env:
TRAVIS: ci
SCREENSHOTS_DIR: /tmp
working-directory: e2e/client

- name: Upload screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: screenshots-e2e-${{ matrix.suite }}
path: /tmp/*.png

# protractor end

- name: Server Logs
if: ${{ failure() }}
run: docker compose logs superdesk
working-directory: e2e/server
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ e2e-test-results
templates-cache.generated.js
styles/extension-styles.generated.css
e2e/client/specs/**/*.js

# playwright
e2e/client/test-results/
e2e/client/playwright-report/
e2e/client/playwright/.cache/

.env
npm-debug.log
index.html
yarn-error.log

.history/
.github

# VIM related files
*.swo
Expand Down
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdesk/build-tools",
"version": "1.0.16",
"version": "1.0.19",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion build-tools/src/extensions/extract-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function extractTranslations(clientDir) {
const paths = _.get(package, 'superdeskExtension.translations-extract-paths');

if (paths == null || !Array.isArray(paths)) {
return null;
continue;
}

const pathsAbsolute = paths.map((p) => path.join(extensionRootPath, p));
Expand Down
36 changes: 36 additions & 0 deletions docs/item-states.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
digraph {
node [
shape=circle,
fixedsize=true,
width=1.6,
]

workflow [label="\nIN_PROGRESS \n / SUBMITTED \n / FETCHED \n / ROUTED"]
published [label="PUBLISHED \n / CORRECTED"]

"INGESTED" -> workflow [label="fetch"]
"INGESTED" -> workflow [label="route"]

workflow -> workflow [label=" send to -> SUBMITTED\n edit -> IN_PROGRESS"]

"DRAFT" -> workflow

workflow -> "SPIKED"
"SPIKED" -> workflow

workflow -> published

workflow -> "SCHEDULED"
"SCHEDULED" -> workflow


"SCHEDULED" -> published

published -> "UNPUBLISHED"
"UNPUBLISHED" -> workflow

published -> "KILLED"
published -> "RECALLED"

published -> published [label=" correct -> CORRECTED"]
}
12 changes: 12 additions & 0 deletions e2e/README-PROTRACTOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# How to run tests on chrome > 114

webdriver-manager only supports chrome <114 - https://github.com/angular/protractor/issues/5563

To use newer chrome versions, set `CHROME_BIN` and `CHROMEWEBDRIVER`(should point to folder where `chromedriver` file is located) environment variables. Use [Chrome for testing](https://developer.chrome.com/blog/chrome-for-testing) project to download desired chrome version and driver.

# MacOS Setup
`.app` is not an executable so path to chrome test browser should be pointing to the executable inside that folder

Example setup with chrome test browser executable path:

export CHROME_BIN="/Downloads/chrome-mac-arm64/Google_Chrome_for_Testing.app/Contents/MacOS/Google_Chrome_for_Testing"
Loading

0 comments on commit 4054304

Please sign in to comment.