Skip to content

Commit b95d6ba

Browse files
authored
Merge pull request #28 from flexera-public/ADD_DOC_LINK
Add doc_link to Lessons
2 parents f8ca983 + b21925c commit b95d6ba

23 files changed

Lines changed: 28 additions & 1 deletion

File tree

.dangerfile/policy_parser.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class PolicyParser
22
DEFINITION_REGEX = /^[[:blank:]]*define[[:blank:]]*([\w_\.]+)[[:blank:]]*\([@$\w _,]*\)[[:blank:]]*.*do/.freeze
33

4-
attr_reader :parsed_info, :parsed_category, :parsed_name, :parsed_severity, :parsed_long_description, :parsed_short_description, :parsed_default_frequency
4+
attr_reader :parsed_info, :parsed_category, :parsed_name, :parsed_severity, :parsed_doc_link, :parsed_long_description, :parsed_short_description, :parsed_default_frequency
55

66
def parse(file)
77
source = File.read(file)
@@ -28,6 +28,10 @@ def severity(severity)
2828
@parsed_severity = severity
2929
end
3030

31+
def doc_link(doc_link)
32+
@parsed_doc_link = doc_link
33+
end
34+
3135
def long_description(long_description)
3236
@parsed_long_description = long_description
3337
end

exercises/01_summation/solution/summation.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Sum of Two Numbers"
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/exercises/01_summation"
67
category "Tutorial"
78
severity "low"
89
default_frequency "weekly"

exercises/02_tutorial_templates/solution/tutorial_templates.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Lists all tutorial policy templates."
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/exercises/02_tutorial_templates"
67
severity "low"
78
category "Tutorial"
89
default_frequency "weekly"

exercises/03_employees/solution/employees.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Lists all employees, their teams, their departments, and their department heads."
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/exercises/03_employees"
67
severity "low"
78
category "Tutorial"
89
default_frequency "weekly"

exercises/04_departments/solution/departments.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Lists all departments, including employee count and budgets."
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/exercises/04_departments"
67
severity "low"
78
category "Tutorial"
89
default_frequency "weekly"

exercises/05_employees_table/solution/employees_table.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Lists all employees, their teams, their departments, and their department heads."
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/exercises/05_employees_table"
67
severity "low"
78
category "Tutorial"
89
default_frequency "weekly"

lessons/02_hello_world/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ rs_pt_ver 20180301
1818
type "policy"
1919
short_description "Hello World"
2020
long_description ""
21+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/lessons/02_hello_world"
2122
category "Tutorial"
2223
severity "low"
2324
default_frequency "weekly"
@@ -33,6 +34,7 @@ To briefly go over what each of these defines:
3334
* `type` simply indicates that this is a policy template and should always be set to "policy"
3435
* `short_description` is a brief description of what the policy template does. This will appear in Flexera One underneath the name when the policy template is uploaded.
3536
* `long_description` is defunct and should always be an empty string.
37+
* `doc_link` contains a link to documentation for the policy template. In this case, we're linking to this lesson.
3638
* `category` is the category of the policy template. In most cases, this will be something like "Cost", "Compliance", "Security", etc.
3739
* `severity` is the default severity level of any incidents raised by the policy template.
3840
* `default_frequency` is the default schedule for the policy template to execute.

lessons/02_hello_world/solution/hello_world.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Hello World"
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/lessons/02_hello_world"
67
category "Tutorial"
78
severity "low"
89
default_frequency "weekly"

lessons/03_parameters/solution/hello_world.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Hello World"
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/lessons/02_hello_world"
67
category "Tutorial"
78
severity "low"
89
default_frequency "weekly"

lessons/04_escalations/solution/hello_world.pt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rs_pt_ver 20180301
33
type "policy"
44
short_description "Hello World"
55
long_description ""
6+
doc_link "https://github.com/flexera-public/policy_engine_training/tree/main/lessons/02_hello_world"
67
category "Tutorial"
78
severity "low"
89
default_frequency "weekly"

0 commit comments

Comments
 (0)