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-72170] fix nested hetero-list entries with mixture of inputs and buttons #8602

Merged
merged 2 commits into from
Oct 14, 2023

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Oct 12, 2023

when a plugin defines the hetero-list elements on its own and still uses an <input type="button"> element and an inner element is already using a hetero-list with a <button> element, then the old input wasn't converted to a button as the inner button was selected as the target. Avoid this by converting all inputs to buttons before actually looking up the button.

See JENKINS-72170.

Testing done

Manually tested as described in JENKINS-72170 that the button is working properly with this fix

Proposed changelog entries

  • Fix multibranch Pipeline "Add source" and other uses that mix inputs and buttons (regression in 2.422).

Proposed upgrade guidelines

N/A

Submitter checklist

Preview Give feedback

Desired reviewers

N/A

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

when a plugin defines the hetero-list elements on its own and still uses
an <input type="button"> element and an inner element is already using
a hetero-list with a <button> element, then the old input wasn't
converted to a button as the inner button was found first.
Avoid this by converting all inputs to buttons before actually looking
up the button.

Recreate the hetero-list.js file to avoid the "No such adjunct found"
warning message
@basil
Copy link
Member

basil commented Oct 12, 2023

The PR description does not address whether or not it is desired for plugins to include the hetero-list adjunct. If it is not desired, then the warning is justified and the plugins should be migrated.

@mawinter69
Copy link
Contributor Author

mawinter69 commented Oct 12, 2023

the file is not needed anymore and plugins can just remove the inclusion of the adjunct once they require Jenkins 2.422 or newer
So removing it again

@basil basil added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Oct 12, 2023
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.

Thank you for the quick fix and the thorough testing.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks very much for the rapid response to the issue. I tested with a local build and confirmed that the case I had tested for JENKINS-72170 is resolved.

@MarkEWaite
Copy link
Contributor

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

/label ready-for-merge

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 12, 2023
@@ -21,6 +21,23 @@ function generateHandles() {
});
}

function convertInputsToButtons(e) {
Copy link
Member

Choose a reason for hiding this comment

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

should there be a deprecation warning logged to get developers to adapt code?

Copy link
Contributor

Choose a reason for hiding this comment

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

@timja would you be OK if this were merged without the deprecation warning or would you strongly prefer that the deprecation warning be added before it is merged?

I'd like to be sure this is included in the next weekly so that it is a strong candidate for a backport to the Nov 15, 2023 LTS baseline.

Copy link
Contributor

Choose a reason for hiding this comment

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

I merged with the assumption that we can add the deprecation message in a later pull request

@MarkEWaite MarkEWaite merged commit 97dde8f into jenkinsci:master Oct 14, 2023
MarkEWaite pushed a commit to MarkEWaite/jenkins that referenced this pull request Oct 29, 2023
… and buttons (jenkinsci#8602)

* [JENKINS-72170] fix for nested-hetero-list entries

when a plugin defines the hetero-list elements on its own and still uses
an <input type="button"> element and an inner element is already using
a hetero-list with a <button> element, then the old input wasn't
converted to a button as the inner button was found first.
Avoid this by converting all inputs to buttons before actually looking
up the button.

Recreate the hetero-list.js file to avoid the "No such adjunct found"
warning message

* remove hetero-list.js again

(cherry picked from commit 97dde8f)
@mawinter69 mawinter69 deleted the JENKINS-72170 branch January 31, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback regression-fix Pull request that fixes a regression in one of the previous Jenkins releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants