Skip to content
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

feat: custom busola extensions #3523

Merged
merged 10 commits into from
Dec 12, 2024

Conversation

chriskari
Copy link
Contributor

@chriskari chriskari commented Dec 6, 2024

Description
Changes proposed in this pull request:

  • added proxyHandler to backend (for accessing external APIs without CORS issues)
  • adjusted busola code to load custom html content and script provided by extension
  • added feature flag
  • added example for a custom extension

Related issue(s)
#3497

Definition of done

  • The PR's title starts with one of the following prefixes:
    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation only changes
    • refactor: A code change that neither fixes a bug nor adds a feature
    • test: Adding tests
    • chore: Maintainance changes to the build process or auxiliary tools, libraries, workflows, etc.
  • Related issues are linked. To link internal trackers, use the issue IDs like backlog#4567
  • Explain clearly why you created the PR and what changes it introduces
  • All necessary steps are delivered, for example, tests, documentation, merging

@kyma-bot kyma-bot added the cla: yes Indicates the PR's author has signed the CLA. label Dec 6, 2024
@chriskari chriskari linked an issue Dec 6, 2024 that may be closed by this pull request
6 tasks
@kyma-bot kyma-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 6, 2024

### 4. Deploy Your Extension

Run `./deploy.sh` to create a ConfigMap and deploy it to your cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To run this command, I need to have exported Kubeconfig to my cluster, please add this information, and also I'll consider changing the name of the sh file to some deploy-custom-extensions or something more specific.

Comment on lines 183 to 186
if (extCustomComponentsEnabled) {
extResourceWithMetadata.data.customHtml =
extResourceWithMetadata.data.customHtml || '';
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are copy-pasting the same value with only the || '' change, is it really necessary? Can't we handle this value somehow differently?

Comment on lines 334 to 336
if (extCustomComponentsEnabled) {
extResourceWithMetadata.data.customHtml =
currentConfigMap.data.customHtml;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add here this, and remove the previous copy-paste?

Suggested change
if (extCustomComponentsEnabled) {
extResourceWithMetadata.data.customHtml =
currentConfigMap.data.customHtml;
if (extCustomComponentsEnabled) {
extResourceWithMetadata.data.customHtml =
currentConfigMap.data.customHtml || '';

if (isExtensibilityCustomComponentsEnabled) {
// Wrap busola fetch function to be able to use it in the extensions as regular fetch.
// It reduces the learning curve for the extension developers and introduces loose coupling between Busola and the extensions.
function asRegularFetch(busolaFetch: any, url: string, options: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide more specific types?

@kyma-bot kyma-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 9, 2024
pbochynski
pbochynski previously approved these changes Dec 10, 2024
@kyma-bot kyma-bot added the lgtm Looks good to me! label Dec 10, 2024
@OliwiaGowor
Copy link
Contributor

LGTM

@@ -0,0 +1,24 @@
# Custom Extensions

Busola's custom extension feature allows you to design fully custom user interfaces that go beyond the built-in extensibility functionality. This feature is ideal for creating unique and specialized displays that are not covered by the built-in components.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Busola's custom extension feature allows you to design fully custom user interfaces that go beyond the built-in extensibility functionality. This feature is ideal for creating unique and specialized displays that are not covered by the built-in components.
Busola's custom extension feature allows you to design fully custom user interfaces beyond the built-in extensibility functionality. This feature is ideal for creating unique and specialized displays not covered by the built-in components.


## Getting Started

First, to enable the custom extension feature you need to set the corresponding feature flag in your busola config, which is disabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
First, to enable the custom extension feature you need to set the corresponding feature flag in your busola config, which is disabled by default.
To enable the custom extension feature, you must set the corresponding feature flag in your Busola config, which is disabled by default.

isEnabled: true
```

## Creating custom extensions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Creating custom extensions
## Creating Custom Extensions


Once your ConfigMap is ready, add it to your cluster, and Busola will load and display your custom UI.

The best way to get familiar with this mechanism is to have a look at our [example](./../../examples/custom-extension/README.md), where everything is explained in detail.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The best way to get familiar with this mechanism is to have a look at our [example](./../../examples/custom-extension/README.md), where everything is explained in detail.
See this [example](./../../examples/custom-extension/README.md), to learn more.

docs/features.md Outdated
@@ -56,6 +56,15 @@ EXTENSIBILITY:
isEnabled: true
```

- **EXTENSIBILITY_CUSTOM_COMPONENTS** - is used to indicate whether entirely custom extensions can be added to Busola. An example for a custom extension can be found [here](../examples/custom-extension/README.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **EXTENSIBILITY_CUSTOM_COMPONENTS** - is used to indicate whether entirely custom extensions can be added to Busola. An example for a custom extension can be found [here](../examples/custom-extension/README.md).
- **EXTENSIBILITY_CUSTOM_COMPONENTS** - is used to indicate whether entirely custom extensions can be added to Busola. See [this example](../examples/custom-extension/README.md).


---

### 4. Deploy Your Extension
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 4. Deploy Your Extension
4. Deploy your extension.


### 4. Deploy Your Extension

Before running the deployment command, ensure that your **Kubeconfig** is correctly exported and points to the desired cluster. You can check the current context by running:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Before running the deployment command, ensure that your **Kubeconfig** is correctly exported and points to the desired cluster. You can check the current context by running:
Before running the deployment command, ensure that your `kubeconfig` is correctly exported and points to the desired cluster. You can check the current context by running:

examples/custom-extension/README.md Show resolved Hide resolved
kubectl kustomize . | kubectl apply -n kyma-system -f -
```

---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---


---

### 5. Test Your Changes Locally
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 5. Test Your Changes Locally
5. Test your changes locally.

@kyma-bot kyma-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm Looks good to me! size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 11, 2024
@kyma-bot kyma-bot added the lgtm Looks good to me! label Dec 11, 2024
@mrCherry97
Copy link
Contributor

/override tide

@kyma-bot
Copy link
Contributor

@mrCherry97: Overrode contexts on behalf of mrCherry97: tide

In response to this:

/override tide

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mrCherry97 mrCherry97 merged commit 463d5a9 into kyma-project:main Dec 12, 2024
16 checks passed
OliwiaGowor pushed a commit to OliwiaGowor/busola that referenced this pull request Dec 20, 2024
* feat: add proxyhandler to backend

* feat: adjust busola code to handle custom extensions

* feat: added example custom extension

* feat: rename folder

* feat: add docs

* feat: update docs

* feat: update docs

* feat: add more specific types

* feat: adjust to review comments

* adjust to comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. lgtm Looks good to me! size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom busola extensions
7 participants