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

Backward compatibility fix for resource-labels #437

Merged
merged 4 commits into from
Jan 5, 2023

Conversation

mPokornyETM
Copy link
Contributor

@mPokornyETM mPokornyETM commented Jan 3, 2023

fix #434

Upgrade to 1102 erased all resource labels when the user use .xml config file. It does not happens in case of CaC.
The magic is done by using of readResolve() method and 'repairing' the labels property.

To explain. Before the release 1102 are labels stored in String property. This was changed to List to improve performance, otherwise is necessary to split the String property every time, when you works with labels. On instances with many resources, where each use many of labels is the performance much better.

Why happens this issue? There are no tests to use .xml files. Only for JCaC. And I use only JCaC. That the reason, why I forgot to test the changes for classic .xml configurations.

Testing done

Tested manually:

  • use 'old' .xml config file
  • add ne resource and labels via config page and safe it
  • reload jenkins with new .config file
  • load CaC file

I checked the labels for every step as well and it looks good.

Proposed upgrade guidelines

N/A

Localizations

N/A

Submitter checklist

  • The Jira / Github issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples).
    • The changelog generator for plugins uses the pull request title as the changelog entry.
    • Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during the upgrade.
  • There is automated testing or an explanation that explains why this change has no tests.
  • New public functions for internal use only are annotated with @NoExternalUse. In case it is used by non java code the Used by {@code <panel>.jelly} Javadocs are annotated.
  • [ ] New or substantially changed JavaScript is not defined inline and does not call eval to ease the future introduction of Content Security Policy (CSP) directives (see documentation).
  • [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • [ ] For new APIs and extension points, there is a link to at least one consumer.
  • [ ] Any localizations are transferred to *.properties files.
  • [ ] Changes in the interface are documented also as examples.

Maintainer checklist

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

  • There is at least one (1) approval 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. See also release-drafter-labels.
  • 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).
  • java code changes are tested by automated test.

@mPokornyETM mPokornyETM requested a review from a team as a code owner January 3, 2023 12:16
@mPokornyETM mPokornyETM enabled auto-merge (squash) January 3, 2023 12:16
@mPokornyETM mPokornyETM added bug java Pull requests that update Java code megre in 24 hours without review When nobody request a change or leave comment here I will merge it in 24 hours resource labels enhancement Improvements for resource-labels labels Jan 3, 2023
@mPokornyETM mPokornyETM added the breaking Breaking changes label Jan 5, 2023
@mPokornyETM mPokornyETM disabled auto-merge January 5, 2023 13:58
@mPokornyETM mPokornyETM merged commit c9153f1 into jenkinsci:master Jan 5, 2023
@mPokornyETM mPokornyETM deleted the load-labels branch January 5, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking changes bug java Pull requests that update Java code megre in 24 hours without review When nobody request a change or leave comment here I will merge it in 24 hours resource labels enhancement Improvements for resource-labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to 1102 erased all resource labels
2 participants