Skip to content

Conversation

@nitin-dhevar
Copy link
Contributor

No description provided.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 15, 2024

@nitin-dhevar: This pull request references CONSOLE-4074 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 15, 2024
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/pipelines Related to pipelines-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Jul 15, 2024
@nitin-dhevar
Copy link
Contributor Author

/hold

Depends on #14052

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 15, 2024
@nitin-dhevar
Copy link
Contributor Author

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jul 15, 2024
@nitin-dhevar
Copy link
Contributor Author

/assign @TheRealJon

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

Just a couple of tweaks

export const PullSecretUploadForm: React.FC<PullSecretUploadFormProps> = ({
onChange,
onDisable,
stringData,
Copy link
Member

Choose a reason for hiding this comment

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

Descriptive naming

Suggested change
stringData,
pullSecretData,

Comment on lines 12 to 14
const [configFile, setConfigFile] = React.useState<string>(
_.isEmpty(stringData) ? '' : JSON.stringify(stringData),
);
Copy link
Member

Choose a reason for hiding this comment

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

This is a controlled component, so we shouldn't need state:

Suggested change
const [configFile, setConfigFile] = React.useState<string>(
_.isEmpty(stringData) ? '' : JSON.stringify(stringData),
);
const configFile = React.useMemo<string>(() =>
pullSecretData ? JSON.stringify(pullSecretData) : '',
[pullSecretData],
);

Comment on lines 19 to 23
const parsedData = _.attempt(JSON.parse, fileData);
setConfigFile(fileData);
setParseError(_.isError(parsedData));
onChange(parsedData);
onDisable(_.isError(parsedData));
Copy link
Member

Choose a reason for hiding this comment

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

Prefer determinate try/catch rather than _.attempt:

Suggested change
const parsedData = _.attempt(JSON.parse, fileData);
setConfigFile(fileData);
setParseError(_.isError(parsedData));
onChange(parsedData);
onDisable(_.isError(parsedData));
try {
const newPullSecret = JSON.parse(fileData);
onChange(newPullSecret);
setParseError(false);
onDisable(false);
} catch (e) {
setParseError(true);
onDisable(true);
}

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nitin-dhevar
Once this PR has been reviewed and has the lgtm label, please ask for approval from therealjon. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 17, 2024
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 31, 2024

@nitin-dhevar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/backend a8c5e01 link true /test backend
ci/prow/analyze a8c5e01 link true /test analyze
ci/prow/frontend a8c5e01 link true /test frontend
ci/prow/images a8c5e01 link true /test images
ci/prow/e2e-gcp-console a8c5e01 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality component/pipelines Related to pipelines-plugin do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants