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-61046] - Allow plugins to force an update of the UpdateCenter #4488

Conversation

jtnord
Copy link
Member

@jtnord jtnord commented Feb 11, 2020

See JENKINS-61046.

Proposed changelog entries

  • Developer: Allow plugins to force an update of an UpdateSite

Proposed upgrade guidelines

N/A

Submitter checklist

  • JIRA issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@mention

Maintainer checklist

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

  • There are at least 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 does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a JIRA issue should exist and be labeled as lts-candidate

@jtnord jtnord added the developer Changes which impact plugin developers label Feb 11, 2020
@jtnord jtnord requested review from amuniz and a team February 11, 2020 11:07
@oleg-nenashev oleg-nenashev changed the title Allow plugins to force an update of the UpdateCenter [JENKINS-61046] - Allow plugins to force an update of the UpdateCenter Feb 12, 2020
@oleg-nenashev oleg-nenashev added the plugin-api-changes Changes the API of Jenkins available for use in plugins. label Feb 12, 2020
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Looks good to me in principle, but IMO we should avoid exposing test parameters in new API. I suggest to introduce a new API method which does not allow disabling the signature check. (may be off only for testing!) in Javadoc was a good first step, but IMHO it is not enough

@timja
Copy link
Member

timja commented Feb 12, 2020

Looks good to me in principle, but IMO we should avoid exposing test parameters in new API. I suggest to introduce a new API method which does not allow disabling the signature check. (may be off only for testing!) in Javadoc was a good first step, but IMHO it is not enough

if we're introducing a new API then it would be good for it not to return form validation and either return a boolean or throw on error

@oleg-nenashev notes that the public API should not expose the security
option that is for testing.  Introduced updateDirectlyNow() as the new
API and updateDirectly() to have a mirror and deprecated
updateDirectly(boolean) as a consequence.
@jtnord
Copy link
Member Author

jtnord commented Feb 12, 2020

if we're introducing a new API then it would be good for it not to return form validation and either return a boolean or throw on error

@timja that would collide with the way I have just addressed @oleg-nenashev's feedback. internal non test code no longer call updateDirectly(boolean) or updateDirectlyNow(boolean) and changing the return would mean they would go back to calling the boolean parametered methods or a larger refactoring.

before I make any further changes could you both come to an agreement on the latest or disagree on the merits of 20a2c76

fixes the grammar of the UpdateSite#updateDirectlyNow javadoc

Co-Authored-By: Raihaan Shouhell <[email protected]>
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

It would be nice if an intended API didn’t return web specific form validation, but not blocking it

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Thanks @jtnord ! The current version looks good to me.

*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

Bonus points for restricting the external use

Copy link
Member Author

@jtnord jtnord Feb 17, 2020

Choose a reason for hiding this comment

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

that would break source compatibility, and that could break some (at least internal) workflows, as well as having the potential to force disabling the Restrictions check a for another year - which was the whole point of this PR to begin with.
Let's just at least deprecate it for at least a few LTS version first (we could/should start looking at doing a sweep of all deprecated API and look at restrict them based on how long they have been deprecated).

Copy link
Member

Choose a reason for hiding this comment

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

Fine with me. We break compatibility too often in recent releases

@oleg-nenashev
Copy link
Member

I suggest merging it tomorrow if no negative feedback

@oleg-nenashev oleg-nenashev added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 17, 2020
@oleg-nenashev oleg-nenashev merged commit b39ff99 into jenkinsci:master Feb 18, 2020
MarkEWaite added a commit to MarkEWaite/jenkins.io that referenced this pull request Feb 19, 2020
The 2.221 release did not include the following items which were
incorrectly listed in the original 2.221 changelog:

* New permission Overall/Manage - JEP-223, [PR-4501](jenkinsci/jenkins#4501)
* Memory usage monitor in system info page - [PR-4499](jenkinsci/jenkins#4499)
* Allow plugins to force an update of UpdateCenter - [PR-4488](jenkinsci/jenkins#4488)
* Admin monitors sorted in global config page - [PR-4487](jenkinsci/jenkins#4487)
* Tied job loading performance improvement - [PR-4497](jenkinsci/jenkins#4497)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Changes which impact plugin developers plugin-api-changes Changes the API of Jenkins available for use in plugins. ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants