Skip to content

Conversation

@anwesha-palit-redhat
Copy link
Contributor

@anwesha-palit-redhat anwesha-palit-redhat commented Nov 14, 2025

Problem

When a user encounters a submit error (e.g., invalid YAML or API failure) in the Pipeline Builder's YAML editor, the error persists even after editing the YAML content. This keeps the submit button disabled and the error message visible until the user switches between Form and YAML views.

Solution

Added handleOnChange callback in CodeEditorField.tsx that resets status.submitError whenever the YAML content changes. This provides immediate feedback and re-enables the submit button when users correct their YAML after an error.

Changes

  • Modified CodeEditorField.tsx:
    • Extracted setStatus from Formik context
    • Created handleOnChange callback that clears submitError when YAML is edited
    • Replaced inline onChange handler with the new callback

Testing

Verify that:

  1. Submit with invalid YAML → error appears and button is disabled
  2. Edit YAML → error clears immediately and button re-enables (if validation passes)
  3. Submit with API error → error appears and button is disabled
  4. Edit YAML → error clears immediately

Screen recording before fix

Issue_while_creating_YAML.mov

Screen recording after fix

after_fix_validation_issue.mov

AI assisted unit tests: Claude 4.5

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Nov 14, 2025

@anwesha-palit-redhat: This pull request references SRVKP-9338 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 bug to target the "4.21.0" version, but no target version was set.

In response to this:

Problem

When a user encounters a submit error (e.g., invalid YAML or API failure) in the Pipeline Builder's YAML editor, the error persists even after editing the YAML content. This keeps the submit button disabled and the error message visible until the user switches between Form and YAML views.

Solution

Added handleOnChange callback in CodeEditorField.tsx that resets status.submitError whenever the YAML content changes. This provides immediate feedback and re-enables the submit button when users correct their YAML after an error.

Changes

  • Modified CodeEditorField.tsx:
  • Extracted setStatus from Formik context
  • Created handleOnChange callback that clears submitError when YAML is edited
  • Replaced inline onChange handler with the new callback

Testing

Verify that:

  1. Submit with invalid YAML → error appears and button is disabled
  2. Edit YAML → error clears immediately and button re-enables (if validation passes)
  3. Submit with API error → error appears and button is disabled
  4. Edit YAML → error clears immediately

Screen recording before fix

Issue_while_creating_YAML.mov

Screen recording after fix

after_fix_validation_issue.mov

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.

@anwesha-palit-redhat
Copy link
Contributor Author

/cherrypick release-v1.21.x

@openshift-cherrypick-robot

@anwesha-palit-redhat: once the present PR merges, I will cherry-pick it on top of release-v1.21.x in a new PR and assign it to you.

In response to this:

/cherrypick release-v1.21.x

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-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Nov 14, 2025

@anwesha-palit-redhat: This pull request references SRVKP-9338 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 bug to target the "4.21.0" version, but no target version was set.

In response to this:

Problem

When a user encounters a submit error (e.g., invalid YAML or API failure) in the Pipeline Builder's YAML editor, the error persists even after editing the YAML content. This keeps the submit button disabled and the error message visible until the user switches between Form and YAML views.

Solution

Added handleOnChange callback in CodeEditorField.tsx that resets status.submitError whenever the YAML content changes. This provides immediate feedback and re-enables the submit button when users correct their YAML after an error.

Changes

  • Modified CodeEditorField.tsx:
  • Extracted setStatus from Formik context
  • Created handleOnChange callback that clears submitError when YAML is edited
  • Replaced inline onChange handler with the new callback

Testing

Verify that:

  1. Submit with invalid YAML → error appears and button is disabled
  2. Edit YAML → error clears immediately and button re-enables (if validation passes)
  3. Submit with API error → error appears and button is disabled
  4. Edit YAML → error clears immediately

Screen recording before fix

Issue_while_creating_YAML.mov

Screen recording after fix

after_fix_validation_issue.mov

AI assisted unit tests: Claude 4.5

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.

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
Copy link
Contributor

openshift-ci bot commented Nov 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anwesha-palit-redhat, 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

@vikram-raj
Copy link
Member

/retest

1 similar comment
@anwesha-palit-redhat
Copy link
Contributor Author

/retest

@anwesha-palit-redhat
Copy link
Contributor Author

/retest-required

@anwesha-palit-redhat
Copy link
Contributor Author

/retest-required

@anwesha-palit-redhat
Copy link
Contributor Author

/cherrypick release-v1.20.x

@openshift-cherrypick-robot

@anwesha-palit-redhat: once the present PR merges, I will cherry-pick it on top of release-v1.20.x in a new PR and assign it to you.

In response to this:

/cherrypick release-v1.20.x

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.

@anwesha-palit-redhat
Copy link
Contributor Author

/cherrypick release-v1.19.x

@openshift-cherrypick-robot

@anwesha-palit-redhat: once the present PR merges, I will cherry-pick it on top of release-v1.19.x in a new PR and assign it to you.

In response to this:

/cherrypick release-v1.19.x

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.

@anwesha-palit-redhat
Copy link
Contributor Author

/cherrypick release-v1.21.x

@openshift-cherrypick-robot

@anwesha-palit-redhat: once the present PR merges, I will cherry-pick it on top of release-v1.21.x in a new PR and assign it to you.

In response to this:

/cherrypick release-v1.21.x

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.

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 label Nov 20, 2025
@vikram-raj vikram-raj merged commit 89018d7 into openshift-pipelines:main Nov 20, 2025
4 of 7 checks passed
@openshift-cherrypick-robot

@anwesha-palit-redhat: new pull request created: #808

In response to this:

/cherrypick release-v1.21.x

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-cherrypick-robot

@anwesha-palit-redhat: new pull request created: #809

In response to this:

/cherrypick release-v1.20.x

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-cherrypick-robot

@anwesha-palit-redhat: new pull request created: #810

In response to this:

/cherrypick release-v1.19.x

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants