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

ENG-2964 GetEnvironment RTKQuery #1343

Merged
merged 8 commits into from
May 22, 2023

Conversation

agiron123
Copy link
Contributor

@agiron123 agiron123 commented May 18, 2023

Describe your changes and why you are making these changes

This PR moves the getEnvironment API call from the kubernetes dialog and the menusidebar to use RTKQuery.

Also moves the getEnvironment route to the new v2 routes.

Related issue number (if any)

ENG-2964

Loom demo (if any)

Checklist before requesting a review

  • I have created a descriptive PR title. The PR title should complete the sentence "This PR...".
  • I have performed a self-review of my code.
  • I have included a small demo of the changes. For the UI, this would be a screenshot or a Loom video.
  • If this is a new feature, I have added unit tests and integration tests.
  • I have run the integration tests locally and they are passing.
  • I have run the linter script locally (See python3 scripts/run_linters.py -h for usage).
  • All features on the UI continue to work correctly.
  • Added one of the following CI labels:
    • run_integration_test: Runs integration tests
    • skip_integration_test: Skips integration tests (Should be used when changes are ONLY documentation/UI)

@agiron123 agiron123 requested a review from likawind May 18, 2023 23:29
@agiron123 agiron123 changed the title WIP: ENG-2964 GetEnvironment RTKQuery ENG-2964 GetEnvironment RTKQuery May 19, 2023
@agiron123 agiron123 marked this pull request as ready for review May 19, 2023 21:49
@agiron123 agiron123 added the skip_integration_test Skips required integration test (only documentation/UI changes) label May 19, 2023
src/golang/cmd/server/routes/routes.go Outdated Show resolved Hide resolved
@@ -73,6 +74,5 @@ const (
GetWorkflowDagResultRoute = "/api/workflow/{workflowId}/result/{workflowDagResultId}"
GetWorkflowHistoryRoute = "/api/workflow/{workflowId}/history"

GetServerVersionRoute = "/api/version"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is any SDK code still using this route? To be safe, we could keep these routes and map them to the same handler (similar to workflow trigger / delete / edit routes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the version route does have a usage. I will keep this one in place.

@@ -123,22 +123,19 @@ const MenuSidebar: React.FC<{
const [versionNumber, setVersionNumber] = useState('');
const location = useLocation();

const { data } = useEnvironmentGetQuery({ apiKey: user.apiKey } as any, {
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to cast to any and you probably don't need the skip here, as the user is passed by caller

const versionNumberResponse = await res.json();
setVersionNumber(versionNumberResponse.version);
if (data) {
setVersionNumber(data.version);
Copy link
Contributor

Choose a reason for hiding this comment

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

will the user or other things set the version number? Otherwise we can just do const versionNumber = data?.version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, I will remove this useEffect and state variable.
Vestiges here from the infinite loop that I was facing with the Kubernetes dialog :)

@agiron123 agiron123 merged commit 984e26c into main May 22, 2023
@agiron123 agiron123 deleted the eng-2964-move-k8s-use_same_cluster-request-to branch May 22, 2023 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip_integration_test Skips required integration test (only documentation/UI changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants