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(dynamic-plugins): make mountpoints and layout declarative #700

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

tumido
Copy link
Member

@tumido tumido commented Nov 1, 2023

Use dynamic frontend plugins across the app:

  1. Dynamic routes support home / override. You can define additional routes via dynamicPlugins.frontend.dynamicRoutes - these can't already exists in the app with 1 exception - /. This allows you to override the home page with your own plugin/component.

  2. This change makes dynamicPlugins.frontend.mountPoints generic and declarative:

    Mountpoint now support following names/types:

    • Allow passing */context mountpoints for React context
    • Allow passing */cards for Card components (with layout)

    Mountpoint configs:

    • entity.page.overview
    • entity.page.topology
    • entity.page.issues
    • entity.page.pull-requests
    • entity.page.ci
    • entity.page.cd
    • entity.page.kubernetes
    • entity.page.tekton
    • entity.page.image-registry
    • entity.page.monitoring
    • entity.page.lighthouse
    • entity.page.api
    • entity.page.dependencies
    • entity.page.docs
    • entity.page.definition
    • entity.page.diagram

    Mountpoints support following configuration:

    • layout for layout features that propagates to allowing users to use CSS properties gridColumnStart including responsiveness queries etc. (mui.com/system/ getting-started/the-sx-prop)
    • if for EntitySwitch.Case if=... - allows allOf|anyOf|oneOf conditionals with isKind|isType|hasAnnotation builtin methods or code imports via Scalprum (direct string reference)
    • props to pass additional props to the mounted component

    Current limitations of the dynamic frontend plugins:

    Allows you to mount to existing mountPoints only. You're unable to create additional tabs for example. (will be addressed in a follow up PR)

Kapture.2023-11-03.at.11.33.51.mp4

Known issues:

If a frontend package requires config schema providing visibility: frontend annotations, it will fail, since we currently have no means of aggregating it. This renders plugins like Lighthouse unusable at the moment.

Which issue(s) does this PR fix

Part of #442
Requires: #699 #683

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

How to test changes / Special notes to the reviewer

Copy link

changeset-bot bot commented Nov 1, 2023

🦋 Changeset detected

Latest commit: b2ebfb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
app Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 1, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

@tumido tumido force-pushed the declarative-mountpoints branch 5 times, most recently from 0be8d5b to 0727d76 Compare November 2, 2023 13:59
Copy link

sonarcloud bot commented Nov 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
8.1% 8.1% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@tumido tumido marked this pull request as ready for review November 2, 2023 14:04
@tumido tumido requested a review from a team as a code owner November 2, 2023 14:04
@tumido tumido changed the title [WIP] feat(dynamic-plugins): make mountpoints and layout declarative feat(dynamic-plugins): make mountpoints and layout declarative Nov 2, 2023
@tumido tumido force-pushed the declarative-mountpoints branch 2 times, most recently from e2117db to 6450e7f Compare November 2, 2023 14:19
Copy link
Contributor

github-actions bot commented Nov 2, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

@tumido tumido force-pushed the declarative-mountpoints branch 2 times, most recently from 6415844 to d7296cc Compare November 2, 2023 17:05
Copy link
Contributor

github-actions bot commented Nov 2, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link
Contributor

github-actions bot commented Nov 3, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

@tumido tumido force-pushed the declarative-mountpoints branch 2 times, most recently from c9d5bae to 84daf57 Compare November 3, 2023 10:26
Copy link
Contributor

github-actions bot commented Nov 3, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link
Contributor

github-actions bot commented Nov 3, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link

janus-idp bot commented Nov 3, 2023

backstage-showcase Tests on commit 7920fe4 finished with errors.
View test log

Copy link
Contributor

github-actions bot commented Nov 3, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link
Contributor

github-actions bot commented Nov 3, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link
Contributor

github-actions bot commented Nov 6, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

@tumido tumido force-pushed the declarative-mountpoints branch 2 times, most recently from d28944a to cc57002 Compare November 6, 2023 13:04
Copy link
Contributor

github-actions bot commented Nov 6, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Signed-off-by: Tomas Coufal <tcoufal@redhat.com>
Copy link
Contributor

github-actions bot commented Nov 6, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Signed-off-by: Tomas Coufal <tcoufal@redhat.com>
… file

Signed-off-by: Tomas Coufal <tcoufal@redhat.com>
Copy link
Member

@davidfestal davidfestal left a comment

Choose a reason for hiding this comment

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

Still testing this with the Helm chart, and having errors.

Copy link
Contributor

github-actions bot commented Nov 6, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link

sonarcloud bot commented Nov 6, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
4.8% 4.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Contributor

github-actions bot commented Nov 6, 2023

The image is available at: quay.io/janus-idp/backstage-showcase:pr-700!

Copy link
Member

@schultzp2020 schultzp2020 left a comment

Choose a reason for hiding this comment

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

LGTM

@tumido tumido merged commit 8dd742b into janus-idp:main Nov 6, 2023
6 of 8 checks passed
@tumido tumido deleted the declarative-mountpoints branch November 6, 2023 21:27
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.

None yet

6 participants