Skip to content

JENKINS-73941 - ForceSandbox - Unify logic in Script-Security for reducing techDebt#586

Merged
jglick merged 8 commits intojenkinsci:masterfrom
jgarciacloudbees:JENKINS-73941
Nov 13, 2024
Merged

JENKINS-73941 - ForceSandbox - Unify logic in Script-Security for reducing techDebt#586
jglick merged 8 commits intojenkinsci:masterfrom
jgarciacloudbees:JENKINS-73941

Conversation

@jgarciacloudbees
Copy link
Copy Markdown
Contributor

@jgarciacloudbees jgarciacloudbees commented Oct 31, 2024

JENKINS-73941 - - Option to hide "Use Groovy Sandbox" for users without Administer permission globally in the system

Complements:
#584
#585

After releasing jenkinsci/workflow-cps-plugin#948 we have realized that some logic can be unified between Script-Security and Workflow-CPS plugin.

To do so, we have created the new static methods:

  • org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval#shouldHideSandbox
  • org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval#validateSandbox

This PR does not include any new functionality, but decrease the techDebt maintaining both, Script-Security and Workflow-CPS Plugin

Testing done

Created new test cases for the created methods.

Submitter checklist

  • 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

@jgarciacloudbees jgarciacloudbees requested a review from a team as a code owner October 31, 2024 09:49
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
@jglick jglick requested a review from amuniz November 1, 2024 11:48
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
Comment thread src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java Outdated
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
@jglick jglick merged commit 9b98a4e into jenkinsci:master Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants