-
Notifications
You must be signed in to change notification settings - Fork 172
Disable remote execution tab if deployment is playground only #2695
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
Conversation
Pull Request Test Coverage Report for Build 7725779172
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for working on this. However, I don't think this is the correct approach.
I feel it makes more sense to just remove it entirely from the public, backendless deployment. Since remote execution involves the backend, I don't think it should be toggleable via an environment variable in the first place.
@chownces can I get your thoughts on this?
On a slightly related note, there's a login state check in the remote execution tab:
frontend/src/commons/sideContent/remoteExecution/SideContentRemoteExecution.tsx
Lines 137 to 143 in 199354c
if (!isLoggedIn) { | |
return ( | |
<Callout intent="danger"> | |
Please <NavLink to="/login">log in</NavLink> to execute on a remote device. | |
</Callout> | |
); | |
} |
In my view, this is a form of coupling as the component needs to be aware of the hardcoded /login
route (which was the cause of the issue in the first place – since there's no such route in the public deployment).
Some refactoring would be needed to improve the separation of concerns between these two. Perhaps the login check can be done in the playground instead. I don't think a guard clause works well in the context of this component, but I'm also open to discussing more about this. What are your thoughts?
In that case, do you think it is more appropriate to just check the As far as I know, playground is only available after login in a backend-enabled deployment, otherwise it will redirect to the login page automatically. If your concern is that the login check for the remote execution will no longer be applicable anymore due to the checks aforementioned, I can proceed to remove it as well. |
Hey I agree on this, we shouldn't be using more and more variables when infact, the presence of this tab is solely dependent on the type of FE we are deploying (e.g. Playground-Only, SA with BE). Another note, Perhaps, we should refactor the Constants.ts file too and clean up the naming. Nesting the constants object would also make it clearer which constants deal with which things (e.g. feature toggles, URLs, FE configuration type, workspace defaults, etc.) |
Alright, I have updated the check to use the
This could be a good idea for another issue/PR, but I think is out of the scope for this PR. We will definitely still need to confirm on list of names to use, and work out the details of the refactor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks; I'll wait for @chownces to give his review.
Do you think we need to remove the "please log in to execute on a remote device" banner? Since it won't be shown anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will wait for the refactor in another PR.
…-academy#2695) * Add env flag to allow disabling remote execution * Revert "Add env flag to allow disabling remote execution" This reverts commit 2da79be. * Hide remote execution tab if deployment is playground only --------- Co-authored-by: Richard Dominick <34370238+RichDom2185@users.noreply.github.com>
Description
Resolves #2224,
allow disabling of the remote execution tab in playground configurable through the env file, under the newly added boolean valueREACT_APP_ENABLE_REMOTE_EXECUTION
.The default value configured isFALSE
(in the .env.example file)The remote execution tab will only show when the
REACT_APP_PLAYGROUND_ONLY
is set to false (i.e. deployment with a backend), instead of the current behavior where it shows regardless of the deployment type.Type of change
How to test
Pull and run the changes locally, and by default the remote execution tab should not be accessible anymore in the playground.
Code is tested working on latest version of Chrome 123.
Checklist