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

Fixes Jenkins.SYSTEM_READ support #825

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Mar 30, 2023

This fixes readonly configuration support by changing multiple checks to Jenkins.ADMINISTER to return an empty validation if permission is missing.

  • 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

This fixes readonly configuration support by changing multiple checks to
Jenkins.ADMINISTER to first check Jenkins.SYSTEM_READ then return only
valuable information if user has Jenkins.ADMINISTER
@Vlatombe Vlatombe changed the title Fixes Jenkins.SYSTEM_READ support Fixes Jenkins.SYSTEM_READ support Mar 30, 2023
@Vlatombe Vlatombe marked this pull request as draft March 30, 2023 16:20
@daniel-beck
Copy link
Member

It doesn't really benefit anyone to show errors to low-privilege users for use cases that are unexpected, so a simpler if (!hasPermission(ADMINISTER)) return FormValidation.ok() replacing the current checkPermission call should be enough. This PR as is should resolve the specific issue encountered too, of course.

SYSTEM_READ can list existing clouds and configuration, but should not
perform external calls (as the current value will be displayed anyway)
@Vlatombe Vlatombe marked this pull request as ready for review March 31, 2023 08:36
@res0nance res0nance merged commit a7d2159 into jenkinsci:master Apr 3, 2023
@Vlatombe Vlatombe deleted the fix-readonly-configuration branch April 3, 2023 16:07
@mwebber
Copy link

mwebber commented Apr 4, 2023

Reported as JENKINS-70987

I am running Jenkins 2.387.1 (latest LTS). When I upgraded the ec2-plugin from 2.0.6 to 2.0.7, I found that all Agents terminated after 10 minutes, which is our Idle termination time, even if a job was running on the Agent. In all cases, Agents were terminated 10 minutes after starting.

When we reverted back to 2.0.6, the problem went away, so this looks like a bug introduced in 2.0.7.
There were 2 PRs in that release, this one #825, and #827.

@mwebber
Copy link

mwebber commented May 4, 2023

In response to the problem I reported in the previous comment (Agents terminating prematurely), deleting and recreating the cloud definition fixes the problem.
See #827 (comment)

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