You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Limit action customization to step functions and remove notion of "custom actions" (#591)
Ref #544
* Add model for ActionParams
* Pass `ActionParams` directly to default action and step functions
* Create model for ActionSteps
Use step model to provide defaults
* Remove notion of custom actions
Now, we only allow customization through action steps
* Update documentation
* Remove required_jira_permissions property
Since all projects use the default action now, required Jira permissions
aren't unique per project
* Use `responses` for all Jira service tests
* Add ADR 2
* Remove `BugzillaWebhookAttachment` model
Copy file name to clipboardExpand all lines: docs/actions.md
+7-26Lines changed: 7 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
# Action
2
-
The system reads the actions configuration from a YAML file, one per environment. Each entry controls the synchronization between Bugzilla tickets and the Jira issues.
2
+
The system reads the action configurations from a YAML file, one per environment. Each entry controls the synchronization between Bugzilla tickets and Jira issues.
3
3
4
4
## Configuration
5
5
6
-
Below is a full example of an action configuration:
6
+
Below is an example of an action configuration:
7
7
```yaml
8
8
- whiteboard_tag: example
9
9
bugzilla_user_id: 514230
10
10
description: example configuration
11
-
module: jbi.actions.default
12
11
parameters:
13
12
jira_project_key: EXMPL
14
13
```
@@ -28,33 +27,19 @@ A bit more about the different fields...
28
27
- bool [true, false]
29
28
- default: true
30
29
- If false, matching events will not be synchronized
The `jbi.actions.default` action will take the list of steps to be executed when
50
-
the Webhook is received from configuration.
51
-
When none is specified, it will create or update the Jira issue, publish comments when
52
-
assignee, status, or resolution are changed, or when a comment is posted on the Bugzilla ticket.
40
+
### Parameters
53
41
54
-
It will also set the Jira issue URL in the Bugzilla bug `see_also` field, and add a link
55
-
to the Bugzilla ticket on the Jira issue.
56
-
57
-
**Parameters**
42
+
Parameters are used by `step` functions to control what Bugzilla data is synced with Jira issues. Possible parameters are:
58
43
59
44
- `jira_project_key`(**mandatory**)
60
45
- string
@@ -88,13 +73,12 @@ Minimal configuration:
88
73
jira_project_key: EXMPL
89
74
```
90
75
91
-
Full configuration, that will set assignee, change the Jira issue status and resolution.
76
+
A configuration that will set an assignee and change the Jira issue status and resolution.
92
77
93
78
```yaml
94
79
- whiteboard_tag: fidefe
95
80
bugzilla_user_id: 514230
96
81
description: full configuration
97
-
module: jbi.actions.default
98
82
parameters:
99
83
jira_project_key: FIDEFE
100
84
steps:
@@ -159,6 +143,3 @@ linked Jira issue status to "Closed". If the bug changes to a status not listed
159
143
- `sync_whiteboard_labels`
160
144
- `maybe_update_components`: looks at the component that's set on the bug (if any) and any components added to the project configuration with the `jira_components` parameter (see above). If those components are available on the Jira side as well, they're added to the Jira issue
161
145
162
-
### Custom Actions
163
-
164
-
If you're looking for a unique capability for your team's data flow, you can add your own Python methods and functionality[...read more here.](../jbi/actions/README.md)
When JBI was first designed, we envisioned a scenario where a user might want to contribute a Python module to create an entirely custom sync workflow. As we've continued to make workflow customization easier, we've questioned whether this freedom of customization is worth the added complexity of supporting custom modules and action parameters.
11
+
12
+
## Decision Drivers
13
+
14
+
- Reduce complexity in handling custom modules
15
+
- Prevent bugs due to misconfigured workflows
16
+
- Align with the evolved designs that emphasize customization through combining steps
17
+
18
+
## Considered Options
19
+
20
+
- Option 1: Maintain the ability to customize workflows through custom modules and parameters
21
+
- Option 2: Restrict customization to the default action and validate action parameters with a schema
22
+
23
+
## Decision Outcome
24
+
25
+
Considering the positive consequences of Option 2 and the fact that workflow customization is still possible through action steps, it is reasonable to choose Option 2 to simplify workflow customization and focus on improving the reliability and robustness of a single action.
26
+
27
+
## Pros and Cons of the Options
28
+
29
+
### Option 1: Maintain the ability to customize workflows through custom modules and parameters
30
+
31
+
- Good, because it provides flexibility for users to create entirely custom action workflows
32
+
- Bad, because it increases complexity in handling different parameter structures and custom module configurations
33
+
34
+
### Option 2: Restrict customization to the default action and enforce parameters with a schema
35
+
36
+
- Good, because it validates that configured parameters are useable by step functions
37
+
- Good, because we can safely assume that action parameters are of a certain type
38
+
- Good, because it aligns with the evolved designs that emphasize customization through action steps
39
+
40
+
Option 2 also still provides plenty of freedom to customize an action workflow. One can
41
+
simply supply one large function that contains all of the logic of that action, e.g.
42
+
43
+
```yaml
44
+
parameters:
45
+
jira_project_key: FIDEFE
46
+
steps:
47
+
new:
48
+
- my_giant_big_step
49
+
existing:
50
+
- my_giant_big_step
51
+
```
52
+
53
+
While this is perhaps less "elegant" than the module-based approached, it still provides an equivalent amount of customization.
0 commit comments