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
@@ -12,172 +12,6 @@ System to sync Bugzilla bugs to Jira issues.
12
12
- The events are transformed into Jira issues
13
13
- The system sets the `see_also` field of the Bugzilla bug with the URL to the Jira issue
14
14
15
-
## Action Configuration
16
-
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.
17
-
18
-
19
-
Below is a full example of an action configuration:
20
-
```yaml
21
-
- whiteboard_tag: example
22
-
allow_private: false
23
-
bugzilla_user_id: 514230
24
-
description: example configuration
25
-
module: jbi.actions.default
26
-
parameters:
27
-
jira_project_key: EXMPL
28
-
```
29
-
30
-
A bit more about the different fields...
31
-
- `whiteboard_tag`
32
-
- string
33
-
- The tag to be matched in the Bugzilla `whiteboard` field
34
-
- `allow_private`(optional)
35
-
- bool [true, false]
36
-
- default: false
37
-
- If false bugs that are not public will not be synchronized. Note that in order to synchronize
38
-
private bugs the bugzilla user that JBI runs as must be in the security groups that are making
39
-
the bug private.
40
-
- `bugzilla_user_id`
41
-
- a bugzilla user id, a list of user ids, or a literal "tbd" to signify that no bugzilla user id is available
42
-
- If an issue arises with the workflow, communication will be established with these users
43
-
- Please enter the user information for one or more stakeholders
44
-
- `description`
45
-
- string
46
-
- Please enter a description; for example, team name or project use-case.
47
-
- `enabled`(optional)
48
-
- bool [true, false]
49
-
- default: true
50
-
- If false, matching events will not be synchronized
The `jbi.actions.default` action will take the list of steps to be executed when
70
-
the Webhook is received from configuration.
71
-
When none is specified, it will create or update the Jira issue, publish comments when
72
-
assignee, status, or resolution are changed, or when a comment is posted on the Bugzilla ticket.
73
-
74
-
It will also set the Jira issue URL in the Bugzilla bug `see_also` field, and add a link
75
-
to the Bugzilla ticket on the Jira issue.
76
-
77
-
**Parameters**
78
-
79
-
- `jira_project_key`(**mandatory**)
80
-
- string
81
-
- The Jira project identifier
82
-
- `steps`(optional)
83
-
- mapping [str, list[str]]
84
-
- If defined, the specified steps are executed. The group of steps listed under `new` are executed when a Bugzilla event occurs on a ticket that is unknown to Jira. The steps under `existing`, when the Bugzilla ticket is already linked to a Jira issue. The steps under `comment` when a comment is posted on a linked Bugzilla ticket.
85
-
If one of these groups is not specified, the default steps will be used.
86
-
- `jira_components`(optional)
87
-
- list [str]
88
-
- If defined, the created issues will be assigned the specified components.
89
-
- `sync_whiteboard_labels`(optional)
90
-
- boolean
91
-
- Whether to sync the Bugzilla status whiteboard labels to Jira. Defaults to `true`.
92
-
- `status_map`(optional)
93
-
- mapping [str, str]
94
-
- If defined, map the Bugzilla bug status (or resolution) to Jira issue status
95
-
- `resolution_map`(optional)
96
-
- mapping [str, str]
97
-
- If defined, map the Bugzilla bug resolution to Jira issue resolution
98
-
99
-
Minimal configuration:
100
-
```yaml
101
-
whiteboard_tag: example
102
-
bugzilla_user_id: 514230
103
-
description: minimal configuration
104
-
parameters:
105
-
jira_project_key: EXMPL
106
-
```
107
-
108
-
Full configuration, that will set assignee, change the Jira issue status and resolution.
109
-
110
-
```yaml
111
-
- whiteboard_tag: fidefe
112
-
bugzilla_user_id: 514230
113
-
description: full configuration
114
-
module: jbi.actions.default
115
-
parameters:
116
-
jira_project_key: FIDEFE
117
-
steps:
118
-
new:
119
-
- create_issue
120
-
- maybe_delete_duplicate
121
-
- add_link_to_bugzilla
122
-
- add_link_to_jira
123
-
- maybe_assign_jira_user
124
-
- maybe_update_issue_resolution
125
-
- maybe_update_issue_status
126
-
existing:
127
-
- update_issue
128
-
- add_jira_comments_for_changes
129
-
- maybe_assign_jira_user
130
-
- maybe_update_issue_resolution
131
-
- maybe_update_issue_status
132
-
comment:
133
-
- create_comment
134
-
status_map:
135
-
ASSIGNED: In Progress
136
-
FIXED: Closed
137
-
WONTFIX: Closed
138
-
DUPLICATE: Closed
139
-
INVALID: Closed
140
-
INCOMPLETE: Closed
141
-
WORKSFORME: Closed
142
-
REOPENED: In Progress
143
-
resolution_map:
144
-
FIXED: Done
145
-
DUPLICATE: Duplicate
146
-
WONTFIX: "Won't Do"
147
-
```
148
-
149
-
In this case if the bug changes to the NEW status the action will attempt to set the linked Jira
150
-
issue status to "In Progress". If the bug changes to RESOLVED FIXED it will attempt to set the
151
-
linked Jira issue status to "Closed". If the bug changes to a status not listed in `status_map` then
152
-
no change will be made to the Jira issue.
153
-
### Available Steps
154
-
155
-
- `create_issue`
156
-
- `maybe_delete_duplicate`
157
-
- `add_link_to_bugzilla`
158
-
- `add_link_to_jira`
159
-
- `maybe_assign_jira_user`:
160
-
It will attempt to assign the Jira issue the same person as the bug is assigned to. This relies on
161
-
the user using the same email address in both Bugzilla and Jira. If the user does not exist in Jira
162
-
then the assignee is cleared from the Jira issue. The Jira account that JBI uses requires the "Browse
163
-
users and groups" global permission in order to set the assignee.
164
-
- `maybe_update_issue_resolution`:
165
-
If the Bugzilla ticket resolution field is specified in the `resolution_map` parameter, it will set the
166
-
Jira issue resolution.
167
-
- `maybe_update_issue_status`:
168
-
If the Bugzilla ticket status field is specified in the `status_map` parameter, it will set the
169
-
Jira issue status.
170
-
- `update_issue`
171
-
- `add_jira_comments_for_changes`
172
-
- `maybe_assign_jira_user`
173
-
- `maybe_update_issue_resolution`
174
-
- `maybe_update_issue_status`
175
-
- `create_comment`
176
-
177
-
### Custom Actions
178
-
179
-
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)
180
-
181
15
## Diagram Overview
182
16
183
17
```mermaid
@@ -195,142 +29,27 @@ graph TD
195
29
end
196
30
```
197
31
198
-
## Development
199
-
200
-
- `make start`: run the application locally (http://localhost:8000)
201
-
- `make test`: run the unit tests suites
202
-
- `make lint`: static analysis of the code base
203
-
204
-
You may consider:
205
-
206
-
* Tweaking the application settings in the `.env` file (See `src/app/environment.py` for details)
207
-
* Installing a pre-commit hook to lint your changes with `pre-commit install`
208
-
209
-
## Deployment
210
-
211
-
Software and configuration are deployed automatically:
In order to verify that a certain commit was deployed, check that the Github Actions executed successfully on the commit, and use the *Version* endpoint:
In order to verify that a certain action is configured correctly and enabled, use the *Powered By JBI* endpoint: [https://${SERVER}/powered_by_jbi](https://jbi.services.mozilla.com/powered_by_jbi)
252
-
253
-
For the list of configured whiteboard tags:
254
-
255
-
```
256
-
GET /whiteboard_tags/
257
-
{
258
-
"addons": {
259
-
"whiteboard_tag": "addons",
260
-
"bugzilla_user_id": 514230,
261
-
"description": "Addons whiteboard tag for AMO Team",
262
-
"enabled": true,
263
-
"module": "jbi.actions.default",
264
-
"parameters": {
265
-
"jira_project_key": "WEBEXT"
266
-
}
267
-
}
268
-
...
269
-
}
270
-
```
271
-
272
-
## Troubleshooting
273
-
274
-
### Bugzilla tickets are not showing up as issues on Jira
275
-
276
-
As a consumer, you can:
277
-
278
-
- Open https://jbi.services.mozilla.com/powered_by_jbi/ and check that your project is listed and enabled there
279
-
- Open https://jbi.services.mozilla.com/__heartbeat__ and make sure everything is `true`
32
+
## Documentation
280
33
281
-
If you have access to the configured Bugzilla account:
34
+
*[Actions](docs/actions.md)
35
+
*[Deployment](docs/deployment.md)
36
+
*[Troubleshooting](docs/troubleshooting.md)
282
37
283
-
- Open https://bugzilla.mozilla.org/userprefs.cgi?tab=webhooks
284
-
- Check that Webhook is still **enabled**
285
-
- Check that WebHook is setup to be executed for your product
286
-
- (*if applies*) Check that account can read the private bugs
38
+
## Usage
287
39
288
-
### Log Explorer Queries Examples
40
+
### How to onboard a new project?
289
41
290
-
* All incoming WebHooks:
42
+
1. Add an entry for your whiteboard tag (eg. `famous-product`) in the [actions configuration files](config/). See [actions documentation](docs/actions.md))
43
+
2. Open a pull-request with your action configuration changes
44
+
3. Open a ticket to request the appropriate permissions to be given to the bot account (`Jira Automation`) on the Jira project ([example ticket](https://mozilla-hub.atlassian.net/servicedesk/customer/portal/4/SDD-12038))
291
45
292
-
```
293
-
jsonPayload.Type="request.summary"
294
-
jsonPayload.Fields.path="/bugzilla_webhook"
295
-
```
296
-
297
-
* All action log entries:
46
+
# Development
298
47
299
-
```
300
-
jsonPayload.Type!="request.summary" AND
301
-
(
302
-
NOT jsonPayload.Fields.operation:* --Entries without `operation` field
303
-
OR (jsonPayload.Fields.operation!="handle" AND jsonPayload.Fields.operation!="ignore")
304
-
)
305
-
```
306
-
307
-
* For bugs whose whiteboard contains a certain string:
0 commit comments