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

fix: merged compose deploy to kube page in UI #4827

Merged
merged 3 commits into from Nov 23, 2023
Merged

Conversation

deboer-tim
Copy link
Collaborator

What does this PR do?

When used on a compose app, the Deploy to Kube form incorrectly shows the compose details at the bottom of the page. You can also see it in the breadcrumb that says 'Container > Compose Details' when it should say 'Container > Deploy to Kubernetes'.

The problem is the route path of these two pages can overlap:

  • /compose/deploy-to-kube/:composeGroupName/:engineId/*
  • /compose/:name/:engineId/* i.e. deploy to kube path also resolves to compose details page with name 'deploy-to-kube' and engineId of the compose group name.

Simple fix to just rename the path so they don't overlap.

Screenshot/screencast of this PR

Same as before, but with correct breadcrumb and no details page at the bottom!

What issues does this PR fix or reference?

Fixes #4723.

How to test this PR?

Create a compose app and use the Deploy to Kubernetes action on the Containers page.

When used on a compose app, the Deploy to Kube form incorrectly shows the
compose details at the bottom of the page. You can also see it in the breadcrumb
that says 'Container > Compose Details' when it should say 'Container > Deploy
to Kubernetes'.

The problem is the route path of these two pages can overlap:
 - /compose/deploy-to-kube/:composeGroupName/:engineId/*
 - /compose/:name/:engineId/*
i.e. deploy to kube path also resolves to compose details page with name
'deploy-to-kube' and engineId of the compose group name.

Simple fix to just rename the path so they don't overlap.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@deboer-tim deboer-tim requested review from benoitf and a team as code owners November 16, 2023 01:42
@deboer-tim deboer-tim requested review from dgolovin and removed request for a team November 16, 2023 01:42
@@ -132,7 +132,7 @@ window.events?.receive('display-troubleshooting', () => {
type="container" />
</Route>
<!-- Same DeployPodToKube route, but instead we pass in the compose group name, then redirect to DeployPodToKube -->
<Route path="/compose/deploy-to-kube/:composeGroupName/:engineId/*" breadcrumb="Deploy to Kubernetes" let:meta>
<Route path="/compose-deploy-to-kube/:composeGroupName/:engineId/*" breadcrumb="Deploy to Kubernetes" let:meta>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep the /compose namespace to all the compose routing and use other differentiators instead of having separate routes at the beginning
-> change routing scheme after /compose rather than at the root level

if we have common prefix we can route or use components for the routing (I think @feloy wanted to introduce routing scheme/helpers at some point) but if we break at the root level, it'll be harder to introduce Routing components per scope

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, second commit reverts the deploy-to-kube path and changes the details path instead. I just don't love this option because it makes the compose details different from image/volumes/pods/etc details instead, but we have to change one of them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we could change the route for image/volumes/pods/etc to be consistent 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

I liked the approach of @feloy to have helpers for the routes so we don't duplicate everywhere the route path

Copy link
Collaborator

Choose a reason for hiding this comment

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

I found the related PR #4371

Copy link
Contributor

Choose a reason for hiding this comment

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

I finally reverted it in this PR, as I didn't have enough perspective at this time. But it is visible in the first commit of the PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

100% agreed on the solution, but I don't think we should hold up a minor fix to solve the broader problem. I've opened #4966 to track solving this based on what was in #4371.

As suggested in the PR this changes the compose details path instead.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@benoitf
Copy link
Collaborator

benoitf commented Nov 16, 2023

is it missing details there:

let logsRouterPath = `/compose/${encodeURI(compose.name)}/${encodeURI(compose.engineId)}/logs`;
?

@benoitf
Copy link
Collaborator

benoitf commented Nov 20, 2023

@deboer-tim

ping about the last comment
isn't it missing a change there

let logsRouterPath = `/compose/${encodeURI(compose.name)}/${encodeURI(compose.engineId)}/logs`;
?

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@deboer-tim
Copy link
Collaborator Author

Sorry, was distracted by other PRs. Yes, I missed that reference. Added in new commit, and I did a scan again to confirm there are no further references.

Copy link
Contributor

@cdrage cdrage left a comment

Choose a reason for hiding this comment

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

LGTM!

Confirmed it no longer shows.

Screen.Recording.2023-11-21.at.3.57.08.PM.mov

@deboer-tim deboer-tim merged commit 6339a6f into main Nov 23, 2023
9 checks passed
@deboer-tim deboer-tim deleted the compose-to-kube branch November 23, 2023 14:42
@podman-desktop-bot podman-desktop-bot added this to the 1.6.0 milestone Nov 23, 2023
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.

Pressing "Deploy to Kubernetes" on a Compose example adds extra section to bottom
5 participants