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

[JENKINS-68616] Enable field validation checks #316

Merged
merged 2 commits into from May 26, 2022

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented May 26, 2022

[JENKINS-68616] Enable field validation checks

Regression in 1105 release. The div that was added to surround the select seems to prevent calls to the attrs.checkMethod.

When using a GitHub branch source, an empty credentials field no longer displays the warning that a credential is recommended. Other uses of credentials seem to have the same behavior. Validation checks are no longer called.

When the div is included in the page, the credential validation callback is not invoked. When the div is removed from the page, the credential validation callback is invoked.

It is unclear to me why the addition of a div would change the validation behavior.

Review the differences with white space changes suppressed so that it is clear the difference is only in the deletion of the div tags that wrapped the select.

Not sure how to create a viable test that confirms the fix is behaving correctly.

Revert one HTML div from "Minor improvements"

This reverts part of commit 6dee9b8.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Regression in 1105 release.  The `div` that was added to surround the
`select` seems to prevent calls to the `attrs.checkMethod`.

When using a GitHub branch source, an empty credentials field no longer
displays the warning that a credential is recommended.  Other uses of
credentials seem to have the same behavior.  Validation checks are no
longer called.

When the `div` is included in the page, the credential validation callback
is not invoked. When the `div` is removed from the page, the credential
validation callback is invoked.

It is unclear to me why the addition of a `div` would change the
validation behavior.

Review the differences with white space changes suppressed so that it
is clear the difference is only in the deletion of the `div` tags that
wrapped the `select`.

Revert one HTML `div` from "Minor improvements"

This reverts part of commit 6dee9b8.
@MarkEWaite
Copy link
Contributor Author

@jglick and @basil in case you are interested.

@jglick
Copy link
Member

jglick commented May 26, 2022

#287 for the record

@jglick jglick added the bug label May 26, 2022
@jglick jglick requested a review from timja May 26, 2022 16:34
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Fine if it works.

@@ -107,11 +107,11 @@
<input type="hidden" name="includeUser" value="${includeUser}"/>
</j:otherwise>
</j:choose>
<div class="form-group jenkins-form-item jenkins-form-item--tight">
<f:select clazz="${attrs.clazz} credentials-select" field="${attrs.field}"
Copy link
Member

Choose a reason for hiding this comment

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

Hide whitespace to review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hide whitespace to review

Agreed. Much clearer with white space diffs suppressed.

@jglick
Copy link
Member

jglick commented May 26, 2022

(I have merge/release permissions but would prefer to get an opinion from @timja as author of #287, since I know little about this subject.)

@MarkEWaite
Copy link
Contributor Author

(I have merge/release permissions but would prefer to get an opinion from @timja as author of #287, since I know little about this subject.)

I agree that we should let this wait until @timja has had time to reply. The missing validation is unfriendly for the user but does not break functionality as far as I know.

@timja
Copy link
Member

timja commented May 26, 2022

Looking

@jglick
Copy link
Member

jglick commented May 26, 2022

All Greek to me. @MarkEWaite if you can confirm the last edit preserves the bug fix and general appearance, I can get a release cut.

@MarkEWaite
Copy link
Contributor Author

All Greek to me. @MarkEWaite if you can confirm the last edit preserves the bug fix and general appearance, I can get a release cut.

Confirmed that the fix the most recent change preserves the bug fix and the general appearance.

Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

I support the merge and release of this fix, but I would prefer it if the Jira ticket be updated with an evaluation of the cause of the problem. This project does not have much of a culture of writing root cause analysis in bugs, so this is an optional comment, but I believe that preserving a clear and written analysis of the cause of the problem, including a description of how the new code addresses the problem (beyond just "fix spacing") would benefit everyone involved. This is optional, just for your consideration.

@jglick jglick merged commit ef26f5d into jenkinsci:master May 26, 2022
@MarkEWaite MarkEWaite deleted the restore-credential-validation branch May 26, 2022 22:24
@timja
Copy link
Member

timja commented May 27, 2022

@MarkEWaite fix re-introduced the UI bug of elements touching each other.
Fix spacing, fixed the spacing so they weren’t touching.

I didn’t attempt to track down a root cause, likely due to some tree building in hudson-behaviour.js which one of the classes was affecting.

@basil
Copy link
Member

basil commented May 27, 2022

I understand, so Mark's change fixed one bug and created another, and commit 853ce58 fixed the newly-created bug. What still isn't clear to me, though, is whether the original hunk reverted by Mark in this PR was a logically valid usage of the core API (in which case the core implementation of that API is to blame and this PR is a workaround for an as-yet-unfiled core bug) or the original hunk reverted by Mark was an invalid usage of the core API (in which case the original hunk was incorrect and Mark's fix in this PR is a valid long-term solution). It is only this kind of rigorous analysis and follow-up that will prevent us from constantly playing whack-a-mole with these bugs.

@timja
Copy link
Member

timja commented May 27, 2022

I’m unsure @janfaracik may know

@basil
Copy link
Member

basil commented May 28, 2022

There is nothing wrong with being unsure when starting out, but the goal should be to become sure through analytical reasoning, regardless of whether or not one was the original author of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants