Skip to content
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

POL-1378 Linting Updates: Operational Policies #2732

Merged
merged 187 commits into from
Oct 14, 2024

Conversation

XOmniverse
Copy link
Contributor

@XOmniverse XOmniverse commented Oct 8, 2024

Description

Various small changes to Security policies to bring them up to current linting standards. Also removes known bad coding patterns to avoid their reuse.

Dangerfile error is a false positive and can be ignored. The coding pattern causing it is sufficiently niche to not be worth the effort of coding the Dangerfile test around it.

@XOmniverse XOmniverse requested a review from a team as a code owner October 8, 2024 20:36
Copy link
Contributor

github-actions bot commented Oct 8, 2024

1 Error
🚫

operational/azure/marketplace_new_products/azure_marketplace_new_products.pt

run_script statements found whose parameters are not in the correct order. run_script parameters should be in the following order: script, val(iter_item, string), datasources, parameters, variables, raw values:

Line 229: ds_current_products_oldconnection / run_script $js_get_products_oldconnection
Line 325: ds_current_products_newconnection / run_script $js_get_products_newconnection

4 Warnings
⚠️

Important Files Modified

Please make sure these modifications were intentional and have been tested. These files are necessary for configuring the Github repository and managing automation.

.dangerfile/readme_tests.rb

⚠️

operational/aws/long_running_instances/long_running_instances.pt

Detected new request datasource(s) in Policy Template file. Please verify the README.md has any new permissions that may be required.

⚠️

operational/aws/total_instance_usage_report/aws_total_instance_usage_report.pt

Possible invalid spacing between comma-separated items found:

Line 380: chart_axis_format = "chxs=0N*f" + "0sz* " + param_unit_time + "|1,min40"

Comma separated items should be organized as follows, with a single space following each comma: apple, banana, pear

⚠️

operational/azure/total_instance_usage_report/azure_total_instance_usage_report.pt

Possible invalid spacing between comma-separated items found:

Line 412: chart_axis_format = "chxs=0N*f" + "0sz* " + param_unit_time + "|1,min40"

Comma separated items should be organized as follows, with a single space following each comma: apple, banana, pear

Generated by 🚫 Danger

@@ -226,11 +226,11 @@ end
datasource "ds_current_products_oldconnection" do
iterate $ds_bill_connections_old
request do
run_script $js_get_products_oldconnection, val(iter_item, 'id'), $ds_top_level_bcs, rs_org_id, rs_optima_host, 3
run_script $js_get_products_oldconnection, val(iter_item, 'id'), $ds_top_level_bcs, 3, rs_org_id, rs_optima_host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was fine before

run_script statements found whose parameters are not in the correct order. run_script parameters should be in the following order: script, val(iter_item, string), datasources, parameters, variables, raw values:

Line 229: ds_current_products_oldconnection / run_script $js_get_products_oldconnection

Line 325: ds_current_products_newconnection / run_script $js_get_products_newconnection --


Suggested change
run_script $js_get_products_oldconnection, val(iter_item, 'id'), $ds_top_level_bcs, 3, rs_org_id, rs_optima_host
run_script $js_get_products_oldconnection, val(iter_item, 'id'), $ds_top_level_bcs, rs_org_id, rs_optima_host, 3

(Would obviously mean lines 243, 255, 325, 339 and 351 would need to be reverted)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, I see why you did this

@nia-vf1 nia-vf1 self-requested a review October 14, 2024 16:21
Copy link
Contributor

@nia-vf1 nia-vf1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@XOmniverse XOmniverse merged commit 0c3cb3a into master Oct 14, 2024
10 of 11 checks passed
@XOmniverse XOmniverse deleted the POL-1378-linting-operational branch October 14, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants