-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Release plugin 2.5.4
When overrideBuildParameters is not enabled, ReleaseWrapper does not attempt to filter default parameters that are also included in the Release configuration and blindly add new parameter regardless of whether a default parameter (from the regular job) has the same name, this results in release builds with confusing duplicated parameters
if (isOverrideBuildParameters()) { // if overrideBuildParameters is set, then build params are submitted // within the list of release params -- no need to gather default values paramValues = new ArrayList<ParameterValue>(); } else { //////////// lack of filtering in regards to getParameterDefinitions() paramValues = getDefaultParametersValues(); } if (getParameterDefinitions() != null && !getParameterDefinitions().isEmpty() || overrideBuildParameters && getBuildParameterDefinitions() != null && !getBuildParameterDefinitions().isEmpty()) { JSONObject formData = req.getSubmittedForm(); JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject) o; String name = jo.getString("name"); ParameterDefinition d = getParameterDefinition(name); if(d==null) throw new IllegalArgumentException("No such parameter definition: " + name); ParameterValue value = d.createValue(req, jo); paramValues.add(d.createValue(req, jo)); } } else {