-
Notifications
You must be signed in to change notification settings - Fork 288
Check Workspace permission before showing source code viewer #3244
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
Conversation
|
"Add permissions for source code viewer" sounds as if this defined a new permission type. If this instead uses Job/Workspace permission, then please say so in the title, so that it will be clear from the release notes. |
|
Please review the changes. @uhafner |
|
I think we should not reuse the Workspace permissions. See https://issues.jenkins.io/browse/JENKINS-48354 for details. |
Then, what should I do now? Should I open a new PR in https://github.com/jenkinsci/prism-api-plugin based on your suggestion or anything else? |
|
If it is possible to create permissions as opt-out, then it makes sense to create the permission in the prism plugin (and move the view to this plugin). Can you check, if that is possible? |
Ok, I will investigate and inform you soon. |
…Factory to use SourceCodeViewModel.create()
…atting and line breaks
|
I implemented the functionality by calling Should I add new test for new functionality? (as it was already tested in prism-api-plugin) |
uhafner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good now. Just the facade can be replaced with the real one...
| s -> assertThat(s.getSourceCode()).contains(AFFECTED_FILE_CONTENT)); | ||
| } | ||
|
|
||
| private Object createDetails(final JenkinsFacade jenkins, final BuildFolderFacade buildFolder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private Object createDetails(final JenkinsFacade jenkins, final BuildFolderFacade buildFolder, | |
| private Object createDetails(final BuildFolderFacade buildFolder, |
| private Object createDetails(final JenkinsFacade jenkins, final BuildFolderFacade buildFolder, | ||
| final String fileName) { | ||
| try (var issueBuilder = new IssueBuilder()) { | ||
| var detailFactory = new DetailFactory(jenkins, buildFolder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use new JenkinsFacade() since Jenkins is now running.
| when(result.getErrorMessages()).thenReturn(org.eclipse.collections.impl.factory.Lists.immutable.empty()); | ||
| when(result.getInfoMessages()).thenReturn(org.eclipse.collections.impl.factory.Lists.immutable.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| when(result.getErrorMessages()).thenReturn(org.eclipse.collections.impl.factory.Lists.immutable.empty()); | |
| when(result.getInfoMessages()).thenReturn(org.eclipse.collections.impl.factory.Lists.immutable.empty()); | |
| when(result.getErrorMessages()).thenReturn(Lists.immutable.empty()); | |
| when(result.getInfoMessages()).thenReturn(Lists.immutable.empty()); |
|
Thanks! |
Add permissions for source code viewer
Fixes #2940
Testing done
Submitter checklist