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

Create route functionality added #4140

Conversation

msivasubramaniaan
Copy link
Collaborator

@msivasubramaniaan msivasubramaniaan commented May 19, 2024

create-route

Fixes: #4086

@msivasubramaniaan msivasubramaniaan marked this pull request as ready for review May 22, 2024 08:24
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

Attention: Patch coverage is 24.60317% with 95 lines in your changes are missing coverage. Please review.

Project coverage is 44.20%. Comparing base (da60441) to head (73e3c0a).
Report is 248 commits behind head on main.

Files Patch % Lines
src/webview/create-route/createRouteViewLoader.ts 13.09% 73 Missing ⚠️
src/oc/ocWrapper.ts 46.15% 7 Missing ⚠️
src/explorer.ts 14.28% 6 Missing ⚠️
src/webview/common-ext/utils.ts 50.00% 6 Missing ⚠️
src/openshift/nameValidator.ts 66.66% 1 Missing ⚠️
src/openshift/route.ts 80.00% 1 Missing ⚠️
src/openshift/serviceHelpers.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4140       +/-   ##
===========================================
+ Coverage   32.37%   44.20%   +11.82%     
===========================================
  Files          85       90        +5     
  Lines        6505     7237      +732     
  Branches     1349     1526      +177     
===========================================
+ Hits         2106     3199     +1093     
+ Misses       4399     4038      -361     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vrubezhny
Copy link
Contributor

vrubezhny commented May 22, 2024

@msivasubramaniaan Could you please rebase the PR on top of the main branch?

@msivasubramaniaan
Copy link
Collaborator Author

@msivasubramaniaan Could you please rebase the PR on top of the main branch?

@vrubezhny I have done it already. Seems there were no more commits on main branch

@vrubezhny
Copy link
Contributor

vrubezhny commented May 22, 2024

An annoying effect occurs on the Create route view when typing in something to the text fields... When trying to type in something into the middle of the existing text after every character is added it moves the text cursor to the end of the string, so you have to manually move the cursor back to the required position before typing in the next character:

Screencast.from.2024-05-22.13-51-18.webm

... I haven't spotted this on any other view we have.

@vrubezhny
Copy link
Contributor

vrubezhny commented May 22, 2024

When I'm trying to create a route on Kind cluster it fails (probably with some reason, but I have created a similar route on Sandbox cluster with no any problem) :

Screenshot from 2024-05-22 13-54-26

After that I cannot create any other route until I close the Create Route view. Can we reset the Create Route view to the initial state (to make it showing the create route form) when <project> -> Create... -> Create Route context menu is invoked while the view is already opened and is showing an error like this?

@vrubezhny
Copy link
Contributor

@msivasubramaniaan Could you please rebase the PR on top of the main branch?

@vrubezhny I have done it already. Seems there were no more commits on main branch

I don't think it's true, neither GH thinks it is:

image

@msivasubramaniaan
Copy link
Collaborator Author

msivasubramaniaan commented May 22, 2024

@msivasubramaniaan Could you please rebase the PR on top of the main branch?

@vrubezhny I have done it already. Seems there were no more commits on main branch

I don't think it's true, neither GH thinks it is:

image

@vrubezhny FYR
image

@vrubezhny
Copy link
Contributor

vrubezhny commented May 22, 2024

@msivasubramaniaan Could you please rebase the PR on top of the main branch?

@vrubezhny I have done it already. Seems there were no more commits on main branch

I don't think it's true, neither GH thinks it is:

@vrubezhny FYR

Hm. Interesting... 🤔

GH still shows me "This branch cannot be rebased due to conflicts" and I really had to rebase (locally) due to a conflict in "imports" part of src/explorer.ts ...

Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

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

Just some extra lines to be removed here. Plus a few questions I asked in the main thread (field editing question, error on Kind cluster and recovery after a route creation error)

src/webview/common/createServiceTypes.ts Show resolved Hide resolved
src/webview/common/createServiceTypes.ts Outdated Show resolved Hide resolved
@msivasubramaniaan
Copy link
Collaborator Author

@vrubezhny

I've addressed all mentioned review comments. please have a look

@vrubezhny
Copy link
Contributor

@msivasubramaniaan It still shows me that your branch is not rebased on top of the main branch and has a merge conflict in src/explorer.ts when trying to rebase. Could you please check?

@vrubezhny
Copy link
Contributor

@msivasubramaniaan Now for Sandbox cluster I have:

image

IMHO, the validator for Path field of Create Route view is to be fixed acordingly (The Route "mr" is invalid: spec.path: Invalid value: "mr": path must begin with /)

@vrubezhny
Copy link
Contributor

vrubezhny commented May 22, 2024

image

The 'Routes' App. Explorer tree item as well as Create... -> Create Route are Openshift specific, so these items/menu are to be shown only for Openshift clusters.

Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

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

@msivasubramaniaan As routes is an Openshift specific objects - we should show it as well as Create Route context menu item only when working with an Openshift cluster

src/explorer.ts Show resolved Hide resolved
src/explorer.ts Outdated Show resolved Hide resolved
@datho7561
Copy link
Contributor

If you are trying to expose a Deployment using a Route, you first need to create a Service for the Deployment.

I had to do this from the command line (oc expose deployment/my-deployment-name --port 8080).

It might be nice to incorporate creating the service if it doesn't already exist as a step in the route creation process. For instance, the user selects the deployment instead of the service, then when they submit the form, the extension checks if there is an existing service connect to the deployment and creates it if there isn't one, then it exposes the service.

@msivasubramaniaan
Copy link
Collaborator Author

If you are trying to expose a Deployment using a Route, you first need to create a Service for the Deployment.

I had to do this from the command line (oc expose deployment/my-deployment-name --port 8080).

It might be nice to incorporate creating the service if it doesn't already exist as a step in the route creation process. For instance, the user selects the deployment instead of the service, then when they submit the form, the extension checks if there is an existing service connect to the deployment and creates it if there isn't one, then it exposes the service.

@datho7561 I will take this as improvement and create a separate ticket and work on it

Copy link
Contributor

@vrubezhny vrubezhny 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 to me. Thanks!

@msivasubramaniaan Don't forget to open a separate issue for creating the service if it doesn't already exist as a step in the route creation process - I agree in that it would be a useful addition.

@datho7561
Copy link
Contributor

I am okay with handling creating a service for a deployment in a separate issue.

We should squash the commits before merging, this means you will need to do a rebase on main @msivasubramaniaan .

@vrubezhny vrubezhny merged commit d7db511 into redhat-developer:main May 27, 2024
3 of 4 checks passed
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.

Create an web view for supporting to create routes from the extension
4 participants