Skip to content

Commit

Permalink
Merge branch 'wso2:master' into enable_federated_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
indeewari authored Sep 3, 2024
2 parents f9b3fa6 + d464e7b commit bbcb848
Show file tree
Hide file tree
Showing 2,627 changed files with 236,128 additions and 122,307 deletions.
7 changes: 0 additions & 7 deletions .changeset/many-worms-cross.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/moody-humans-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.connections.v1": patch
---

Fix UI issue in outbound provisioning roles dropdown
54 changes: 39 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const getLicenseHeaderPattern = () => {
const LICENSE_HEADER_DEFAULT_PATTERN = [
"*",
{
pattern: " Copyright \\(c\\) \\b(2019|202[0-4])(?:-(202[0-4]))?, WSO2 LLC. \\(https://www.wso2.com\\)\.$",
pattern: " Copyright \\(c\\) \\b(2019|202[0-4])(?:-(202[0-4]))?, WSO2 LLC. \\(https://www.wso2.com\\).$",
template: " * Copyright (c) {{year}}, WSO2 LLC. (https://www.wso2.com)."
},
" *",
Expand Down Expand Up @@ -138,13 +138,13 @@ module.exports = {
rules: {
"@typescript-eslint/ban-types": 1,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-empty-function": [
"error",
{
allow: [ "constructors" ]
}
],
// Temporary disable the no-empty-function rule.
// Refer: https://github.com/wso2/product-is/issues/20659
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": 0,
// Temporary disable the `no-extra-semi` rule.
// Refer: https://github.com/wso2/product-is/issues/20659
"@typescript-eslint/no-extra-semi": 0,
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down Expand Up @@ -181,9 +181,13 @@ module.exports = {
// In development, error level is set to `warn`. This will be overridden
// by the production env linting config.
"no-debugger": 1,
// Temporary disable the `no-extra-semi` rule.
// Refer: https://github.com/wso2/product-is/issues/20659
"no-extra-semi": 0,
// `no-undef` is discouraged in Typescript projects.
// https://github.com/typescript-eslint/typescript-eslint/issues/2477#issuecomment-686892459
"no-undef": 0,
"no-unsafe-optional-chaining": "off",
"no-use-before-define": "off",
"padding-line-between-statements": "off"
},
Expand All @@ -197,7 +201,15 @@ module.exports = {
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {
"header/header": "off"
"header/header": "off",
"max-len": "off",
"semi": "off"
}
},
{
"files": [ "*.js" ],
"rules": {
"tsdoc/syntax": "off"
}
}
],
Expand Down Expand Up @@ -254,6 +266,9 @@ module.exports = {
"no-alert": 1,
"no-console": "warn",
"no-duplicate-imports": "warn",
// Temporary disable the `no-extra-semi` rule.
// Refer: https://github.com/wso2/product-is/issues/20659
"no-extra-semi": 0,
"no-restricted-imports": [
"error",
{
Expand Down Expand Up @@ -283,25 +298,34 @@ module.exports = {
{
message: "Please use import foo from '@oxygen-ui/react/foo' instead.",
name: "@oxygen-ui/react"
},
{
importNames: [ "hasRequiredScopes" ],
message: "Please use \"import { useRequiredScopes } from '@wso2is/access-control'\" instead. " +
"Refer documentation: https://github.com/wso2/identity-apps/blob/master/docs/write-code/" +
"PERFORMANCE.md#use-userequiredscopes-hook-instead-of-hasrequiredscopes-function",
name: "@wso2is/core/helpers"
}
],
patterns: [
patterns: [
"@wso2is/**/dist/**",
"lodash/**",
"lodash/**",
"lodash/fp/**",
// prevents using absolute import paths such as "apps/console/src/**/*", "modules/react"
// TODO: show an error message in the editor when an absolute import is used[1]. Currently
// it's not working for some reason[2].
//
// [1] https://eslint.org/docs/latest/rules/no-restricted-imports#options:~:text=%22no%2Drestricted%2Dimports%22%3A%20%5B%22error%22%2C%20%7B%0A%20%20%20%20%22patterns,deprecated%2C%20except%20the%20modules%20in%20import2/good.%22%0A%20%20%20%20%7D%5D%0A%7D%5D
// [2] https://stackoverflow.com/questions/68126222/lint-rule-no-restricted-imports-throw-error-when-patterns-group-specified
//
// [1] https://eslint.org/docs/latest/rules/no-restricted-imports#group
// [2] https://stackoverflow.com/q/68126222/8810941
"apps/**/*",
"modules/**/*"
"modules/**/*",
"features/**/*"
]
}
],
"no-trailing-spaces": "warn",
"no-unreachable": "error",
"no-unsafe-optional-chaining": "off",
"object-curly-spacing": [ "warn", "always" ],
"padding-line-between-statements": [ ...LINE_PADDING_RULES ],
quotes: [ "warn", "double" ],
Expand Down Expand Up @@ -340,8 +364,8 @@ module.exports = {
return: "parens"
}
],
"react/no-danger": 2,
"react/no-children-prop": 0,
"react/no-danger": 2,
"react/prop-types": 1,
semi: 1,
"sort-imports": [
Expand Down
51 changes: 39 additions & 12 deletions .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This workflow will build PRs submitted to the master branch.

name: PR Builder
name: 👷 PR Builder

on:
pull_request:
types: [ opened, synchronize, labeled ]
branches: [ master ]
paths-ignore:
- "**.md"
- "LICENSE"
workflow_dispatch:

# Avoid running multiple builds for the same PR.
concurrency:
Expand All @@ -21,6 +21,7 @@ env:
jobs:
lint:
name: ⬣ ESLint (STATIC ANALYSIS)
if: ${{ github.event_name == 'pull_request' || github.event.label.name == 'trigger-pr-builder' }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -31,7 +32,6 @@ jobs:
id: checkout
uses: actions/[email protected]
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0

- name: 🟢 Setup node
Expand Down Expand Up @@ -84,6 +84,7 @@ jobs:

typecheck:
name: ʦ Typecheck (STATIC ANALYSIS)
if: ${{ github.event.label.name == 'trigger-pr-builder' || github.event_name == 'pull_request'}}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -94,7 +95,6 @@ jobs:
id: checkout
uses: actions/[email protected]
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0

- name: 🟢 Setup node
Expand Down Expand Up @@ -138,12 +138,11 @@ jobs:
run: pnpm build:modules

- name: ☄️ Check Type Errors
run: pnpm nx affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --plain --target=typecheck --parallel=3
run: pnpm nx affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --target=typecheck --parallel=3

test:
name: 👾 Unit Test (TESTING)
if: false
needs: [ lint, typecheck ]
needs: [ typecheck ]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -186,7 +185,7 @@ jobs:

- name: 👷 Build Re-usable Modules
id: build-reusable-modules
run: pnpm build:modules
run: pnpm build:modules

- name: 🃏 Run Jest & Collect Coverage
id: run-jest-test-and-coverage
Expand All @@ -199,15 +198,42 @@ jobs:
pnpm nyc:text-summary-report
pnpm nyc:text-report
- name: Upload `@wso2is/core` coverage reports to Codecov
id: upload-wso2is-core-coverage-1
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./modules/core/coverage/coverage-final.json
flags: '@wso2is/core'
verbose: true

- name: Upload `@wso2is/features` coverage reports to Codecov
id: upload-wso2is-features-coverage-1
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./features/coverage/coverage-final.json
flags: '@wso2is/features'
verbose: true

- name: Upload `@wso2is/i18n` coverage reports to Codecov
id: upload-wso2is-i18n-coverage-1
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./modules/i18n/coverage/coverage-final.json
flags: '@wso2is/i18n'
verbose: true

build:
name: 🚧 Build
needs: [ typecheck ]
needs: [ test, typecheck ]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ lts/* ]
maven-version: [ 3.8.6 ]
java-version: [ 1.8 ]
java-version: [ 11 ]
pnpm-version: [ 8.7.4 ]
steps:
- name: ⬇️ Checkout
Expand All @@ -220,11 +246,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: ☕ Set up JDK 1.8
- name: ☕ Set up JDK 11
id: jdk-setup
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: "adopt"
cache: maven

- name: 🦩 Set up Maven
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# --------------------------------------------------------------------------------------

name: Release
name: 🚀 Release

on:
push:
Expand All @@ -34,7 +34,7 @@ env:
IS_HOTFIX: 'false'
BOT_USERNAME: ${{ secrets.RELEASE_BOT_USER_NAME }}
BOT_EMAIL: ${{ secrets.RELEASE_BOT_EMAIL }}

jobs:
release:
name: 🚀 Release
Expand All @@ -43,7 +43,7 @@ jobs:
matrix:
node-version: [lts/*]
maven-version: [3.8.6]
java-version: [1.8]
java-version: [11]
pnpm-version: [8.7.4]
steps:
- name: ⬇️ Checkout
Expand All @@ -64,11 +64,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: ☕ Set up JDK 1.8
- name: ☕ Set up JDK 11
id: jdk-setup
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
java-version: ${{ matrix.java-version }}
distribution: "adopt"
cache: maven

- name: 🦩 Set up Maven
uses: stCarolas/setup-maven@v4
Expand Down Expand Up @@ -181,4 +183,4 @@ jobs:
working-directory: .github/workflows
run: |
PACKAGES="${{ toJson(steps.changesets.outputs.publishedPackages) }}"
bash ./scripts/release.sh "$PACKAGES" ${{ github.run_number }}
bash ./scripts/release.sh "$PACKAGES" ${{ github.run_number }} ${{ env.IS_HOTFIX }}
26 changes: 23 additions & 3 deletions .github/workflows/scripts/lint-changed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ GITHUB_PR_NUMBER=$1
# When unsupported file formats are passed in, ESLint throws a warning which conflicts with -max-warnings=0.
# Hence, we need to manually filter out the supported formats.
# Tracker: https://github.com/eslint/eslint/issues/15010
ESLINT_SUPPORTED_EXT=(js jsx ts tsx)
ESLINT_SUPPORTED_EXT=(js jsx ts tsx json)

# Excluding files that adhere to the specified patterns from the list of supported files.
PATHS_TO_EXCLUDE=("identity-apps-core/apps/**/*.js",".eslintrc.js")
PATHS_TO_EXCLUDE=("identity-apps-core/apps/**/*.js" ".eslintrc.js")

MAX_FILE_THRESHOLD_FOR_LINTER=30

Expand Down Expand Up @@ -83,6 +83,13 @@ echo -e "\n=============================================================\n"

echo -e "\n 🥬 Starting analyzing the changed files with ESLint.. \n"

if [[ ${#supported_files[@]} -gt MAX_FILE_THRESHOLD_FOR_LINTER ]]; then
echo -e "\n 🔥 Linting the changed files as batches... \n"
fi

# Variable to track if any linting errors occur
lint_errors=false

for ((i=0; i < ${#supported_files[@]}; i+=MAX_FILE_THRESHOLD_FOR_LINTER))
do
chunk=( "${supported_files[@]:i:MAX_FILE_THRESHOLD_FOR_LINTER}" )
Expand All @@ -97,8 +104,21 @@ do
fi

if [[ ${#supported_files[@]} -gt MAX_FILE_THRESHOLD_FOR_LINTER ]]; then
echo -e "\n 🔥 Linting the changed files as batches..Here are the results... \n"
echo -e "\n 🔥 Linting batch $((i/MAX_FILE_THRESHOLD_FOR_LINTER + 1))... \n"
fi

pnpm eslint --ext .js,.jsx,.ts,.tsx --no-error-on-unmatched-pattern --max-warnings=0 --resolve-plugins-relative-to . -- "$filter_pattern"

# Capture the exit status of ESLint
if [ $? -ne 0 ]; then
lint_errors=true
fi
done

# Exit with status 1 if any linting errors were found
if [ "$lint_errors" = true ]; then
echo -e "\n❌ Linting failed. Please fix the errors above.\n"
exit 1
else
echo -e "\n✅ Linting passed. No errors found.\n"
fi
Loading

0 comments on commit bbcb848

Please sign in to comment.