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(fab): add new mountpoints support for providers and listeners #2199

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

debsmita1
Copy link
Member

@debsmita1 debsmita1 commented Jan 16, 2025

Description:

https://issues.redhat.com/browse/RHIDP-5478
https://issues.redhat.com/browse/RHIDP-5399

How to test changes / Special notes to the reviewer:

Testing in your local

  • In your local rhdh repo, add the following snippet in your app-config.yaml file
dynamicPlugins:
  rootDirectory: dynamic-plugins-root
  frontend:
    red-hat-developer-hub.backstage-plugin-bulk-import:
      mountPoints:
         - mountPoint: global.floatingactionbutton/component
          importName: BulkImportPage
          config:
            slot: 'page-end'
            icon: bulkImportIcon
            label: 'Bulk import'
            toolTip: 'Register multiple repositories in bulk'
            to: /bulk-import/repositories
            excludeOnPaths: ['/catalog']
      appIcons:
        - name: bulkImportIcon
          importName: BulkImportIcon
      dynamicRoutes:
        - path: /bulk-import/repositories
          importName: BulkImportPage
          menuItem:
            icon: bulkImportIcon
            text: Bulk import
    red-hat-developer-hub.backstage-plugin-global-floating-action-button:
      mountPoints:
        - mountPoint: application/listener
          importName: DynamicGlobalFloatingActionButton
        - mountPoint: global.floatingactionbutton/component
          importName: NullComponent
          config:
            icon: github
            label: 'Git'
            toolTip: 'Github'
            to: https://github.com/redhat-developer/rhdh
  • In your local rhdh repo, run yarn install followed by yarn dev

Testing on a cluster

dynamic-plugins.yaml: |
    includes:
    - dynamic-plugins.default.yaml
    plugins:
      - package: '@red-hat-developer-hub/[email protected]'
        integrity: 'sha512-4k/D6YjVfLX8jiCOlZJ+CG0hcE55hk2UxyKO/SwsRWc+qjwuny1A+MO0vz+KgKcwkFvg1tw7kkPCjV8w1k4lUg=='
        pluginConfig:
          dynamicPlugins:
            frontend:
              red-hat-developer-hub.backstage-plugin-application-provider-test:
                dynamicRoutes:
                  - path: /countpage
                    importName: CountPage
                mountPoints:
                  - mountPoint: application/provider
                    importName: CountProvider
      - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
        disabled: false
        pluginConfig:
          dynamicPlugins:
            frontend:
              red-hat-developer-hub.backstage-plugin-bulk-import:
                mountPoints:
                  - mountPoint: global.floatingactionbutton/component
                    importName: BulkImportPage
                    config:
                      slot: 'page-end'
                      icon: bulkImportIcon
                      label: 'Bulk import'
                      toolTip: 'Register multiple repositories in bulk'
                      to: /bulk-import/repositories
                      excludeOnPaths: ['/catalog']
                appIcons:
                  - name: bulkImportIcon
                    importName: BulkImportIcon
                dynamicRoutes:
                  - path: /bulk-import/repositories
                    importName: BulkImportPage
                    menuItem:
                      icon: bulkImportIcon
                      text: Bulk import
      - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-floating-action-button
        disabled: false
        pluginConfig:
          dynamicPlugins:
            frontend:
              red-hat-developer-hub.backstage-plugin-global-floating-action-button:
                mountPoints:
                  - mountPoint: application/listener
                    importName: DynamicGlobalFloatingActionButton
                  - mountPoint: global.floatingactionbutton/component
                    importName: NullComponent
                    config:
                      icon: github
                      label: 'Git'
                      toolTip: 'Github'
                      to: https://github.com/redhat-developer/rhdh

Screenshot/GIF

Screenshot 2025-01-30 at 4 52 26 PM Screenshot 2025-01-30 at 4 54 29 PM Screenshot 2025-01-30 at 4 54 12 PM
Screen.Recording.2025-01-30.at.4.34.46.PM.mov

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

Copy link

openshift-ci bot commented Jan 16, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from debsmita1. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@debsmita1 debsmita1 requested review from ciiay and removed request for dzemanov and its-mitesh-kumar January 16, 2025 19:15
Copy link
Contributor

@ciiay ciiay left a comment

Choose a reason for hiding this comment

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

Looks good!
Tested locally and it seems that it works functionally, only with a few UI issues. Check out the screen recording:

pr_2199_review.mp4

dynamic-plugins.default.yaml Outdated Show resolved Hide resolved
Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Hi, I know it's WIP. The first version looks good!
Two suggestion I have: I think we should move the integration part into AppBase and create new components for Listener and Provider.

And then I think this PR should also include some new documentation in https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/frontend-plugin-wiring.md

Similar to #2168: I I think a good spot would be after "Customizing and Adding Entity tabs" (before "Provide additional Utility APIs"). Merge conflicts, here we go. I'm fine if you want do that in a 2nd PR, but IMO it should be part of that story. :)

packages/app/src/components/DynamicRoot/DynamicRoot.tsx Outdated Show resolved Hide resolved
packages/app/src/components/Root/Root.tsx Outdated Show resolved Hide resolved
packages/app/src/components/Root/Root.tsx Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
Copy link
Contributor

@debsmita1 debsmita1 changed the title [WIP] feat(fab): add new mountpoints to support provider [WIP] feat(fab): add new mountpoints support for providers and listeners Jan 28, 2025
Copy link
Contributor

Copy link
Contributor

@debsmita1 debsmita1 changed the title [WIP] feat(fab): add new mountpoints support for providers and listeners feat(fab): add new mountpoints support for providers and listeners Jan 30, 2025
Copy link
Contributor

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Hi, great so far, but I have added some comments to simplify the documentation.

It looks to me that the Provider and Listener are currently the same thing, just somewhere else.

What would help for both (esp. for the provider to see the issue) is that you add some unit tests for both.

app-config.dynamic-plugins.yaml Outdated Show resolved Hide resolved
docs/dynamic-plugins/frontend-plugin-wiring.md Outdated Show resolved Hide resolved
docs/dynamic-plugins/frontend-plugin-wiring.md Outdated Show resolved Hide resolved
docs/dynamic-plugins/frontend-plugin-wiring.md Outdated Show resolved Hide resolved
docs/dynamic-plugins/frontend-plugin-wiring.md Outdated Show resolved Hide resolved
docs/dynamic-plugins/frontend-plugin-wiring.md Outdated Show resolved Hide resolved
docs/dynamic-plugins/frontend-plugin-wiring.md Outdated Show resolved Hide resolved
}
}

Choose a reason for hiding this comment

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

Intention could be improved

packages/app/src/components/Root/ApplicationProvider.tsx Outdated Show resolved Hide resolved
docker/Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

Copy link

openshift-ci bot commented Jan 31, 2025

@debsmita1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/periodic-e2e-tests-gke-helm-nightly e7a41b7 link false /test periodic-e2e-tests-gke-helm-nightly

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants