## CNOE Backstage 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 <span style="color:red"> red </span> color and commits 
that may be relevant, but not in priority, will be marked with <span style="color:green"> green </span> color. Commits are listed from newest to oldest.


### <span style="color:green">№19. Commit name: Imported roadiehq http request plugin </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/135c0cb26f3e004a27a11edb6a4779035aff9805)<br>
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.

<span style="color:green">This commit introduces functionality that may be useful for extending our Backstage templates with web request capabilities </span>

### №18. Commit name: add mkdoc to docker image
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/9232d633b2698fffa6d0a73b715e06640d170162)<br>
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)<br>
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)<br>
This commit is mostly refactoring
1. Refined the structure of the `argoWorkflowsPlugin` by updating `createPlugin` and `createRoutableExtension` definitions. <br>Files changed: `plugins/argo-workflows/src/plugin.ts` and `plugins/argo-workflows/src/api/index.ts`

2. Reformatted and standardized code style 


### <span style="color:green">№15. Commit name: Extended plugin to support more k8s objects </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/2cde0a09caf55fe907463b0b8b4a6321482b322e)<br>
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. <b>Manifest Handling Optimization</b>. Simplified writing manifest to file based on input type (string or object).
2. <b>Support for Multiple Manifests</b>. Writes each manifest from a list to a separate file with a unique name.
3. <b>Kubernetes Config Generation</b>. Adds logic for creating Kubernetes config with server, certificate, and token details.
4. <b>kubectl Command Execution</b>. Executes kubectl apply or kubectl create for each manifest in the list.
5. <b>Error Handling</b>. 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)<br>
This commit contains fixes to the plugin for working with k8s. All changes are in file `packages/backend/src/plugins/k8s-apply.ts`

### <span style="color:red"> №13. Commit name: bump backstage version to 1.28.4 </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/db5d40f2848aaa8ca22a15fbdb7a06cfd986a162)<br>
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`.

<span style="color:red">This commit is important, because here is an example of the update of the backstage version and actualizing of the dependencies </span>

### №12. Commit name: fix typos
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/6f1e1764859ad29c042b9ed015cc71cd8dcc6543)<br>
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)<br>
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)<br>
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)<br>
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.

### <span style="color:red"> №8. Commit name: upgrade to backstage 1.26.5 </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/c2ff2abd11c6f719c51b50d04878b108ba70d40e)<br>
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. <span style="color:red"> Keycloak OIDC </span> <br>The authentication mechanism has been rewritten using Keycloak OIDC (<span style="color:red">file location: packages/backend/src/plugins/auth.ts</span>). The object responsible for authentication is named `authModuleKeycloakOIDCProvider`.

3. <span style="color:red"> Custom CNOE Scaffolder Actions (for Gitea and ArgoCD) </span> <br> Mechanism for creating and adding custom CNOE Scaffolder Actions, which are used as actions for Backstage templates, has been rewritten (<span style="color:red">file location: packages/backend/src/plugins/scaffolder.ts</span>)

<span style="color:red">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 </span>

### №7. Commit name: update readme
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/b8e4f08914af17a48ed6b8b83a3621a9f4b4181d)<br>
In this commit only README was updated

### <span style="color:green"> №6. Commit name: use cnoe theme </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/12eef8100d2521a6f665ef603ebe8196b12c8e96)<br>

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`

<span style="color:green"> 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 </span>

### <span style="color:red"> №5. Commit name: Add workflow to automate backstage builds </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/9ee3514e51c1a354b7fe85a90117faf8328bfa0b)<br>
In this commit were added github workflow for building backstage image and Dockerfile (files:  `.github/workflows/build-and-push.yaml` and `Dockerfile`)

### <span style="color:red"> №4. Commit name: Include plugin scaffolder actions directly in src </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/139a3674c035bfe9f486f50aa8cb3deee8b25fd5)<br>
#### 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`

<span style="color:red">This commit is important, because we will need scaffolder plugin in EDP backstage for using actions in backstage templates</span>
### <span style="color:red"> №3. Commit name: working integrations </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/4b61eaef5920da8b0110af8e6f2997354b8af63a)<br>
#### 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 (<span style="color:red"> packages/backend/src/plugins/gitea-actions.ts </span>) were commented out: <span style="color:green">checkGiteaContentUrl, checkDurationLimit and checkAvailabilityGiteaRepository </span>
5. Integration with ArgoCD was added into backend of the Backstage as a backend plugin (<span style="color:red"> packages/backend/src/plugins/argocd.ts</span>)
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. <br> <span style="color:red"> 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.</span> [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

<span style="color:red">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

### <span style="color:red"> №2. Commit name: working gitea scaffolding </span>
[Link to a commit](https://github.com/cnoe-io/backstage-app/commit/fe842bed997f317979da7fd42093bc62b3e491b7)<br>
#### Changes:
1. Implemented integration with gitea (<span style="color:red">file: packages/backend/src/plugins/gitea-actions.ts</span>)
2. Implemented integration with the kubernetes (<span style="color:red">file: packages/backend/src/plugins/kubernetes.ts</span>)

<span style="color:red">This commit is important, because here was implemented gitea and kubernetes integration that should be ported to EDP Backstage</span>
### №1. Commit name: Initial commit

