Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/jaegertracing/jaeger-ui int…
Browse files Browse the repository at this point in the history
…o block-pr
  • Loading branch information
Vamshi Maskuri committed Mar 16, 2024
2 parents f20ac92 + 44babbb commit 844d0cb
Show file tree
Hide file tree
Showing 615 changed files with 61,203 additions and 17,387 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ coverage:
only_pulls: true
flags: null
paths: null
ignore:
- "packages/jaeger-ui/src/utils/helpers/ReactShallowRenderer.js"
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
build
coverage
packages/plexus/src/LayoutManager/layout.worker*js*

# Ignore generated files
packages/jaeger-ui/index.d.ts
packages/plexus/dist
packages/plexus/lib
64 changes: 58 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

module.exports = {
root: true,
env: {
browser: true,
jest: true,
Expand All @@ -21,30 +22,53 @@ module.exports = {
settings: {
'import/resolver': {
node: {
extensions: ['.js', 'json', '.tsx'],
extensions: ['.js', '.jsx', 'json', '.ts', '.tsx'],
},
},
},
extends: ['react-app', 'airbnb', 'prettier', 'prettier/react'],
extends: ['airbnb', 'prettier', 'eslint:recommended', 'plugin:@typescript-eslint/recommended'],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
project: ['./packages/*/tsconfig.json'],
tsconfigRootDir: '.',
},
plugins: ['@typescript-eslint'],
rules: {
'no-unused-vars': 0,
'@typescript-eslint/interface-name-prefix': ['error', 'always'],
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
prefix: ['I'],
},
],

// Disable ESLint core rules for which @typescript-eslint provides TypeScript-specific equivalents.
'@typescript-eslint/no-this-alias': 0,
'no-use-before-define': 0,
'@typescript-eslint/no-use-before-define': 1,
'no-redeclare': 0,
'@typescript-eslint/no-redeclare': 1,
'no-shadow': 0,
'@typescript-eslint/no-shadow': 1,

// Disable prop type checks for TSX components, as prop type validation is expected
// to be handled by TypeScript there. Stray prop types in components converted from Flow
// should eventually be removed.
'react/require-default-props': 0,
'react/default-props-match-prop-types': 0,
'react/no-unused-prop-types': 0,
},
},
],
rules: {
/* general */
'arrow-body-style': 0,
'arrow-parens': [1, 'as-needed'],
'class-methods-use-this': 0,
'comma-dangle': 0,
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'no-continue': 0,
Expand All @@ -53,6 +77,14 @@ module.exports = {
'no-underscore-dangle': 0,
'prefer-destructuring': 0,

/* tsx */
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',

/* jsx */
'jsx-a11y/anchor-is-valid': 0,
'jsx-a11y/click-events-have-key-events': 0,
Expand All @@ -68,13 +100,16 @@ module.exports = {
'react/jsx-curly-brace-presence': ['error', 'never'],
'react/jsx-filename-extension': 0,
'react/forbid-prop-types': 1,
'react/function-component-definition': 0,
'react/require-default-props': 1,
'react/no-array-index-key': 1,
'react/no-unused-class-component-methods': 0,
'react/sort-comp': [
2,
{
order: [
'type-annotations',
'defaultProps',
'statics',
'state',
'propTypes',
Expand All @@ -89,6 +124,23 @@ module.exports = {
},
],

// eslint-config-airbnb v18+ relaxations
'jsx-a11y/control-has-associated-label': 0,
'react/jsx-props-no-spreading': 0,
'react/state-in-constructor': 0,
'react/static-property-placement': 0,
'react/jsx-fragments': 0,
'react/prop-types': 0,
'max-classes-per-file': 0,
'no-restricted-exports': [
'error',
{
restrictedNamedExports: ['then'],
},
],
'prefer-arrow-callback': 0,
'prefer-object-spread': 0,

/* import */
'import/prefer-default-export': 1,
'import/no-named-default': 0,
Expand Down
18 changes: 0 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

44 changes: 44 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2
updates:
- package-ecosystem: "npm"
open-pull-requests-limit: 50
labels: [ "changelog:dependencies" ]
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
# we have too many dependency PRs today to rebase automatically
rebase-strategy: "disabled"
groups:
babel:
patterns:
- "@babel/*"
- "babel-loader"
eslint:
patterns:
- "@typescript-eslint/*"
- "eslint"
- "eslint*"
jest:
patterns:
- "@jest*"
- "jest*"
- "babel-jest"
- "@testing-library/jest*"
react:
patterns:
- "@types/react"
- "@types/react-dom"
- "react"
- "react-dom"
vite:
patterns:
- "vite"
- "@vitejs/*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
labels: [ "changelog:dependencies" ]
28 changes: 0 additions & 28 deletions .github/issue_template.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci-label-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Verify PR Label

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
- unlabeled

jobs:
check-label:
runs-on: ubuntu-latest
steps:
- name: Check PR label
if: github.event.pull_request.user.login != 'dependabot'
run: |
LABEL_NAME="changelog:"
if [[ $(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" | jq -r '.labels[].name' | grep -c "^$LABEL_NAME") -eq 0 ]]; then
echo "Error: Pull request is missing a required label of the form '${LABEL_NAME}***'."
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "CodeQL"

on:
push:
branches: [main]

pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
codeql-analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
name: CodeQL Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ["javascript"]

steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Initialize CodeQL
uses: github/codeql-action/init@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0
with:
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0
31 changes: 31 additions & 0 deletions .github/workflows/lint-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Lint and Build"

on:
push:
branches: [main]

pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: yarn
node-version: '18'
- run: yarn install --frozen-lockfile
- name: Run depcheck
run: yarn run depcheck
- run: yarn lint
- run: yarn build
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish release

on:
release:
types:
- published

# See https://github.com/jaegertracing/jaeger/issues/4017
# and https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
permissions:
deployments: write
contents: write

jobs:
publish-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: yarn
node-version: '18'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build
id: yarn-build

- name: Package artifacts
id: package-artifacts
run: tar -czvf ./assets.tar.gz --strip-components=3 packages/jaeger-ui/build/
if: steps.yarn-build.outcome == 'success'

- name: Upload artifacts
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df
with:
file: 'assets.tar.gz'
overwrite: true
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
if: steps.package-artifacts.outcome == 'success'
Loading

0 comments on commit 844d0cb

Please sign in to comment.