forked from janus-idp/helm-backstage
-
Notifications
You must be signed in to change notification settings - Fork 30
chore(backstage): embed upstream backstage chart as subtree [RHIDP-12534] #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 26 commits into
redhat-developer:main
from
rm3l:rhidp-12534-embed-backstage-chart-as-subtree
Mar 30, 2026
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f2c5e6b
Merge commit '58ab62de223f5d5c4352bbc753945ce16f9542eb' as 'charts/ba…
rm3l 58ab62d
Squashed 'charts/backstage/vendor/backstage/' content from commit 486…
rm3l d29fe08
chore: switch dependency on upstream chart to local vendor copy
rm3l 4d076b7
chore: add CONTRIBUTING guide with a note on the upstream Backstage c…
rm3l 6651961
ci: add nightly workflow for syncing the subtree with the upstream ba…
rm3l a651fac
chore: bump backstage chart version
rm3l 8d8d13d
chore: skip vendored charts from JSON schema dereference script
rm3l 27c5918
chore: skip vendored charts from Helm Docs handling
rm3l 0d32f13
chore: run pre-commit hooks
rm3l 0b7ed0d
chore: remove reference to the upstream Backstage chart repo
rm3l fdd8517
chore: exclude vendored chart from SonarCloud analysis
rm3l a72ce0f
ci: re-add backstage repo dependency to test action as it is needed t…
rm3l 3334278
chore: update vendored charts dependencies manually and track them
rm3l b7e738b
chore: run pre-commit hooks
rm3l 04a8d8e
chore: skip files in vendor/ from the Renovate auto-discovery
rm3l 2b2fdd5
Merge remote-tracking branch 'upstream/main' into rhidp-12534-embed-b…
rm3l 06e8ed4
fixup! chore: skip vendored charts from JSON schema dereference script
rm3l 1b637f9
Address review comments
rm3l c1cfad1
chore: add .gitleaks.toml ignoring some CI values files containing du…
rm3l 9e22786
Merge remote-tracking branch 'upstream/main' into rhidp-12534-embed-b…
rm3l 43f64ee
Merge commit '9522798f7b60dc0339f3b34a8408789bdba29dbd' into rhidp-12…
rm3l 9522798
Squashed 'charts/backstage/vendor/backstage/' changes from 4862002..3…
rm3l af95e3a
chore: regen chart lock file
rm3l f1a05a7
ci: remove upstream backstage repo from test GH action as it is now u…
rm3l cedace1
Squashed 'charts/backstage/vendor/backstage/' changes from 312d0b1..2…
rm3l 09cf934
Merge commit 'cedace10a744f7fd7fc3144b5540f4f77427d978' into rhidp-12…
rm3l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": [ | ||
| "config:base", | ||
| "config:recommended", | ||
| "helpers:pinGitHubActionDigests" | ||
| ], | ||
| "ignorePaths": [ | ||
| "charts/**/vendor/**" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| name: Sync Upstream Backstage Chart | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 3 * * *' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| sync-upstream: | ||
| name: Sync Upstream Backstage | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Helm | ||
| uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 | ||
| with: | ||
| version: v3.17.0 | ||
|
|
||
| - name: Set up yq | ||
| uses: mikefarah/yq@5a7e72a743649b1b3a47d1a1d8214f3453173c51 # v4.52.4 | ||
| with: | ||
| cmd: yq --version | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Sync upstream Backstage subtree | ||
| id: sync | ||
| run: | | ||
| BEFORE_SHA=$(git rev-parse HEAD) | ||
|
|
||
| git remote add upstream-backstage https://github.com/backstage/charts.git | ||
| git fetch upstream-backstage main | ||
| git subtree pull --prefix charts/backstage/vendor/backstage upstream-backstage main --squash \ | ||
| -m "Squashed sync of upstream Backstage chart" | ||
|
|
||
| AFTER_SHA=$(git rev-parse HEAD) | ||
|
|
||
| if [ "$BEFORE_SHA" = "$AFTER_SHA" ]; then | ||
| echo "No changes from upstream." | ||
| echo "has_changes=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "Changes detected from upstream." | ||
| echo "has_changes=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Align dependency version and open PR | ||
| if: steps.sync.outputs.has_changes == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| CHART_VERSION=$(yq '.version' charts/backstage/vendor/backstage/charts/backstage/Chart.yaml) | ||
| TITLE="chore(deps): update upstream Backstage chart to ${CHART_VERSION}" | ||
| BRANCH="chore/sync-upstream-backstage-${CHART_VERSION}" | ||
|
|
||
| EXISTING_PR=$(gh pr list --head "${BRANCH}" --state open --json number --jq '.[0].number // empty') | ||
|
|
||
| # Align the backstage dependency version declared in Chart.yaml | ||
| export CHART_VERSION | ||
| yq -i '(.dependencies[] | select(.name == "backstage")).version = env(CHART_VERSION)' charts/backstage/Chart.yaml | ||
|
|
||
| # Rebuild the Helm dependency lock file | ||
| helm repo add bitnami https://charts.bitnami.com/bitnami | ||
| helm dependency update charts/backstage | ||
|
|
||
|
rm3l marked this conversation as resolved.
|
||
| # Commit version and lock file changes, if any | ||
| git add charts/backstage/Chart.yaml charts/backstage/Chart.lock | ||
| if ! git diff --cached --quiet; then | ||
| git commit -m "${TITLE}" | ||
| fi | ||
|
|
||
| git checkout -b "${BRANCH}" | ||
|
|
||
| if [ -n "${EXISTING_PR}" ]; then | ||
| echo "Updating existing PR #${EXISTING_PR} for version ${CHART_VERSION}." | ||
| git push --force origin "${BRANCH}" | ||
| else | ||
| git push origin "${BRANCH}" | ||
|
|
||
| BODY=$(cat <<EOF | ||
| Automated nightly sync of the vendored Backstage chart from the [upstream repository](https://github.com/backstage/charts). | ||
|
|
||
| Updated the vendored Backstage chart to version **${CHART_VERSION}** and aligned the dependency reference in \`charts/backstage/Chart.yaml\`. | ||
| EOF | ||
| ) | ||
|
|
||
| gh pr create \ | ||
| --title "${TITLE}" \ | ||
| --body "${BODY}" \ | ||
| --base "${{ github.ref_name }}" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [allowlist] | ||
| description = "Global Allowlist" | ||
|
|
||
| # Ignore based on any subset of the file path | ||
| paths = [ | ||
| # Ignore all example certs | ||
| # '''\/example.*\.pem$''', | ||
|
|
||
| # Ignore anything with the word funkymonkey anywhere in the path | ||
| # '''funkymonkey''', | ||
|
|
||
| # CI values | ||
| '''.*\/ci\/default-values\.yaml$''', | ||
| '''.*\/ci\/appConfig-values\.yaml$''', | ||
| '''.*\/ci\/probes-values\.yaml$''', | ||
| ] | ||
|
|
||
| # Ignore based on any subset of the line | ||
| #regexes = [ | ||
| # # Ignore lines containing pickles | ||
| # '''pickles''', | ||
| #] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| charts/backstage/vendor | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sonar.exclusions = charts/backstage/vendor/**/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Contributing | ||
|
|
||
| ## Checklist | ||
|
|
||
| Before making a contribution to the charts in this repository, you will need to ensure the following steps have been done: | ||
|
|
||
| - Run `helm template` on the changes you're making to ensure they are correctly rendered into Kubernetes manifests. | ||
| - Lint tests have been run for the Chart using the [Chart Testing](https://github.com/helm/chart-testing) tool and the `ct lint` command. | ||
| - For each Chart updated, version bumped in the corresponding `Chart.yaml` according to [Semantic Versioning](http://semver.org/). | ||
| - For each Chart updated, ensure variables are documented in the corresponding `values.yaml` file and the [pre-commit](https://pre-commit.com/) hook has been run with `pre-commit run --all-files` to generate the corresponding `README.md` documentation. The [pre-commit Workflow](./.github/workflows/pre-commit.yaml) will enforce this and warn you if needed. | ||
| - JSON Schema template updated and re-generated the raw schema via the `pre-commit` hook. | ||
| - [ ] If you updated the [orchestrator-infra](./charts/orchestrator-infra) chart, make sure the versions of the [Knative CRDs](./charts/orchestrator-infra/crds) are aligned with the versions of the CRDs installed by the OpenShift Serverless operators declared in the [values.yaml](./charts/orchestrator-infra/values.yaml) file. See [Installing Knative Eventing and Knative Serving CRDs](./charts/orchestrator-infra/README.md#installing-knative-eventing-and-knative-serving-crds) for more details. | ||
|
|
||
| ## Note on the Backstage chart dependencies | ||
|
|
||
| This project uses a **Git Subtree** strategy to manage our dependency on the [upstream Backstage Helm chart](https://github.com/backstage/charts.git). This allows us to maintain local customizations while keeping a link to the upstream source for future updates. | ||
|
|
||
| Unlike standard Helm dependencies that fetch tarballs from a remote repository, our dependency on Backstage is **vendored** directly into this repository under [`charts/backstage/vendor/backstage`](./charts/backstage/vendor/backstage). | ||
|
|
||
| ### Developer workflow | ||
|
|
||
| To sync with the upstream Backstage repository, add it as a remote on your local machine: | ||
|
|
||
| ```bash | ||
| git remote add -f upstream-backstage https://github.com/backstage/charts.git | ||
| ``` | ||
|
|
||
| When the upstream Backstage team releases an update, we can pull their changes into our subtree: | ||
|
|
||
| ```bash | ||
| git fetch upstream-backstage main | ||
| git subtree pull --prefix charts/backstage/vendor/backstage upstream-backstage main --squash | ||
|
|
||
| # You may also need to update the dependency version under charts/backstage/Chart.yaml | ||
| ``` | ||
|
|
||
| It is important to use `--squash` to avoid pulling the entire commit history of the upstream chart repository. | ||
|
|
||
| *Note: If merge conflicts occur, resolve them in your editor, then `git add` and `git commit` the resolution as a normal merge.* | ||
|
|
||
| **Important:** After any change to the dependency structure or version of the vendored chart, you must rebuild the lock file and local subchart dependencies: | ||
|
|
||
| ```bash | ||
| helm dependency update charts/backstage/vendor/backstage/charts/backstage | ||
| helm dependency update charts/backstage | ||
| ``` | ||
|
|
||
| To contribute changes back to the upstream repo, you can push them directly to your personal fork of the upstream Backstage charts and open up a PR: | ||
|
|
||
| ```bash | ||
| # Push to your personal fork of the upstream Backstage charts repo | ||
| git remote add my-upstream-fork ssh://git@github.com/${YOUR_USERNAME}/${MY_FORK}.git | ||
| git subtree push --prefix charts/backstage/vendor/backstage my-upstream-fork ${MY_BRANCH} | ||
|
|
||
| # Open up a PR on the upstream Backstage charts repository | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.