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-41289] use readOnlyMode to include edit-config in show-config #314

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mawinter69
Copy link
Contributor

Setting var readOnlyMode in jelly will basically disable all inputs, buttons, selects. So in the show-config.jelly files we can just set this var and the include the edit-config. So we no longer need to double maintain the fields.
For those configs that add credentials check the readOnlyMode variable and disable the delete and add buttons accordingly

On order to view a job configuration when one has extended read but no configure it must be avoided that the permissions checks in doCheck and doFill methods check for configure only, they should also allow EXTENDED_READ.

Testing done

Interactive testing
create for each type a config, when credentials are there add and delete buttons are still there and all fields are editable
create freestyle job and add a buildwrapper to provide credentials, for each config type go to the view details link, all fields are readonly and there are no buttons to add/remove credentials.
(note that the email ext plugin provides 2 config file types but misses to provide show-config.jelly files, thus the view details link leads to broken pages, this problem existed before)

Submitter checklist

Preview Give feedback

setting var readOnlyMode in the show-config jelly files allows to
include edit-config directly. For those that add credentials check the
readOnlyMode variable and disable the delete and add buttons accordingly
Allow extended read for the dofill and docheck methods so a job config
can be viewed with extended read permissions.
@mawinter69 mawinter69 requested a review from a team as a code owner February 5, 2024 15:32
@mawinter69
Copy link
Contributor Author

There is one drawback to this approach, the actual file content is no longer shown with codemirror but only as plain text. That would require a change in core to have textareas with codemirror in readonly mode keep the codemirror styling

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

Successfully merging this pull request may close these issues.

1 participant