Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 29 additions & 0 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://dprint.dev/schemas/v0.json",
"incremental": true,
"newLineKind": "lf",
"indentWidth": 2,
"useTabs": false,
"lineWidth": 120,
"typescript": {
"semiColons": "asi",
"quoteStyle": "alwaysSingle",
"trailingCommas": "onlyMultiLine",
"jsx.quoteStyle": "preferDouble"
},
"json": {
"trailingCommas": "never"
},
"includes": [
"**/*.{ts,tsx,js,jsx,mjs,json,jsonc,md,yaml,yml,html,css,scss,less,graphql}"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.95.5.wasm",
"https://plugins.dprint.dev/json-0.20.0.wasm",
"https://plugins.dprint.dev/markdown-0.18.0.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
"https://plugins.dprint.dev/g-plane/pretty_graphql-v0.2.1.wasm",
"https://plugins.dprint.dev/g-plane/malva-v0.12.1.wasm",
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.20.0.wasm"
]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
78 changes: 24 additions & 54 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,45 @@
"root": true,
"extends": [
"eslint:recommended",
"plugin:json/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended",
"plugin:boundaries/recommended"
],
"plugins": [
"yml",
"jsonc"
],
"env": {
"es6": true,
"browser": true
},
"rules": {
"filenames/no-index": 2,
"camelcase": "error",
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
],
"eol-last": [
"error",
"warn",
"always"
],
"no-unexpected-multiline": "error",
"filenames/no-index": 2,
"camelcase": "error",
"eqeqeq": [
"error",
"always"
],
"no-confusing-arrow": "error",
"no-useless-rename": "error",
"no-unexpected-multiline": "error",
"no-case-declarations": "off",
"object-shorthand": [
"error",
"consistent"
],
"operator-linebreak": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-numeric-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"prefer-destructuring": "error",
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/member-delimiter-style": [
"error",
Expand All @@ -66,10 +50,6 @@
}
}
],
"@typescript-eslint/semi": [
"error",
"never"
],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
Expand Down Expand Up @@ -105,7 +85,6 @@
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"filenames"
],
"globals": {
Expand All @@ -115,37 +94,18 @@
"browser": true
},
"rules": {
"indent": "off",
"@typescript-eslint/indent": [
"error",
2,
{
"FunctionExpression": {
"parameters": "first"
},
"SwitchCase": 1,
"ignoredNodes": [
"Decorator"
]
}
],
"@typescript-eslint/array-type": "error"
}
},
{
"files": [
"*.json"
],
"plugins": [
"json"
"*.json",
"*.jsonc"
],
"rules": {
"indent": [
"error",
2
],
"@typescript-eslint/indent": "off"
}
"parser": "jsonc-eslint-parser",
"extends": [
"plugin:jsonc/recommended-with-json"
]
},
{
"files": [
Expand All @@ -159,6 +119,16 @@
"error"
]
}
},
{
"files": [
"*.yaml",
"*.yml"
],
"parser": "yaml-eslint-parser",
"extends": [
"plugin:yml/recommended"
]
}
],
"ignorePatterns": [
Expand Down
69 changes: 69 additions & 0 deletions .github/super-linter.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Super Linter Configuration for qubership-apihub-ui
# Documentation: https://github.com/super-linter/super-linter

#######################
# General settings
#######################
DEFAULT_BRANCH=develop
IGNORE_GENERATED_FILES=true
IGNORE_GITIGNORED_FILES=true

#######################
# Output & Reporting
#######################
# Save linting results to files
SAVE_SUPER_LINTER_OUTPUT=true
SAVE_SUPER_LINTER_SUMMARY=true
SUPER_LINTER_OUTPUT_DIRECTORY_NAME=super-linter-reports
SUPPRESS_POSSUM=true

#######################
# Linters Configuration
#######################
# Explicitly enable only specific linters

# Security scanner for Infrastructure as Code (IaC) - detects misconfigurations
#VALIDATE_CHECKOV=true

# Scans code for hardcoded secrets, keys, and credentials
VALIDATE_GITLEAKS=true

# Validates GitHub Actions workflow files with actionlint
VALIDATE_GITHUB_ACTIONS=true

# Copy-paste detector for identifying duplicated code
# VALIDATE_JSCPD=true

# Validates JSON files using eslint-plugin-jsonc for syntax and structure
#VALIDATE_JSON=true

# Validates YAML files with yamllint for syntax and structure
#VALIDATE_YAML=true

# Validates TypeScript files using ESLint for code quality and style
#VALIDATE_TYPESCRIPT_ES=true

# Validates Bash scripts for syntax errors and best practices
VALIDATE_BASH=true

# Checks for unsafe Bash script execution patterns
VALIDATE_BASH_EXEC=true

# Validates Dockerfiles using Hadolint for best practices and errors
VALIDATE_DOCKERFILE_HADOLINT=true

# Checks for .editorconfig file compliance
VALIDATE_EDITORCONFIG=true

# Validates .env files for syntax and formatting issues
VALIDATE_ENV=true

# Checks commit messages for conventional formatting and best practices
# VALIDATE_GIT_COMMITLINT=true

# Detects unresolved Git merge conflict markers in code
VALIDATE_GIT_MERGE_CONFLICT_MARKERS=true

# Additional linter settings
# These settings are used to configure the enabled linters
GITLEAKS_LOG_LEVEL=warn
16 changes: 8 additions & 8 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build & unit test, build Docker image, run E2E tests
name: build & unit test, build Docker image, run E2E tests

on:
push:
Expand All @@ -7,15 +7,15 @@ on:
- hotfix
- develop
- feature/*
- bugfix/*
- bugfix/*
tags:
- '**'
- "**"
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- 'docs/**'
- "docs/**"

jobs:
jobs:
build-and-unit-test:
uses: netcracker/qubership-apihub-ci/.github/workflows/frontend-ci.yaml@main
build-docker-image:
Expand Down Expand Up @@ -51,15 +51,15 @@ jobs:
if: github.event_name == 'pull_request'
with:
postman-collections-run: false
apihub-ui-image-tag: ${{ needs.build-docker-image.outputs.image_tag }}
apihub-ui-image-tag: ${{ needs.build-docker-image.outputs.image_tag }}
apihub-build-task-consumer-image-tag: ${{ needs.calculate-build-task-consumer-tag.outputs.tag }}
apihub-backend-image-tag: ${{ needs.calculate-backend-tag.outputs.tag }}
# pass PR source branch, will default to develop if corresponding branch for Playwright tests is not found
# pass PR source branch, will default to develop if corresponding branch for Playwright tests is not found
playwright-repository-branch: ${{ github.head_ref }}
# pass PR source branch, will default to develop if corresponding branch for Postman tests is not found
postman-repository-branch: ${{ github.head_ref }}
secrets:
APIHUB_ACCESS_TOKEN: ${{ secrets.APIHUB_ACCESS_TOKEN }}
APIHUB_ADMIN_EMAIL: ${{ secrets.APIHUB_ADMIN_EMAIL }}
APIHUB_ADMIN_PASSWORD: ${{ secrets.APIHUB_ADMIN_PASSWORD }}
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/delete-dist-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ on:

jobs:
delete-dist-tag:
uses: netcracker/qubership-apihub-ci/.github/workflows/delete-dist-tag.yaml@main
uses: netcracker/qubership-apihub-ci/.github/workflows/delete-dist-tag.yaml@main
46 changes: 46 additions & 0 deletions .github/workflows/eslint-dprint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ESLint and Dprint checks

on:
push:
branches:
- release
- hotfix
- develop
- feature/*
- bugfix/*
tags:
- "**"
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- "docs/**"

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://npm.pkg.github.com/"

- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run ESLint check
run: npm run lint

dprint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Dprint check
uses: dprint/[email protected]
6 changes: 3 additions & 3 deletions .github/workflows/storybook-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Storybook CD Workflow

on:
push:
push:
branches:
delete:
branches:

jobs:
jobs:
call-storybook-cd-workflow:
uses: netcracker/qubership-apihub-ci/.github/workflows/storybook-cd.yaml@main
uses: netcracker/qubership-apihub-ci/.github/workflows/storybook-cd.yaml@main
Loading
Loading