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 HealthCheckProbeData type #9300

Merged
merged 1 commit into from Jun 22, 2021

Conversation

debsmita1
Copy link
Contributor

Fixes:
https://issues.redhat.com/browse/ODC-6037

Solution description:
Created types:

  • HealthCheckFormProbeData : which contains properties required to populate the Health checks form
  • HealthCheckProbeData : which contains properties required to update the k8s resource

GIF:
No UI changes

Unit Tests:
Update the unit tests

@openshift-ci openshift-ci bot added component/dev-console Related to dev-console component/knative Related to knative-plugin labels Jun 18, 2021
@debsmita1
Copy link
Contributor Author

/cc @andrewballantyne
/cc @jerolimov

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Looking good. It's a pity we don't have Deployment and Deployment Config defined more strictly so we can use your type within' 🤔

One change to do because we really need to be typing both ends of a utility (I think there are other utilities in your files that are not double-ended typed, but we can fix those each time we touch the area rather than make this PR a hunt-and-fix PR -- because that may not have an easy end).

@@ -41,26 +47,48 @@ export const getRequestType = (data: HealthCheckProbeData) => {
return '';
};

export const convertResourceDataToFormData = (resourceData: HealthCheckProbeData) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const convertResourceDataToFormData = (resourceData: HealthCheckProbeData) => {
export const convertResourceDataToFormData = (resourceData: HealthCheckProbeData): HealthCheckFormData => {

It's important, especially for the TypeScript help, that stand-alone utilities have an explicit return type. Super important when they are objects as there is a lot more ambiguity in the structure of the object.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2021
Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, debsmita1, vikram-raj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console component/knative Related to knative-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants