Skip to content

automation: Do not warn if "enabled" or "alwaysRun" properties specified #6680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addOns/automation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Bug in handling headers with colons in the values.
- Use default authentication poll frequency when none specified, if the value is less than one a progress warning occurs.
- Do not warn if "enabled" or "alwaysRun" properties specified.

## [0.51.0] - 2025-07-17
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
}
LinkedHashMap<?, ?> jobData = (LinkedHashMap<?, ?>) jobObj;

Object jobType = jobData.get("type");
Object jobType = jobData.remove("type");
if (jobType == null) {
progress.error(
Constant.messages.getString("automation.error.job.notype", jobType));
Expand All @@ -113,7 +113,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
if (job != null) {
try {
job = job.newJob();
Object jobName = jobData.get("name");
Object jobName = jobData.remove("name");
if (jobName != null) {
if (jobName instanceof String) {
job.setName((String) jobName);
Expand All @@ -132,7 +132,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
continue;
}

Object jobEnabled = jobData.get("enabled");
Object jobEnabled = jobData.remove("enabled");
if (jobEnabled != null) {
if (jobEnabled instanceof Boolean enableBool) {
job.setEnabled(enableBool);
Expand All @@ -143,7 +143,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
}
}

Object alwaysRun = jobData.get("alwaysRun");
Object alwaysRun = jobData.remove("alwaysRun");
if (alwaysRun != null) {
if (alwaysRun instanceof Boolean jobBool) {
job.setAlwaysRun(jobBool);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ public void verifyParameters(AutomationProgress progress) {
JobUtils.verifyRegexes(jobData.get(key), key.toString(), progress));
break;

case "name":
case "type":
break;

default:
progress.warn(
Constant.messages.getString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ public void verifyParameters(AutomationProgress progress) {
params, this.parameters, this.getName(), null, progress);
break;
case "policyDefinition":
case "name":
case "tests":
case "type":
// Handled before we get here
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ public void verifyParameters(AutomationProgress progress) {
policyDefinition.parsePolicyDefinition(
jobData.get(key), this.getName(), progress);
break;
case "name":
case "tests":
case "type":
// Handled before we get here
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ void shouldReturnWarningOnUnexpectedElement() throws MalformedURLException {
ActiveScanJob job = new ActiveScanJob();
AutomationProgress progress = new AutomationProgress();
LinkedHashMap<String, String> data = new LinkedHashMap<>();
data.put("name", "blah");
data.put("tests", "");
// The only invalid one
data.put("unexpected", "data");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ void shouldReturnWarningOnUnexpectedElement() throws MalformedURLException {
ActiveScanPolicyJob job = new ActiveScanPolicyJob();
AutomationProgress progress = new AutomationProgress();
LinkedHashMap<String, String> data = new LinkedHashMap<>();
data.put("name", "blah");
data.put("tests", "");
// The only invalid one
data.put("unexpected", "data");
Expand Down
3 changes: 2 additions & 1 deletion addOns/sequence/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ All notable changes to this add-on will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Changed
- Maintenance changes.

## [8] - 2025-01-10
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ public void verifyParameters(AutomationProgress progress) {
params, this.parameters, this.getName(), null, progress);
break;
case "policyDefinition":
case "name":
case "tests":
case "type":
// Handled before we get here
break;
default:
Expand Down