Skip to content

Commit

Permalink
Merge branch 'main' into RHIDP-4244
Browse files Browse the repository at this point in the history
  • Loading branch information
nilgaar committed Dec 4, 2024
2 parents 483e855 + f0c62a6 commit 5ab1ea0
Show file tree
Hide file tree
Showing 319 changed files with 3,486 additions and 36,560 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
Expand All @@ -52,11 +51,12 @@ jobs:
run: rm app-config.yaml && mv app-config.example.yaml app-config.yaml

- name: Install dependencies
run: |
yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}

- name: Build packages
run: yarn run build --concurrency=75% --affected
run: yarn run build --continue --affected

test:
name: Test with Node.js ${{ matrix.node-version }}
Expand All @@ -75,7 +75,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
Expand All @@ -84,32 +83,27 @@ jobs:
run: rm app-config.yaml && mv app-config.example.yaml app-config.yaml

- name: Install dependencies
run: |
yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}

- name: Run prettier
run: yarn prettier:check --concurrency=75% --affected
run: yarn prettier:check --continue --affected

- name: Run lint
run: yarn run lint:check --concurrency=75% --affected
run: yarn run lint:check --continue --affected

- name: Run monorepo tools
run: yarn run monorepo:check

- name: Run prettier for e2e
run: cd e2e-tests && yarn prettier:check --concurrency=75% --affected

- name: Run lint for e2e
run: cd e2e-tests && yarn run lint:check

- name: Regenerate dockerfiles
run: |
yarn run build:dockerfile; if [[ $(git diff --name-only | grep Dockerfile || true) != "" ]]; then \
echo "ERROR: Workspace is dirty! Must run 'yarn build:dockerfile' and commit changes!"; exit 1; \
fi
- name: Run tests
run: yarn run test --concurrency=75% --affected
run: yarn run test --continue --affected

- name: Verify wrappers
run: yarn workspace dynamic-plugins-utils run test:wrappers
21 changes: 7 additions & 14 deletions .github/workflows/techdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,20 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: Install Dependencies
run: |
yarn install
if [[ $(git diff --name-only . | grep yarn.lock || true) ]]; then
echo "After 'yarn install', workspace is dirty! The following files have changed:"
echo
git diff --name-only . || true
exit 42
fi
- name: Install dependencies
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v20

- name: Lint
run: |
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/update-backstage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ on:
Specify a glob pattern to select packages for upgrade (e.g., `@{backstage,backstage-community}/*`).
To update all Backstage-related packages, use `@{backstage,backstage-community,janus-idp,roadiehq,immobiliarelabs,pagerduty,parfuemerie-douglas}/*`.
required: false
skip-export-dynamic:
description: 'Skip updating dynamic plugins'
required: false
type: boolean
schedule:
- cron: "15 3 * * WED" # Every Wednesday at 3:15 AM

Expand All @@ -48,7 +44,7 @@ jobs:
steps:
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }}
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }}
Expand All @@ -65,14 +61,15 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v20

- name: Run versons:bump script
run: |
yarn versions:bump \
${{ inputs.release && format('--release {0}', inputs.release) }} \
${{ inputs.pattern && format('--pattern {0}', inputs.pattern) }} \
${{ inputs.skip-export-dynamic && '--skip-export-dynamic' }}
${{ inputs.pattern && format('--pattern {0}', inputs.pattern) }}
- name: Determine PR details
id: pr-details
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ node_modules/
dist
dist-types
dist-scalprum
dist-dynamic

# Temporary change files created by Vim
*.swp
Expand All @@ -54,9 +55,6 @@ site
# Dynamic plugins root content
dynamic-plugins-root/*
!dynamic-plugins-root/.gitkeep
dynamic-plugins/wrappers/*/dist-dynamic/src
dynamic-plugins/imports/*/
dynamic-plugins/*/dist-dynamic/src

#dev caches
.webpack-cache
Expand Down
29 changes: 29 additions & 0 deletions .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,33 @@ GKE_SERVICE_ACCOUNT_NAME=$(cat /tmp/secrets/GKE_SERVICE_ACCOUNT_NAME)
GKE_CERT_NAME=$(cat /tmp/secrets/GKE_CERT_NAME)
GOOGLE_CLOUD_PROJECT=$(cat /tmp/secrets/GOOGLE_CLOUD_PROJECT)

# authentication providers variables
RHSSO76_ADMIN_USERNAME=$(cat /tmp/secrets/RHSSO76_ADMIN_USERNAME)
RHSSO76_ADMIN_PASSWORD=$(cat /tmp/secrets/RHSSO76_ADMIN_PASSWORD)
RHSSO76_DEFAULT_PASSWORD=$(cat /tmp/secrets/RHSSO76_DEFAULT_PASSWORD)
RHSSO76_URL=$(cat /tmp/secrets/RHSSO76_URL)
RHSSO76_CLIENT_SECRET=$(cat /tmp/secrets/RHSSO76_CLIENT_SECRET)
RHSSO76_CLIENT_ID="myclient"
AUTH_PROVIDERS_REALM_NAME="authProviders"

AZURE_LOGIN_USERNAME=$(cat /tmp/secrets/AZURE_LOGIN_USERNAME)
AZURE_LOGIN_PASSWORD=$(cat /tmp/secrets/AZURE_LOGIN_PASSWORD)
AUTH_PROVIDERS_AZURE_CLIENT_ID=$(cat /tmp/secrets/AUTH_PROVIDERS_AZURE_CLIENT_ID)
AUTH_PROVIDERS_AZURE_CLIENT_SECRET=$(cat /tmp/secrets/AUTH_PROVIDERS_AZURE_CLIENT_SECRET)
AUTH_PROVIDERS_AZURE_TENANT_ID=$(cat /tmp/secrets/AUTH_PROVIDERS_AZURE_TENANT_ID)

AUTH_PROVIDERS_GH_ORG_NAME="rhdhqeauthorg"
AUTH_ORG_APP_ID=$(cat /tmp/secrets/AUTH_ORG_APP_ID)
AUTH_ORG_CLIENT_ID=$(cat /tmp/secrets/AUTH_ORG_CLIENT_ID)
AUTH_ORG_CLIENT_SECRET=$(cat /tmp/secrets/AUTH_ORG_CLIENT_SECRET)
AUTH_ORG1_PRIVATE_KEY=$(cat /tmp/secrets/AUTH_ORG1_PRIVATE_KEY)
AUTH_ORG_PK=$(cat /tmp/secrets/AUTH_ORG_PK)
AUTH_ORG_WEBHOOK_SECRET=$(cat /tmp/secrets/AUTH_ORG_WEBHOOK_SECRET)
GH_USER_PASSWORD=$(cat /tmp/secrets/GH_USER_PASSWORD)

AUTH_PROVIDERS_RELEASE="rhdh-auth-providers"
AUTH_PROVIDERS_NAMESPACE="showcase-auth-providers"
STATIC_API_TOKEN="somecicdtoken"
AUTH_PROVIDERS_CHART="rhdh-chart/backstage"

set +a # Stop automatically exporting variables
12 changes: 8 additions & 4 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ set_cluster_info() {
export K8S_CLUSTER_URL=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_URL)
export K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_TOKEN)

if [[ "$JOB_NAME" == *ocp-v4-14 ]]; then
# Use cluster credentials for OpenShift version 4.14.
if [[ "$JOB_NAME" == *ocp-v4-16 ]]; then
K8S_CLUSTER_URL=$(cat /tmp/secrets/RHDH_OS_1_CLUSTER_URL)
K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/RHDH_OS_1_CLUSTER_TOKEN)
elif [[ "$JOB_NAME" == *ocp-v4-15 ]]; then
Expand Down Expand Up @@ -311,10 +310,13 @@ run_tests() {

# Copy screenshots if they exist.
if [ -d "/tmp/backstage-showcase/e2e-tests/screenshots" ]; then
cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/"
cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/"
fi

if [ -d "/tmp/backstage-showcase/e2e-tests/auth-providers-logs" ]; then
cp -a /tmp/backstage-showcase/e2e-tests/auth-providers-logs/* "${ARTIFACT_DIR}/${project}/"
fi

# Convert ANSI logs to HTML.
ansi2html <"/tmp/${LOGFILE}" >"/tmp/${LOGFILE}.html"
cp -a "/tmp/${LOGFILE}.html" "${ARTIFACT_DIR}/${project}"
# Copy the Playwright report.
Expand Down Expand Up @@ -522,6 +524,8 @@ main() {
initiate_rbac_gke_deployment
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}"
delete_namespace "${NAME_SPACE_RBAC_K8S}"
elif [[ "$JOB_NAME" == *auth-providers* ]]; then
run_tests "${AUTH_PROVIDERS_RELEASE}" "${AUTH_PROVIDERS_NAMESPACE}"
else
# Initiate deployments on OpenShift.
initiate_deployments
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
upstream:
backstage:
appConfig:
auth:
providers:
oidc:
production:
metadataUrl: ${RHBK_METADATA_URL}
clientId: ${RHBK_CLIENT_ID}
clientSecret: ${RHBK_CLIENT_SECRET}
prompt: auto
callbackUrl: ${RHBK_CALLBACK_URL}
catalog:
providers:
keycloakOrg:
default:
baseUrl: ${RHBK_URL}
loginRealm: ${AUTH_PROVIDERS_REALM_NAME}
realm: ${AUTH_PROVIDERS_REALM_NAME}
clientId: ${RHBK_CLIENT_ID}
clientSecret: ${RHBK_CLIENT_SECRET}
schedule:
frequency: { minutes: 1 }
timeout: { minutes: 1 }
11 changes: 9 additions & 2 deletions .ibm/pipelines/value_files/values_showcase-auth-providers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ upstream:
githubUrl: https://github.com
orgs: ['${AUTH_PROVIDERS_GH_ORG_NAME}']
schedule:
initialDelay: { seconds: 10 }
initialDelay: { seconds: 0 }
frequency: { minutes: 1 }
timeout: { minutes: 1 }
microsoftGraphOrg:
Expand Down Expand Up @@ -105,12 +105,19 @@ upstream:
- name: user:default/qeadmin_rhdhtesting.onmicrosoft.com
- name: user:default/rhsso_admin
- name: user:default/rhdhqeauthadmin
backend:
auth:
externalAccess:
- type: static
options:
token: "somecicdtoken"
subject: e2e-tests-ci
extraEnvVarsSecrets:
- rhdh-secrets
image:
registry: quay.io
repository: rhdh/rhdh-hub-rhel9
tag: '1.3'
tag: 'next'
readinessProbe:
failureThreshold: 3
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.17.0
20.18.1
Loading

0 comments on commit 5ab1ea0

Please sign in to comment.