Quality of Life/Efficiency/Security Changes #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quality of Life/Efficiency/Security Changes
From the outside, nothing changes/nothing breaks (hopefully). No new arguments were added, no anything, just inside changes.
Separating filtering jobs from filtering builds
Till now, when the user wanted to filter the jobs with
--job-config-find
, the filtering was done in the Builds.java class together when filtering individual builds of all jobs - this was really unnecessarily inefficient.I decided to create a class
JobConfigFilter
whose aim is to filter the jobs when user uses--job-config-find
and Builds.java then gets the already filtered subset, so it can only filter the builds of the matched jobs (not all jobs like before), so it should be quicker.Everything stays the same, no new command line switch was added, the results of the filtering are still the same, just faster.
Updated Jenkins help
As the heading says, I added two lines to help :)
Reworked the detection of escaping parent directory
Now, instead of checking with regex whether the file location is using
../
, there is a new static methodConfigFinder.checkIfConfigIsInParent()
, which checks if a config file is inside a given parent directory and if not, it throws an exception. This method is then used where it makes sense before creating new ConfigFinder -> BuildReportExtendedPlugin.java, Builds.java, JobConfigFilter.java.