Skip to content

Commit 2306a76

Browse files
authored
feat/enhance jira connector (#493)
* support filtering by status * support downloading attachments * update changelog * update fixtures * drop unit test * test attachment download in int test * fix int tests * use attachments data coming in from issue
1 parent ae7bd87 commit 2306a76

File tree

16 files changed

+273
-639
lines changed

16 files changed

+273
-639
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 1.0.22-dev1
1+
## 1.0.23
22

33
* **Migrate to new Mixedbread Python SDK**
4+
* **Support better filtering in jira connector and downloading attachments**
45

56
## 1.0.22
67

test/integration/connectors/expected_results/jira/directory_structure.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"JCTP1/10001.txt",
55
"JCTP1/10002.txt",
66
"JCTP1/10013.txt",
7+
"JCTP1/attachments/10000.png",
78
"JCTP2/10003.txt",
89
"JCTP2/10004.txt",
910
"JCTP2/10005.txt",
Loading

test/integration/connectors/expected_results/jira/file_data/10000.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10000",
14-
"key": "JCTP1-1",
15-
"board_id": null,
16-
"project_id": "JCTP1"
14+
"key": "JCTP1-1"
1715
},
1816
"date_created": "2023-08-22T11:29:37.774+0000",
1917
"date_modified": "2025-02-21T13:25:46.017+0000",
20-
"date_processed": "1744387765.651267",
18+
"date_processed": "1745877948.008202",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10000",
26-
"key": "JCTP1-1",
27-
"board_id": null,
28-
"project_id": "JCTP1"
24+
"key": "JCTP1-1"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP1/10000.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP1/10000.txt",
3228
"display_name": "Jira Connector Test Project 1"
3329
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"identifier": "10000a",
3+
"connector_type": "jira",
4+
"source_identifiers": {
5+
"filename": "image-20230823-143650.png",
6+
"fullpath": "10000/image-20230823-143650.png",
7+
"rel_path": null
8+
},
9+
"metadata": {
10+
"url": "https://unstructured-jira-connector-test.atlassian.net/rest/api/2/attachment/10000",
11+
"version": null,
12+
"record_locator": {
13+
"id": "10000",
14+
"filename": "image-20230823-143650.png",
15+
"author": {
16+
"self": "https://unstructured-jira-connector-test.atlassian.net/rest/api/2/user?accountId=712020%3A7bc7fdcb-67e7-435d-b4a2-128aee12820c",
17+
"accountId": "712020:7bc7fdcb-67e7-435d-b4a2-128aee12820c",
18+
"emailAddress": "devops+jira-connector@unstructured.io",
19+
"avatarUrls": {
20+
"48x48": "https://secure.gravatar.com/avatar/04abdb66f320c5c8cb47d9671ab8e20c?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FUD-1.png",
21+
"24x24": "https://secure.gravatar.com/avatar/04abdb66f320c5c8cb47d9671ab8e20c?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FUD-1.png",
22+
"16x16": "https://secure.gravatar.com/avatar/04abdb66f320c5c8cb47d9671ab8e20c?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FUD-1.png",
23+
"32x32": "https://secure.gravatar.com/avatar/04abdb66f320c5c8cb47d9671ab8e20c?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FUD-1.png"
24+
},
25+
"displayName": "Unstructured Devops",
26+
"active": true,
27+
"timeZone": "Etc/GMT",
28+
"accountType": "atlassian"
29+
},
30+
"mimeType": "image/png",
31+
"content": "https://unstructured-jira-connector-test.atlassian.net/rest/api/2/attachment/content/10000",
32+
"thumbnail": "https://unstructured-jira-connector-test.atlassian.net/rest/api/2/attachment/thumbnail/10000"
33+
},
34+
"date_created": "2023-08-23T14:37:07.577+0000",
35+
"date_modified": "2025-02-21T13:25:46.017+0000",
36+
"date_processed": "1745877948.008202",
37+
"permissions_data": null,
38+
"filesize_bytes": 516618
39+
},
40+
"additional_metadata": {
41+
"id": "10000",
42+
"key": "JCTP1-1"
43+
},
44+
"reprocess": false,
45+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP1/attachments/10000.png",
46+
"display_name": "Jira Connector Test Project 1"
47+
}

test/integration/connectors/expected_results/jira/file_data/10001.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10001",
14-
"key": "JCTP1-2",
15-
"board_id": null,
16-
"project_id": "JCTP1"
14+
"key": "JCTP1-2"
1715
},
1816
"date_created": "2023-08-22T11:29:43.033+0000",
1917
"date_modified": "2023-08-24T12:03:31.591+0000",
20-
"date_processed": "1744387766.059646",
18+
"date_processed": "1745877950.036449",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10001",
26-
"key": "JCTP1-2",
27-
"board_id": null,
28-
"project_id": "JCTP1"
24+
"key": "JCTP1-2"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP1/10001.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP1/10001.txt",
3228
"display_name": "Jira Connector Test Project 1"
3329
}

test/integration/connectors/expected_results/jira/file_data/10002.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10002",
14-
"key": "JCTP1-3",
15-
"board_id": null,
16-
"project_id": "JCTP1"
14+
"key": "JCTP1-3"
1715
},
1816
"date_created": "2023-08-22T11:29:46.189+0000",
1917
"date_modified": "2023-08-23T14:36:31.252+0000",
20-
"date_processed": "1744387766.421783",
18+
"date_processed": "1745877950.495379",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10002",
26-
"key": "JCTP1-3",
27-
"board_id": null,
28-
"project_id": "JCTP1"
24+
"key": "JCTP1-3"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP1/10002.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP1/10002.txt",
3228
"display_name": "Jira Connector Test Project 1"
3329
}

test/integration/connectors/expected_results/jira/file_data/10003.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10003",
14-
"key": "JCTP2-1",
15-
"board_id": null,
16-
"project_id": "JCTP2"
14+
"key": "JCTP2-1"
1715
},
1816
"date_created": "2023-08-22T11:32:09.040+0000",
1917
"date_modified": "2023-09-29T05:55:11.447+0000",
20-
"date_processed": "1744387767.135543",
18+
"date_processed": "1745877946.192489",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10003",
26-
"key": "JCTP2-1",
27-
"board_id": null,
28-
"project_id": "JCTP2"
24+
"key": "JCTP2-1"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP2/10003.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP2/10003.txt",
3228
"display_name": "Jira Connector Test Project 2"
3329
}

test/integration/connectors/expected_results/jira/file_data/10004.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10004",
14-
"key": "JCTP2-2",
15-
"board_id": null,
16-
"project_id": "JCTP2"
14+
"key": "JCTP2-2"
1715
},
1816
"date_created": "2023-08-22T11:32:15.109+0000",
1917
"date_modified": "2023-09-29T05:55:11.351+0000",
20-
"date_processed": "1744387767.493439",
18+
"date_processed": "1745877946.676437",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10004",
26-
"key": "JCTP2-2",
27-
"board_id": null,
28-
"project_id": "JCTP2"
24+
"key": "JCTP2-2"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP2/10004.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP2/10004.txt",
3228
"display_name": "Jira Connector Test Project 2"
3329
}

test/integration/connectors/expected_results/jira/file_data/10005.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10005",
14-
"key": "JCTP2-3",
15-
"board_id": null,
16-
"project_id": "JCTP2"
14+
"key": "JCTP2-3"
1715
},
1816
"date_created": "2023-08-22T11:32:18.249+0000",
1917
"date_modified": "2023-08-22T11:32:21.717+0000",
20-
"date_processed": "1744387767.834472",
18+
"date_processed": "1745877947.087476",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10005",
26-
"key": "JCTP2-3",
27-
"board_id": null,
28-
"project_id": "JCTP2"
24+
"key": "JCTP2-3"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP2/10005.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP2/10005.txt",
3228
"display_name": "Jira Connector Test Project 2"
3329
}

test/integration/connectors/expected_results/jira/file_data/10013.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10013",
14-
"key": "JCTP1-4",
15-
"board_id": null,
16-
"project_id": "JCTP1"
14+
"key": "JCTP1-4"
1715
},
1816
"date_created": "2023-08-24T12:04:35.328+0000",
1917
"date_modified": "2023-08-24T12:04:47.543+0000",
20-
"date_processed": "1744387766.776047",
18+
"date_processed": "1745877950.902464",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10013",
26-
"key": "JCTP1-4",
27-
"board_id": null,
28-
"project_id": "JCTP1"
24+
"key": "JCTP1-4"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP1/10013.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP1/10013.txt",
3228
"display_name": "Jira Connector Test Project 1"
3329
}

test/integration/connectors/expected_results/jira/file_data/10014.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
"version": null,
1212
"record_locator": {
1313
"id": "10014",
14-
"key": "JCTP3-1",
15-
"board_id": "3",
16-
"project_id": "JCTP3"
14+
"key": "JCTP3-1"
1715
},
1816
"date_created": "2023-08-24T13:38:35.057+0000",
1917
"date_modified": "2023-08-24T13:39:02.055+0000",
20-
"date_processed": "1744387765.2460768",
18+
"date_processed": "1745877944.5975628",
2119
"permissions_data": null,
2220
"filesize_bytes": null
2321
},
2422
"additional_metadata": {
2523
"id": "10014",
26-
"key": "JCTP3-1",
27-
"board_id": "3",
28-
"project_id": "JCTP3"
24+
"key": "JCTP3-1"
2925
},
3026
"reprocess": false,
31-
"local_download_path": "/private/var/folders/h7/n848df9s5yn7ml8rxb61vhyc0000gp/T/tmps1z7p7az/JCTP3/10014.txt",
27+
"local_download_path": "/private/var/folders/n8/rps3wl195pj4p_0vyxqj5jrw0000gn/T/tmphmteub8f/JCTP3/10014.txt",
3228
"display_name": "Jira Connector Test Project 3 - Company Managed Project"
3329
}

test/integration/connectors/test_jira.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def test_jira_source(temp_dir):
4343
)
4444
index_config = JiraIndexerConfig(projects=projects, boards=boards, issues=issues)
4545

46-
download_config = JiraDownloaderConfig(download_dir=temp_dir)
46+
download_config = JiraDownloaderConfig(download_dir=temp_dir, download_attachments=True)
4747

4848
# Instantiate indexer and downloader
4949
indexer = JiraIndexer(
@@ -61,7 +61,7 @@ async def test_jira_source(temp_dir):
6161
downloader=downloader,
6262
configs=SourceValidationConfigs(
6363
test_id="jira",
64-
expected_num_files=8,
64+
expected_num_files=9,
6565
validate_file_data=True,
6666
validate_downloaded_files=True,
6767
),

0 commit comments

Comments
 (0)