From 5410d9c8776a481dc7905900ab2275f525d9050d Mon Sep 17 00:00:00 2001 From: evdo Date: Fri, 21 Feb 2025 18:00:54 +0100 Subject: [PATCH] Report on the investigation of CNOE Backstage commit history added to the documentation --- .../CNOE-backstage-commit-history/_index.md | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 docs/technical-documentation/solution/tools/Backstage/CNOE-backstage-commit-history/_index.md diff --git a/docs/technical-documentation/solution/tools/Backstage/CNOE-backstage-commit-history/_index.md b/docs/technical-documentation/solution/tools/Backstage/CNOE-backstage-commit-history/_index.md new file mode 100644 index 0000000..1cddb6d --- /dev/null +++ b/docs/technical-documentation/solution/tools/Backstage/CNOE-backstage-commit-history/_index.md @@ -0,0 +1,163 @@ +## CNOE Bacstage commit history + +This page describes the features and changes added to CNOE Backstage, along with a brief summary of what was done in each commit. +Commits and changes that are important for implementation of the EDP Backstage will be marked with red color and commits +that could be interesting for EDP Backstage but not in priority will be marked with yellow color. Commits are listed from newest to oldest. + + +### №19. Commit name: Imported roadiehq http request plugin +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/135c0cb26f3e004a27a11edb6a4779035aff9805)
+This commit adds the `@roadiehq/scaffolder-backend-module-http-request` plugin. This plugin provides Scaffolder actions +that allow sending web requests within Backstage templates. + +[Description and usage examples](https://roadie.io/backstage/plugins/scaffolder-http-requests/) + +[RoadieHQ's Backstage plugins repository](https://github.com/RoadieHQ/roadie-backstage-plugins) + +#### Code changes: +The dependency was added to `package.json`: +``` +"@roadiehq/scaffolder-backend-module-http-request": "^4.3.5" +``` + +This means the project now includes this module and can import it in the code. + +The module was registered in `packages/backend/src/index.ts`: + +``` +backend.add( + import('@roadiehq/scaffolder-backend-module-http-request/new-backend'), +); +``` + +This integrates the module into the Backstage backend. + +This commit introduces functionality that may be useful for extending our Backstage templates with web request capabilities + +### №18. Commit name: add mkdoc to docker image +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/9232d633b2698fffa6d0a73b715e06640d170162)
+In this commit, several changes were made to the Dockerfile: +1. Mkdoc was added to the Dockerfile as part of the build process, enabling seamless integration for generating and managing project documentation during the containerization process. [Information about mkdocs](https://www.mkdocs.org/) +2. Refactoring of the Dockerfile. Optimization of the build structure + +### №17. Commit name: move argo workflows to ci/cd tab. remove unused components +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/e8b84831e99f13033beb11530149fbb24d846f29)
+In this commit no new functionality was added. Refactoring commit + +### №16. Commit name: Updated argoworkflows to query workflows based on component annotation +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/5f3a54f571ea6f210ebb3418611e1ac4e6e3e7c5)
+This commit is mostly refactoring +1. Refined the structure of the `argoWorkflowsPlugin` by updating `createPlugin` and `createRoutableExtension` definitions.
Files changed: `plugins/argo-workflows/src/plugin.ts` and `plugins/argo-workflows/src/api/index.ts` + +2. Reformatted and standardized code style + + +### №15. Commit name: Extended plugin to support more k8s objects +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/2cde0a09caf55fe907463b0b8b4a6321482b322e)
+This commit contains improvements to the plugin for working with k8s. All changes are in file `packages/backend/src/plugins/k8s-apply.ts` +#### Changes: +1. Manifest Handling Optimization. Simplified writing manifest to file based on input type (string or object). +2. Support for Multiple Manifests. Writes each manifest from a list to a separate file with a unique name. +3. Kubernetes Config Generation. Adds logic for creating Kubernetes config with server, certificate, and token details. +4. kubectl Command Execution. Executes kubectl apply or kubectl create for each manifest in the list. +5. Error Handling. Throws an error if a valid cluster name is not specified. + +### №14. Commit name: Fix for k8s-apply plugin config issue +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/6329ea80b1b0bb2e22f78333ae6462f147e1f4a1)
+This commit contains fixes to the plugin for working with k8s. All changes are in file `packages/backend/src/plugins/k8s-apply.ts` + +### №13. Commit name: bump backstage version to 1.28.4 +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/db5d40f2848aaa8ca22a15fbdb7a06cfd986a162)
+In this commit, the Backstage version for the build was updated. Along with this, the dependency versions in the +package.json files for Backstage, the Backstage backend, and for the custom CNOE plugins (appache-spark, argo-workflows, cnoe-ui, terraform-backend, and terraform) were also updated. +Additionally, in some places, the plugin imports were replaced with the current ones, such as in the file `packages/app/src/App.tsx`. + +This commit is important, because here is an example of the update of the backstage version and actualizing of the dependencies + +### №12. Commit name: fix typos +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/6f1e1764859ad29c042b9ed015cc71cd8dcc6543)
+This commit contains only fixes of the typos. + +### №11. Commit name: add actions for PRs +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/2361b299f2291f55062fde61afd06dbf9542fbef)
+Added `.github/workflows/pr.yaml` defining actions to run on pull request events. The workflow includes steps for checking out the repository, setting up Node.js, installing dependencies, and running TypeScript checks. + +### №10. Commit name: fix tsc errors +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/d328b6986b4721b31c606e1da3ba93afce1864b7)
+Bugfixes and improvements of the logging and tests for the custom `terraform-backend` plugin of the CNOE. + +### №9. Commit name: Add terraform plugin into backstage-app +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/10b78fca7a474b24b5e8124697a01bdf76b152ca)
+In this commit, Terraform was integrated into CNOE Backstage. To achieve this, two custom plugins, `terraform` and `terraform-backend`, were created in the `/plugins` directory. + +#### The following steps were taken to integrate these plugins into Backstage: +1. The Terraform plugin was added as an internal dependency (`"@internal/plugin-terraform"`) in the project's dependencies file (`packages/app/package.json`). +2. In `packages/app/src/App.tsx`, the Terraform Page component was imported from the plugin, and a route for this page was created with the path `/terraform`. +3. In the entity page component (`packages/app/src/components/catalog/EntityPage.tsx`), the Terraform plugin component was imported and integrated. +4. The Terraform backend plugin (`"@internal/backstage-plugin-terraform-backend"`) was added as an internal dependency in the Backstage backend dependencies file (`packages/backend/package.json`). +5. In the Backstage backend creation file (`packages/backend/src/index.ts`), the plugin was imported and added to the backend object. + +### №8. Commit name: upgrade to backstage 1.26.5 +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/c2ff2abd11c6f719c51b50d04878b108ba70d40e)
+The name of this commit is misleading because, in addition to updating the Backstage version and actualizing dependency files and imports, several other changes were made. +#### Changes besides version update: +1. Fully rewritten Backstage backend creation (`packages/backend/src/index.ts`). After the changes, the backend is now created using the createBackend function from the `@backstage/backend-defaults` plugin. + +2. Keycloak OIDC
The authentication mechanism has been rewritten using Keycloak OIDC (file location: packages/backend/src/plugins/auth.ts). The object responsible for authentication is named `authModuleKeycloakOIDCProvider`. + +3. Custom CNOE Scaffolder Actions (for Gitea and ArgoCD)
Mechanism for creating and adding custom CNOE Scaffolder Actions, which are used as actions for Backstage templates, has been rewritten (file location: packages/backend/src/plugins/scaffolder.ts) + +This commit is important, because here we can find locations of the CNOE custom actions for templates and implemintation of the keycloak auth for Backstage + +### №7. Commit name: update readme +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/b8e4f08914af17a48ed6b8b83a3621a9f4b4181d)
+In this commit only README was updated + +### №6. Commit name: use cnoe theme +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/12eef8100d2521a6f665ef603ebe8196b12c8e96)
+ +In this commit design of user interface was updated and integrated into the Backstage app +#### Changes: +1. Interface styles were update in plugin cnoe-ui in files: `plugins/cnoe-ui/src/components/themes/light-theme.ts` and `plugins/cnoe-ui/src/components/themes/dark-theme.ts` +2. UI style is connected to Backstage in file `packages/app/src/App.tsx` +3. Routs to CNOE logo for interface are created in file `packages/app/src/components/Root/Root.tsx` + + This commit could be intersting for the team, because here we can see how to connect custom ui to backstage and how to remove CNOE logo + +### №5. Commit name: Add workflow to automate backstage builds +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/9ee3514e51c1a354b7fe85a90117faf8328bfa0b)
+In this commit were added github workflow for building backstage image and Dockerfile (files: `.github/workflows/build-and-push.yaml` and `Dockerfile`) + +### №4. Commit name: Include plugin scaffolder actions directly in src +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/139a3674c035bfe9f486f50aa8cb3deee8b25fd5)
+#### Changes: +1. Test Backstage templates were created +2. `k8s-apply` plugin were added to backend of the Backstage (file: `packages/backend/src/plugins/k8s-apply.ts`) +3. `sanitize` plugin were added to backend of the Backstage (file: `packages/backend/src/plugins/sanitize.ts`) +4. `scaffolder` plugin were added to backend of the Backstage (file: `packages/backend/src/plugins/scaffolder.ts`) +5. `verify` plugin were added to backend of the Backstage (file: `packages/backend/src/plugins/verify.ts` + +This commit is important, because we will need scaffolder plugin in EDP backstage for using actions in backstage templates +### №3. Commit name: working integrations +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/4b61eaef5920da8b0110af8e6f2997354b8af63a)
+#### Changes: +1. Created custom CNOE plugin for integration with apache-spark (`/plugins/appache-spark`) +2. Created custom CNOE plugin for integration with apache-spark (`/plugins/argo-workflows`) +3. Created custom CNOE plugin for integration with apache-spark (`/plugins/cnoe-ui`) +4. In Backstage backend in file with custom gitea actions ( packages/backend/src/plugins/gitea-actions.ts ) were commented out: checkGiteaContentUrl, checkDurationLimit and checkAvailabilityGiteaRepository +5. Integration with ArgoCD was added into backend of the Backstage as a backend plugin ( packages/backend/src/plugins/argocd.ts) +6. In `packages/app/src/App.tsx` `argo-workflows plugin` and `apache-spark` plugin were integrated into Backstage and routs for their pages were created +7. To the backstage component for the catalog items (`packages/app/src/components/catalog/EntityPage.tsx`) were integrated components from `argo-wrkflows` plugin.
And was added component EntityArgoCDOverviewCard from @roadiehq/backstage-plugin-argo-cd which is a visual component for showing ArgoCD status of the catalog items, which are registered in ArgoCD. [Link to plugin's repo](https://github.com/RoadieHQ/roadie-backstage-plugins/tree/main/plugins/frontend/backstage-plugin-argo-cd). +8. New plugins were added to the dependencies + +This commit is important, because here we can find an implementation of the ArgoCD plugin for the Backstage backend and how it's integrated to a backstage. And here we can see integration of the component for showing ArgoCD status from @roadiehq/backstage-plugin-argo-cd plugin + +### №2. Commit name: working gitea scaffolding +[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/fe842bed997f317979da7fd42093bc62b3e491b7)
+#### Changes: +1. Implemented integration with gitea (file: packages/backend/src/plugins/gitea-actions.ts) +2. Implemented integration with the kubernetes (file: packages/backend/src/plugins/kubernetes.ts) + +This commit is important, because here was implemented gitea and kubernetes integration that should be ported to EDP Backstage +### №1. Commit name: Initial commit +