Skip to content

Commit

Permalink
Merge branch 'main' into build-tagged-images
Browse files Browse the repository at this point in the history
  • Loading branch information
kadel authored Jan 24, 2025
2 parents 8c943c9 + 9a7353c commit af97c88
Show file tree
Hide file tree
Showing 57 changed files with 1,564 additions and 1,066 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cache-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ on:
pull_request:
types:
- closed
- labeled

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
# when the PR is closed or labeled as 'Stale'
if: ${{ github.event.action == 'closed' || github.event.label.name == 'Stale' }}
run: |
gh extension install actions/gh-actions-cache
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pr-build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
echo "Changes detected outside the e2e-tests or .ibm folders. Proceeding with the build."
echo "proceed_with_build=true" >> $GITHUB_ENV
else
echo "No changes outside the e2e-tests or .ibm folders. Skipping the build."
echo "No significant changes detected. Skipping the build."
echo "proceed_with_build=false" >> $GITHUB_ENV
fi
Expand All @@ -80,10 +80,11 @@ jobs:
IMAGE_TAG="pr-${{ github.event.number }}"
IMAGE_NAME="${{ env.REGISTRY }}/rhdh-community/rhdh:${IMAGE_TAG}"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://quay.io/rhdh-community/rhdh/manifests/${IMAGE_TAG}")
# Check if any image tag exists for the PR
IMAGE_TAGS=$(curl -s "https://quay.io/api/v1/repository/rhdh-community/rhdh/tag/" | jq -r --arg tag "$IMAGE_TAG" '.tags[] | select(.name | startswith($tag)) | .name')
if [ "$HTTP_CODE" -eq 200 ]; then
echo "Image $IMAGE_NAME already exists. Skipping the build."
if [ -n "$IMAGE_TAGS" ]; then
echo "Image $IMAGE_NAME or its variants already exist. Skipping the build."
echo "image_exists=true" >> $GITHUB_ENV
else
echo "Image $IMAGE_NAME does not exist. Proceeding with the build."
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Label stale PR'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 21 days.'
days-before-pr-stale: 7
days-before-pr-close: 21
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. This project switched to Jira at https://issues.redhat.com/projects/RHIDP/ for issue tracking. If this issues is still relevant, please reopen it there.'
days-before-issue-stale: 1
days-before-issue-close: 7
2 changes: 2 additions & 0 deletions .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ GH_USER2_PASS=$(cat /tmp/secrets/GH_USER2_PASS)
GH_USER2_2FA_SECRET=$(cat /tmp/secrets/GH_USER2_2FA_SECRET)
GH_RHDH_QE_USER_TOKEN=$(cat /tmp/secrets/GH_RHDH_QE_USER_TOKEN)

K8S_CLUSTER_TOKEN_TEMPORARY=$(cat /tmp/secrets/K8S_CLUSTER_TOKEN_TEMPORARY)

GITLAB_TOKEN=$(cat /tmp/secrets/GITLAB_TOKEN)

RHDH_PR_OS_CLUSTER_URL=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_URL)
Expand Down
4 changes: 2 additions & 2 deletions .ibm/pipelines/resources/postgres-db/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ spec:
pgbackrest:
resources:
limits:
cpu: 300m
requests:
cpu: 200m
requests:
cpu: 100m
pgbackrestConfig:
resources:
limits:
Expand Down
12 changes: 6 additions & 6 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ spec:
EOD
}

# Monitors the status of an operator in an OpenShift namespace.
# It checks the ClusterServiceVersion (CSV) for a specific operator to verify if its phase matches an expected value.
# Monitors the status of an operator in an OpenShift namespace.
# It checks the ClusterServiceVersion (CSV) for a specific operator to verify if its phase matches an expected value.
check_operator_status() {
local timeout=${1:-300} # Timeout in seconds (default 300)
local namespace=$2 # Namespace to check
Expand All @@ -302,7 +302,7 @@ check_operator_status() {
echo "Expected status: ${expected_status}"

timeout "${timeout}" bash -c "
while true; do
while true; do
CURRENT_PHASE=\$(oc get csv -n '${namespace}' -o jsonpath='{.items[?(@.spec.displayName==\"${operator_name}\")].status.phase}')
echo \"Operator '${operator_name}' current phase: \${CURRENT_PHASE}\"
[[ \"\${CURRENT_PHASE}\" == \"${expected_status}\" ]] && echo \"Operator '${operator_name}' is now in '${expected_status}' phase.\" && break
Expand Down Expand Up @@ -627,7 +627,7 @@ install_acm_operator(){
wait_for_deployment "open-cluster-management" "multiclusterhub-operator"
oc apply -f "${DIR}/cluster/operators/acm/multiclusterhub.yaml"
# wait until multiclusterhub is Running.
timeout 600 bash -c 'while true; do
timeout 600 bash -c 'while true; do
CURRENT_PHASE=$(oc get multiclusterhub multiclusterhub -n open-cluster-management -o jsonpath="{.status.phase}")
echo "MulticlusterHub Current Status: $CURRENT_PHASE"
[[ "$CURRENT_PHASE" == "Running" ]] && echo "MulticlusterHub is now in Running phase." && break
Expand Down Expand Up @@ -705,7 +705,7 @@ initiate_deployments() {
configure_namespace "${NAME_SPACE_RBAC}"
configure_external_postgres_db "${NAME_SPACE_RBAC}"

# Initiate rbac instace deployment.
# Initiate rbac instance deployment.
local rbac_rhdh_base_url="https://${RELEASE_NAME_RBAC}-backstage-${NAME_SPACE_RBAC}.${K8S_CLUSTER_ROUTER_BASE}"
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}" "${rbac_rhdh_base_url}"
echo "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE: ${RELEASE_NAME_RBAC}"
Expand Down Expand Up @@ -769,7 +769,7 @@ force_delete_namespace() {
}

oc_login() {
oc login --token="${K8S_CLUSTER_TOKEN}" --server="${K8S_CLUSTER_URL}"
oc login --token="${K8S_CLUSTER_TOKEN}" --server="${K8S_CLUSTER_URL}" --insecure-skip-tls-verify=true
echo "OCP version: $(oc version)"
export K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//')
}
8 changes: 6 additions & 2 deletions .rhdh/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Stage 1 - Build nodejs skeleton
#@follow_tag(registry.access.redhat.com/ubi9/nodejs-20:1)
# https://registry.access.redhat.com/ubi9/nodejs-20
FROM registry.access.redhat.com/ubi9/nodejs-20:9.5-1736455676 AS build
FROM registry.access.redhat.com/ubi9/nodejs-20:9.5-1737421648 AS build
# hadolint ignore=DL3002
USER 0

Expand Down Expand Up @@ -71,7 +71,11 @@ COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-datadog/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-datadog/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-header/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-header/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/parfuemerie-douglas-scaffolder-backend-module-azure-repositories-dynamic/package.json ./dynamic-plugins/wrappers/parfuemerie-douglas-scaffolder-backend-module-azure-repositories-dynamic/package.json
Expand Down Expand Up @@ -261,7 +265,7 @@ RUN "$YARN" workspaces focus --all --production && \
# Stage 5 - Build the runner image
#@follow_tag(registry.access.redhat.com/ubi9/nodejs-20-minimal:1)
# https://registry.access.redhat.com/ubi9/nodejs-20-minimal
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:9.5-1736729465 AS runner
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:9.5-1737531030 AS runner
USER 0

# Downstream sources
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ We are excited to see you want to be a part of this project by contributing. Her
### Clone and Install

```bash
git clone https://github.com/your-username/backstage-showcase.git # Clone your forked repository
cd backstage-showcase # Change to the project directory
yarn install # Install dependencies
yarn tsc # Run type generation and checks
git clone https://github.com/your-username/rhdh.git # Clone your forked repository
cd rhdh # Change to the project directory
yarn install # Install dependencies
yarn tsc # Run type generation and checks
```

### Run the Showcase App
Expand Down
21 changes: 21 additions & 0 deletions app-config.dynamic-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ dynamicPlugins:
menuItem:
icon: bulkImportIcon
text: Bulk import
red-hat-developer-hub.backstage-plugin-global-header:
mountPoints:
- mountPoint: application/header
importName: GlobalHeader
config:
layout:
position: above-main-content
red-hat-developer-hub.backstage-plugin-dynamic-home-page:
dynamicRoutes:
- path: /
Expand Down Expand Up @@ -486,3 +493,17 @@ dynamicPlugins:
rbac:
parent: admin
icon: rbacIcon
red-hat-developer-hub.backstage-plugin-marketplace:
appIcons:
- name: marketplace
importName: MarketplaceIcon
dynamicRoutes:
- path: /marketplace
importName: MarketplacePage
menuItem:
icon: marketplace
text: Marketplace
mountPoints:
- mountPoint: admin.page.plugins/cards
importName: MarketplaceCatalogContent

1 change: 1 addition & 0 deletions catalog-entities/groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ metadata:
spec:
targets:
- ./groups/janus-authors.yaml
- ./groups/rhdh-team.yaml
11 changes: 11 additions & 0 deletions catalog-entities/groups/rhdh-team.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# NOTICE: In our internal Red Hat DevHub instance this groups are automatically imported due Rover/LDAP.
# This is duplication is for the purpose of using this groups in another test or public Backstage instance.
---
apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
name: rhdh-team
title: RHDH team
spec:
type: team
children: []
82 changes: 82 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
name: rhdh
title: RHDH
description: Red Hat Developer Hub is an enterprise-grade Internal Developer Portal based on Backstage.
annotations:
backstage.io/techdocs-ref: dir:.
github.com/project-slug: redhat-developer/rhdh
github.com/team-slug: redhat-developer/rhdh-team
quay.io/repository-slug: rhdh-community/rhdh
sonarqube.org/project-key: janus-idp_backstage-showcase
tags:
- backstage
- rhdh
links:
- url: https://red.ht/rhdh
title: Product website
icon: star
type: website
- url: https://developers.redhat.com/blog
title: Red Hat Developer Blog
icon: catalog
type: blog
- url: https://docs.redhat.com/fr/documentation/red_hat_developer_hub/
title: Official documentation
icon: docs
type: docs
- url: https://issues.redhat.com/browse/RHIDP
title: Jira issues
icon: help
type: jira
- url: https://github.com/redhat-developer/rhdh
title: Sourcecode on GitHub
icon: github
type: sourcecode
spec:
type: product
owner: rhdh-team
lifecycle: production
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: rhdh
title: RHDH
description: Red Hat Developer Hub is an enterprise-grade Internal Developer Portal based on Backstage.
annotations:
backstage.io/techdocs-ref: dir:.
github.com/project-slug: redhat-developer/rhdh
github.com/team-slug: redhat-developer/rhdh-team
quay.io/repository-slug: rhdh-community/rhdh
sonarqube.org/project-key: janus-idp_backstage-showcase
tags:
- backstage
- rhdh
links:
- url: https://red.ht/rhdh
title: Product website
icon: star
type: website
- url: https://developers.redhat.com/blog
title: Red Hat Developer Blog
icon: catalog
type: blog
- url: https://docs.redhat.com/fr/documentation/red_hat_developer_hub/
title: Official documentation
icon: docs
type: docs
- url: https://issues.redhat.com/browse/RHIDP
title: Jira issues
icon: help
type: jira
- url: https://github.com/redhat-developer/rhdh
title: Sourcecode on GitHub
icon: github
type: sourcecode
spec:
type: product
owner: rhdh-team
lifecycle: production
system: rhdh
10 changes: 7 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.7-labs
# syntax=docker/dockerfile:1.13-labs

# THIS IS USED BY Konflux builds >= 1.4
# TODO verify this works with Cachi2 once we enable that, or switch to use ../.rhdh/docker/Dockerfile as input
Expand All @@ -24,7 +24,7 @@

# Stage 1 - Build nodejs skeleton
# https://registry.access.redhat.com/ubi9/nodejs-20
FROM registry.access.redhat.com/ubi9/nodejs-20:9.5-1733148170 AS skeleton
FROM registry.access.redhat.com/ubi9/nodejs-20:9.5-1737421648 AS skeleton
# hadolint ignore=DL3002
USER 0

Expand Down Expand Up @@ -72,7 +72,11 @@ COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-datadog/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-datadog/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-header/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-header/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/parfuemerie-douglas-scaffolder-backend-module-azure-repositories-dynamic/package.json ./dynamic-plugins/wrappers/parfuemerie-douglas-scaffolder-backend-module-azure-repositories-dynamic/package.json
Expand Down Expand Up @@ -200,7 +204,7 @@ RUN "$YARN" workspaces focus --all --production && \

# Stage 5 - Build the runner image
# https://registry.access.redhat.com/ubi9/nodejs-20-minimal
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:9.5-1730525319 AS runner
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:9.5-1737531030 AS runner
USER 0

# Upstream only
Expand Down
4 changes: 2 additions & 2 deletions docs/audit-log.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Audit Logging for Backstage Showcase
# Audit Logging for RHDH

Backstage Showcase supports audit logging for both the catalog and scaffolder. Audit logs can be identified by the `isAuditLog: true` field.
RHDH supports audit logging for both the catalog and scaffolder. Audit logs can be identified by the `isAuditLog: true` field.

## Configuring the audit logger

Expand Down
6 changes: 3 additions & 3 deletions docs/auth.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auth Providers within Backstage Showcase
# Auth Providers within RHDH

Currently we incorporate many of the Authentication providers available within Backstage. The Showcase supports the following providers:

Expand Down Expand Up @@ -112,7 +112,7 @@ In an example using Keycloak for authentication with the OIDC provider, there ar

1. Create a realm named keycloak.
2. Create the client backstage with Client authentication checked.
3. Set the Valid redirect URIs to `<BACKSTAGE_URL>/api/auth/oidc/handler/frame`. If running Backstage Showcase locally, it would look something like this: `http://localhost:7007/api/auth/oidc/handler/frame`.
3. Set the Valid redirect URIs to `<BACKSTAGE_URL>/api/auth/oidc/handler/frame`. If running RHDH locally, it would look something like this: `http://localhost:7007/api/auth/oidc/handler/frame`.
4. Set the `metadataUrl` to the URL of your Keycloak instance and realm. It should look similar to this: `<KEYCLOAK_URL>/realms/keycloak`.
5. Set the `clientId` to `backstage`.
6. Obtain the client secret for the client backstage within Keycloak and set `clientSecret`.
Expand All @@ -127,7 +127,7 @@ For more information on setting up the OIDC auth provider, consult the [Backstag

### Sign In Page configuration value

After selecting the authentication provider you wish to use with your Backstage Showcase instance, ensure to add the `signInPage` configuration value to ensure that the frontend displays the appropriate authentication provider.
After selecting the authentication provider you wish to use with your RHDH instance, ensure to add the `signInPage` configuration value to ensure that the frontend displays the appropriate authentication provider.

- Add the corresponding Authentication provider key as the value to `signInPage` in your `app-config`. Where `provider-id` matches the chosen provider from the table above.

Expand Down
Loading

0 comments on commit af97c88

Please sign in to comment.