Skip to content

Conversation

@pathob
Copy link
Contributor

@pathob pathob commented Apr 2, 2023

Probably since the feature was introduced, the "disable project avatar" setting gets lost every next time a Jenkins job using that setting gets reconfigured. In the configuration view, the corresponding checkbox does not get checked even though the 'disableProjectAvatar' attribute is set to 'true' because the getter of the attribute does not follow the correct naming scheme.

Fixing this bug by renaming the getter from 'doDisableProjectAvatar' to 'isDisableProjectAvatar' which now allows Jenkins to pick up the actual value for the checkbox.

  • 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 (none, I've checked GitHub and Jira)
  • Link to relevant pull requests, esp. upstream and downstream changes (none)
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Probably since the feature was introduced, the "disable project avatar"
setting gets lost every next time a Jenkins job using that setting gets
reconfigured. In the configuration view, the corresponding checkbox
does not get checked even though the 'disableProjectAvatar' attribute
is set to 'true' because the getter of the attribute does not follow
the correct naming scheme.

Fixing this bug by renaming the getter from 'doDisableProjectAvatar' to
'isDisableProjectAvatar' which now allows Jenkins to pick up the actual
value for the checkbox.
@pathob
Copy link
Contributor Author

pathob commented Apr 2, 2023

Hi @MarkEWaite @jetersen

please allow me to contact you directly. My client's organisation is currently migrating a 2K user Gerrit instance to GitLab. As almost all their repositories are private, they are affected by #173 with hundreds of repositories (and pipelines) and want to disable the generated project avatars. Unfortunately we've noticed that the 'disableProjectAvatar' setting gets lost every time a job gets reconfigured if the user does not actively checks the checkbox again. The fix is done simply by renaming the corresponding getter as described in the commit. It would be nice if we could get this merged soon and if you could provide a bugfix release that facilitates the ongoing migration.

Please let me know if something else has to be done. Regarding the missing test, I currently don't know how to test this in a useful way.

Thanks!

@pathob pathob marked this pull request as ready for review April 2, 2023 14:03
@pathob pathob requested a review from jetersen as a code owner April 2, 2023 14:03
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 for the pull request.

I confirmed that the current release of the GitLab branch source plugin resets the value of the Disable project avatar checkbox each time the page is opened. The setting is stored to the job configuration file and used when the file is read, but not shown in the state of the checkbox on the job configuration page.

I confirmed that this change fixes that incorrect behavior. When the configuration page is open the previous state of "Disable project avatar" is now shown as expected and is saved when the configuration changes are saved.

I'm not a maintainer of this plugin, so I cannot merge the proposed fix. The proposed fix has passed my interactive tests and I believe it is ready to merge.

Copy link
Member

@jetersen jetersen left a comment

Choose a reason for hiding this comment

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

LGTM

Although it changes the binary compatibility, I am certain this is only used as an internal method for this plugin.

@jetersen jetersen added the bug Something isn't working label Apr 3, 2023
@jetersen jetersen merged commit 0c0c463 into jenkinsci:master Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants