Add backwards compatibility for executor scaling feature #424
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.
The new executor scaling feature involved the introduction the new executorScaler field for EC2FleetCloud, and the removal of the scaleExecutorsByWeight field. Upon upgrading from from an old version to a new version, including this change, the EC2FleetCloud unmarshalled from the users Jenkins config.xml file would set the executorScaler field to null, causing a NullPointer error during Agent provisioning.
The Jenkins clouds are being updated to include the new field during its periodic update. The executorScaler is based on the old scaleExecutorsByWeight field, which is now solely used for the instantiation of the executorScaler field. If a user previously configured executors to be scaled by weights it will continue to do so. These changes are then saved to the user's Jenkins config.xml file.
Testing done
Updated unit tests for the changed made for the backwards compatibility.
Performed manual testing regarding upgrading from version 3.0.1 and 3.0.2. Validated that the config.xml file pertains its configurations and is updated with the new executorScaler field.