Branch: refs/heads/master Home: https://github.com/jenkinsci/scriptler-plugin Commit: 381f6454af549711e4344a70e739573c374daf36 https://github.com/jenkinsci/scriptler-plugin/commit/381f6454af549711e4344a70e739573c374daf36 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-03 (Tue, 03 May 2022)
Changed paths: M src/test/java/org/jenkinsci/plugins/scriptler/restapi/ScriptlerRestApiTest.java Log Message: ----------- Convert ScriptlerRestApiTest to Unix line endings Commit: 69b9a06711dfcb9fcce510b3d75a1288e7e9f910 https://github.com/jenkinsci/scriptler-plugin/commit/69b9a06711dfcb9fcce510b3d75a1288e7e9f910 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-03 (Tue, 03 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/git/GitScriptlerRepository.java M src/main/java/org/jenkinsci/plugins/scriptler/share/ScriptInfoCatalog.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderTest.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderWithRestartTest.java M src/test/java/org/jenkinsci/plugins/scriptler/restapi/ScriptlerRestApiTest.java M src/test/java/org/jenkinsci/plugins/scriptler/tokenmacro/ScriptlerTokenMacroTest.java Log Message: ----------- Simplify extension lookups Simplify uses of Jenkins.get().getExtensionList(Class).get() to ExtensionList.lookupSingleton(), which not only ensures that the Jenkins singleton is non-null but also that the extension being looked up exists and that only a single instance of it exists. An IllegalStateException will be raised otherwise, which is simpler to handle. Commit: 35b1bffd72bceabcc633b24597759d3e27b1fae1 https://github.com/jenkinsci/scriptler-plugin/commit/35b1bffd72bceabcc633b24597759d3e27b1fae1 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptlerConfiguration.java M src/main/java/org/jenkinsci/plugins/scriptler/git/GitScriptlerRepository.java M src/main/java/org/jenkinsci/plugins/scriptler/util/GroovyScript.java M src/main/java/org/jenkinsci/plugins/scriptler/util/ScriptHelper.java Log Message: ----------- Update deprecated methods Fix two specific uses of deprecated methods/APIs that were in use: - Jenkins.getInstance (replaced with Jenkins.get) - Jenkins.MasterComputer.localChannel (replaced with FilePath.localChannel) This commit still leaves the usage of the deprecated Plugin class. This will be dealt with in the next commits. Commit: be98485e8688ead6f1a6928043d82fc71a390e00 https://github.com/jenkinsci/scriptler-plugin/commit/be98485e8688ead6f1a6928043d82fc71a390e00 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java A src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerPermissions.java M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerPluginImpl.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptlerConfiguration.java M src/main/java/org/jenkinsci/plugins/scriptler/git/GitScriptlerRepository.java Log Message: ----------- Move permissions to dedicated file Commit: 7957a166e5f21b6e04c236bbb32f93d523326d62 https://github.com/jenkinsci/scriptler-plugin/commit/7957a166e5f21b6e04c236bbb32f93d523326d62 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: A src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerLoadingTasks.java R src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerPluginImpl.java Log Message: ----------- Replace Plugin subclass with @Initializer methods Plugin subclasses have been deprecated since Jenkins 1.642, so there's no reason to keep this subclass around. The logic of the class still serves a purpose, so convert it from a Plugin subclass to a standalone class that uses @Initializer-annotated static methods to perform loading tasks. Commit: 9db017478f8b1bf149e276e9a42723bbb5c285a6 https://github.com/jenkinsci/scriptler-plugin/commit/9db017478f8b1bf149e276e9a42723bbb5c285a6 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/SyncUtil.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptSet.java M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptlerConfiguration.java M src/main/java/org/jenkinsci/plugins/scriptler/git/GitScriptlerRepository.java M src/main/java/org/jenkinsci/plugins/scriptler/share/ScriptInfo.java M src/main/java/org/jenkinsci/plugins/scriptler/util/GroovyScript.java M src/main/java/org/jenkinsci/plugins/scriptler/util/ScriptHelper.java M src/test/java/org/jenkinsci/plugins/scriptler/util/GroovyScriptTest.java Log Message: ----------- Use Java 8 diamond operator to simplify generics Commit: e7320eebae4c0261ab6d5cf1af9d7cbbb146b009 https://github.com/jenkinsci/scriptler-plugin/commit/e7320eebae4c0261ab6d5cf1af9d7cbbb146b009 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/share/ScriptInfoCatalog.java M src/main/java/org/jenkinsci/plugins/scriptler/share/gh/GHCatalog.java Log Message: ----------- Convert ScriptInfoCatalog to an interface ScriptInfoCatalog was extending an abstract class from Ant previously to mark itself as an extension point, which was incorrect. The correct class is ExtensionPoint from Jenkins itself, which it was changed to implement in a previous commit. Given that it's only meant to define an API that catalog classes are expected to adhere to and defines one static method for finding all script catalogs, it makes more sense for this to be an interface. Convert it to an interface and adapt the one implementation of it to match. There don't appear to be any additional plugins which depend on us and would otherwise extend the abstract class from before, so this should be safe. Nevertheless, mention it in the release notes. Commit: 488f276f13774c8e73293dc153a0bdd5a634739b https://github.com/jenkinsci/scriptler-plugin/commit/488f276f13774c8e73293dc153a0bdd5a634739b Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/share/ScriptInfoCatalog.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderTest.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderWithRestartTest.java Log Message: ----------- Remove uses of raw types To allow better compiler messages, remove all raw uses of parameterized types. Uses of Project are fixed by using wildcard types, but others are resolved by putting as concrete types as possible in the generics. Commit: 0cd4b63089089e1a0258b8345c18f34467a95c7e https://github.com/jenkinsci/scriptler-plugin/commit/0cd4b63089089e1a0258b8345c18f34467a95c7e Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptlerConfiguration.java M src/main/java/org/jenkinsci/plugins/scriptler/share/gh/GHCatalog.java Log Message: ----------- Small List-related cleanups - Use List.sort instead of static Collections.sort - Use List.toArray() with a 0-sized array instead of a pre-sized array - Use Collections.singletonList for single-list items instead of Arrays.asList Commit: 74d37e0fad32f451e8c417bab66af06ec43287ae https://github.com/jenkinsci/scriptler-plugin/commit/74d37e0fad32f451e8c417bab66af06ec43287ae Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java Log Message: ----------- Remove legacy code in XStream passthru converter This converter had adaptation code for before and after Jenkins 1.625. Since our required Jenkins version is much newer than that at this point, remove the uses of it and just use the post-1.625 code. Commit: 0f550af33a0282ed7ffa4c52dcac451f6b758a3a https://github.com/jenkinsci/scriptler-plugin/commit/0f550af33a0282ed7ffa4c52dcac451f6b758a3a Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/SyncUtil.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/git/GitScriptlerRepository.java M src/main/java/org/jenkinsci/plugins/scriptler/git/GitScriptlerRepositorySSHAccess.java M src/main/java/org/jenkinsci/plugins/scriptler/util/GroovyScript.java M src/main/java/org/jenkinsci/plugins/scriptler/util/UIHelper.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderWithRestartTest.java M src/test/java/org/jenkinsci/plugins/scriptler/util/GroovyScriptTest.java Log Message: ----------- Tighten up exception declarations Various methods declared that they could throw exceptions that were not possible or threw exception types which were too broad. Clean these up so each method only declares the exceptions that it can actually throw. Still allow for Exception generally when multiple exception types are present. Commit: 73d38ebd474c7a6660bde2e844bfad16d782f183 https://github.com/jenkinsci/scriptler-plugin/commit/73d38ebd474c7a6660bde2e844bfad16d782f183 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/tokenmacro/ScriptlerTokenMacro.java M src/main/resources/org/jenkinsci/plugins/scriptler/Messages.properties Log Message: ----------- Fix potential null dereferences In ScriptlerManagement, ScriptHelper.getScript can potentially return null. Check for this and set an appropriate error message if it occurs. In ScriptlerBuilder, if we're not running on the controller node, laucher.getChannel() can potentially return null. Check for this and print an error if it occurs. In ScriptlerTokenMacro, if the remote agent has disconnected, the workspace can potentially be null. Throw an error if this occurs. Commit: 4a97b29e768f4601fb6ce0c6d45c5c4b8f66bead https://github.com/jenkinsci/scriptler-plugin/commit/4a97b29e768f4601fb6ce0c6d45c5c4b8f66bead Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/config/Parameter.java M src/main/java/org/jenkinsci/plugins/scriptler/util/UIHelper.java Log Message: ----------- Directly deserialize Parameter instances When receiving form data from Stapler, it comes in the form of a JSONArray from json-lib. To use deserialization directly from that JSONArray requires an object that has an empty constructor as well as setter methods for each field being deserialized. This does not play well to have an immutable object, which is better in terms of preventing unexpected behaviour as well as simplifying use of these objects in general (e.g., they can be used as keys for maps and sets, etc.). In the view of wanting to make the Parameter class immutable, remove the empty constructor in favour of one that takes a JSONObject instance and pulls out the pertinent information from it itself. Make a new method to loop through a JSONArray instance and map each value within using a mapping function, which we pass our new constructor. With this, we can remove the setters as well and make the fields final, making the class immutable. Commit: 0aa00b8fc7a46f449676892fcbb093e5680aa599 https://github.com/jenkinsci/scriptler-plugin/commit/0aa00b8fc7a46f449676892fcbb093e5680aa599 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M pom.xml M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/config/Parameter.java M src/main/java/org/jenkinsci/plugins/scriptler/config/Script.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderTest.java A src/test/java/org/jenkinsci/plugins/scriptler/config/ParameterTest.java A src/test/java/org/jenkinsci/plugins/scriptler/config/ScriptTest.java Log Message: ----------- Add EqualsVerifier tests and fix equals/hashCode The ScriptlerBuilder, Parameter and Script classes all override the equals and hashCode methods from Object, but did so inconsistently and more verbosely than required. Rewrite these to use the new Objects.hash and Objects.equals methods and add EqualsVerifier to test whether they operate as expected. Using EqualsVerifier 3.8.3 for now instead of anything later due to enforcer errors. Will revisit this after upgrading the plugin POM. Commit: 35e8bb2f9a7c98e4b004382b99bf5d4b99b665be https://github.com/jenkinsci/scriptler-plugin/commit/35e8bb2f9a7c98e4b004382b99bf5d4b99b665be Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/SyncUtil.java M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java M src/main/java/org/jenkinsci/plugins/scriptler/config/Script.java M src/main/java/org/jenkinsci/plugins/scriptler/tokenmacro/ScriptlerTokenMacro.java M src/main/java/org/jenkinsci/plugins/scriptler/util/GroovyScript.java M src/main/java/org/jenkinsci/plugins/scriptler/util/ScriptHelper.java M src/main/java/org/jenkinsci/plugins/scriptler/util/UIHelper.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderTest.java M src/test/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilderWithRestartTest.java M src/test/java/org/jenkinsci/plugins/scriptler/restapi/ScriptlerRestApiTest.java M src/test/java/org/jenkinsci/plugins/scriptler/util/GroovyScriptTest.java M src/test/java/org/jenkinsci/plugins/scriptler/util/UIHelperTest.java Log Message: ----------- Convert parameter arrays to Collections To prevent possible nulls (as some paths used null arrays rather than empty arrays) and to promote the use of more modern classes, convert the arrays that held Parameter instances to instances of Collection or List. Annotate them all @NonNull and handle appropriately. List is used in some areas where serialization is required, as XStream will not deserialize a Collection. Collection is preferred as it's more general and we typically don't need the ordering guarantees of a List. Keep a constructor and getter in ScriptlerBuilder that use arrays to maintain compatibility with the Active Choices plugin. These are deprecated and can be removed in the future once Active Choices is updated. Commit: 08b38074bfc4cf9b7baec992f9aa0b0b95f63265 https://github.com/jenkinsci/scriptler-plugin/commit/08b38074bfc4cf9b7baec992f9aa0b0b95f63265 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptSet.java M src/main/java/org/jenkinsci/plugins/scriptler/config/ScriptlerConfiguration.java Log Message: ----------- Make scriptSet final The set of scripts in the ScriptSet and ScriptlerConfiguration classes can change, but there's no need to actually change the object reference here. Change the modification methods to clear the existing collection and modify it rather than replace it. Commit: eecf0c47f8cc5241860b2530f94c06927089d29a https://github.com/jenkinsci/scriptler-plugin/commit/eecf0c47f8cc5241860b2530f94c06927089d29a Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/catalog.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/edit.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/index.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/runScript.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/scriptSettings.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/settings.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/show.jelly Log Message: ----------- Add custom titles to each l:layout view Commit: fea812dc80e9bec60279f8ed5fa3731c36b74f89 https://github.com/jenkinsci/scriptler-plugin/commit/fea812dc80e9bec60279f8ed5fa3731c36b74f89 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/builder/ScriptlerBuilder.java Log Message: ----------- Catch specific exceptions instead of Exception To avoid catching other exception types that are unintended, particularly RuntimeExceptions, restrict the exception types that are caught in ScriptlerBuilder to the specific types that can be thrown. Commit: 6011f13bedd5e6b29fc779ab70168264f2dd2848 https://github.com/jenkinsci/scriptler-plugin/commit/6011f13bedd5e6b29fc779ab70168264f2dd2848 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M pom.xml Log Message: ----------- Enable build failures on SpotBugs errors All outstanding SpotBugs issues have been dealt with, so allow it to fail the build now if any issues (which would be new) are found. Commit: d7bb42bb5b3cd4a1bf0e6524d0402a3188ac4e80 https://github.com/jenkinsci/scriptler-plugin/commit/d7bb42bb5b3cd4a1bf0e6524d0402a3188ac4e80 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/runScript.jelly M src/test/java/org/jenkinsci/plugins/scriptler/restapi/ScriptlerRestApiTest.java Log Message: ----------- Unignore unit test by disabling CodeMirror This one unit test was ignored supposedly because HtmlUnit didn't send the modified textarea to the server, but the real culprit was the CodeMirror text editor, as it "overwrote" the textarea with its own component and then overwrote the contents of the textarea on form submission. To bypass this, we don't apply CodeMirror to the textarea if we're running unit tests, so the textarea contents will not be overwritten on form submission. Commit: aa3a89b8abeb87057837e5cc5fb6fb873288d1e7 https://github.com/jenkinsci/scriptler-plugin/commit/aa3a89b8abeb87057837e5cc5fb6fb873288d1e7 Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-04 (Wed, 04 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/SyncUtil.java M src/main/java/org/jenkinsci/plugins/scriptler/config/Script.java M src/main/java/org/jenkinsci/plugins/scriptler/share/ScriptInfo.java Log Message: ----------- Replace anonymous classes with lambdas Where we create an anonymous class instance, either of FilenameFilter or Comparator, replace it with a lambda so it's easier to read and a bit more concise. Compare: https://github.com/jenkinsci/scriptler-plugin/compare/c9ee54fdf759...aa3a89b8abeb -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scriptler-plugin/push/refs/heads/master/c9ee54-aa3a89%40github.com.