qontract-reconcile 0.10.1rc764__py3-none-any.whl → 0.10.1rc765__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qontract_reconcile-0.10.1rc764.dist-info → qontract_reconcile-0.10.1rc765.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc764.dist-info → qontract_reconcile-0.10.1rc765.dist-info}/RECORD +16 -31
- reconcile/saas_auto_promotions_manager/meta.py +1 -1
- reconcile/saas_auto_promotions_manager/subscriber.py +52 -2
- reconcile/saas_auto_promotions_manager/utils/saas_files_inventory.py +4 -0
- reconcile/test/saas_auto_promotions_manager/conftest.py +63 -0
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/conftest.py +0 -37
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/test_desired_state.py +20 -14
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/conftest.py +0 -43
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_multiple_namespaces.py +4 -11
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_single_namespace.py +12 -19
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_single_target.py +6 -12
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_json_path_selector.py +8 -15
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/data_keys.py +0 -4
- reconcile/test/saas_auto_promotions_manager/subscriber/__init__.py +0 -0
- reconcile/test/saas_auto_promotions_manager/subscriber/conftest.py +0 -89
- reconcile/test/saas_auto_promotions_manager/subscriber/data_keys.py +0 -11
- reconcile/test/saas_auto_promotions_manager/subscriber/test_content_hash.py +0 -130
- reconcile/test/saas_auto_promotions_manager/subscriber/test_diff.py +0 -161
- reconcile/test/saas_auto_promotions_manager/subscriber/test_multiple_channels_config_hash.py +0 -218
- reconcile/test/saas_auto_promotions_manager/subscriber/test_multiple_channels_moving_ref.py +0 -216
- reconcile/test/saas_auto_promotions_manager/subscriber/test_multiple_publishers_moving_ref.py +0 -129
- reconcile/test/saas_auto_promotions_manager/subscriber/test_single_channel_with_single_publisher.py +0 -330
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/__init__.py +0 -0
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_multiple_publishers_for_single_channel.py +0 -68
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_use_target_config_hash.py +0 -62
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_with_auto_promote.py +0 -73
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_without_auto_promote.py +0 -64
- {qontract_reconcile-0.10.1rc764.dist-info → qontract_reconcile-0.10.1rc765.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc764.dist-info → qontract_reconcile-0.10.1rc765.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc764.dist-info → qontract_reconcile-0.10.1rc765.dist-info}/top_level.txt +0 -0
@@ -1,68 +0,0 @@
|
|
1
|
-
from collections.abc import (
|
2
|
-
Callable,
|
3
|
-
Iterable,
|
4
|
-
Mapping,
|
5
|
-
)
|
6
|
-
|
7
|
-
from reconcile.saas_auto_promotions_manager.utils.saas_files_inventory import (
|
8
|
-
SaasFilesInventory,
|
9
|
-
)
|
10
|
-
from reconcile.typed_queries.saas_files import SaasFile
|
11
|
-
|
12
|
-
|
13
|
-
def test_multiple_publishers_for_single_channel(
|
14
|
-
saas_files_builder: Callable[[Iterable[Mapping]], list[SaasFile]],
|
15
|
-
):
|
16
|
-
saas_files = saas_files_builder([
|
17
|
-
{
|
18
|
-
"path": "/saas1.yml",
|
19
|
-
"name": "saas_1",
|
20
|
-
"resourceTemplates": [
|
21
|
-
{
|
22
|
-
"name": "template_1",
|
23
|
-
"url": "repo1/url",
|
24
|
-
"targets": [
|
25
|
-
{
|
26
|
-
"ref": "main",
|
27
|
-
"namespace": {"path": "/namespace1.yml"},
|
28
|
-
"promotion": {
|
29
|
-
"publish": ["channel-a"],
|
30
|
-
},
|
31
|
-
},
|
32
|
-
{
|
33
|
-
"ref": "main",
|
34
|
-
"namespace": {"path": "/namespace2.yml"},
|
35
|
-
"promotion": {
|
36
|
-
"publish": ["channel-a"],
|
37
|
-
},
|
38
|
-
},
|
39
|
-
],
|
40
|
-
}
|
41
|
-
],
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"path": "/saas2.yml",
|
45
|
-
"name": "saas_2",
|
46
|
-
"resourceTemplates": [
|
47
|
-
{
|
48
|
-
"name": "template_2",
|
49
|
-
"url": "repo2/url",
|
50
|
-
"targets": [
|
51
|
-
{
|
52
|
-
"ref": "main",
|
53
|
-
"namespace": {"path": "/namespace3.yml"},
|
54
|
-
"promotion": {
|
55
|
-
"subscribe": ["channel-a"],
|
56
|
-
"auto": True,
|
57
|
-
},
|
58
|
-
}
|
59
|
-
],
|
60
|
-
}
|
61
|
-
],
|
62
|
-
},
|
63
|
-
])
|
64
|
-
inventory = SaasFilesInventory(saas_files=saas_files)
|
65
|
-
|
66
|
-
assert len(inventory.publishers) == 3
|
67
|
-
assert len(inventory.publishers_with_subscribers) == 2
|
68
|
-
assert len(inventory.subscribers) == 1
|
@@ -1,62 +0,0 @@
|
|
1
|
-
from collections.abc import (
|
2
|
-
Callable,
|
3
|
-
Iterable,
|
4
|
-
Mapping,
|
5
|
-
)
|
6
|
-
|
7
|
-
from reconcile.saas_auto_promotions_manager.utils.saas_files_inventory import (
|
8
|
-
SaasFilesInventory,
|
9
|
-
)
|
10
|
-
from reconcile.typed_queries.saas_files import SaasFile
|
11
|
-
|
12
|
-
|
13
|
-
def test_use_target_config_hash(
|
14
|
-
saas_files_builder: Callable[[Iterable[Mapping]], list[SaasFile]],
|
15
|
-
):
|
16
|
-
saas_files = saas_files_builder([
|
17
|
-
{
|
18
|
-
"path": "/saas1.yml",
|
19
|
-
"name": "saas_1",
|
20
|
-
"resourceTemplates": [
|
21
|
-
{
|
22
|
-
"name": "template_1",
|
23
|
-
"url": "repo1/url",
|
24
|
-
"targets": [
|
25
|
-
{
|
26
|
-
"ref": "main",
|
27
|
-
"namespace": {"path": "/namespace1.yml"},
|
28
|
-
"promotion": {
|
29
|
-
"publish": ["channel-a"],
|
30
|
-
},
|
31
|
-
}
|
32
|
-
],
|
33
|
-
}
|
34
|
-
],
|
35
|
-
},
|
36
|
-
{
|
37
|
-
"path": "/saas2.yml",
|
38
|
-
"name": "saas_2",
|
39
|
-
"publishJobLogs": True,
|
40
|
-
"resourceTemplates": [
|
41
|
-
{
|
42
|
-
"name": "template_2",
|
43
|
-
"url": "repo2/url",
|
44
|
-
"targets": [
|
45
|
-
{
|
46
|
-
"ref": "main",
|
47
|
-
"namespace": {"path": "/namespace2.yml"},
|
48
|
-
"promotion": {
|
49
|
-
"subscribe": ["channel-a"],
|
50
|
-
"auto": True,
|
51
|
-
},
|
52
|
-
}
|
53
|
-
],
|
54
|
-
}
|
55
|
-
],
|
56
|
-
},
|
57
|
-
])
|
58
|
-
inventory = SaasFilesInventory(saas_files=saas_files)
|
59
|
-
assert len(inventory.publishers) == 2
|
60
|
-
assert len(inventory.publishers_with_subscribers) == 1
|
61
|
-
assert len(inventory.subscribers) == 1
|
62
|
-
assert inventory.subscribers[0]._use_target_config_hash
|
@@ -1,73 +0,0 @@
|
|
1
|
-
from collections.abc import (
|
2
|
-
Callable,
|
3
|
-
Iterable,
|
4
|
-
Mapping,
|
5
|
-
)
|
6
|
-
|
7
|
-
from reconcile.saas_auto_promotions_manager.utils.saas_files_inventory import (
|
8
|
-
SaasFilesInventory,
|
9
|
-
)
|
10
|
-
from reconcile.typed_queries.saas_files import SaasFile
|
11
|
-
|
12
|
-
|
13
|
-
def test_single_channel(
|
14
|
-
saas_files_builder: Callable[[Iterable[Mapping]], list[SaasFile]],
|
15
|
-
):
|
16
|
-
saas_files = saas_files_builder([
|
17
|
-
{
|
18
|
-
"path": "/saas1.yml",
|
19
|
-
"name": "saas_1",
|
20
|
-
"resourceTemplates": [
|
21
|
-
{
|
22
|
-
"name": "template_1",
|
23
|
-
"url": "repo1/url",
|
24
|
-
"targets": [
|
25
|
-
{
|
26
|
-
"ref": "main",
|
27
|
-
"namespace": {"path": "/namespace1.yml"},
|
28
|
-
"promotion": {
|
29
|
-
"publish": ["channel-a"],
|
30
|
-
},
|
31
|
-
}
|
32
|
-
],
|
33
|
-
}
|
34
|
-
],
|
35
|
-
},
|
36
|
-
{
|
37
|
-
"path": "/saas2.yml",
|
38
|
-
"name": "saas_2",
|
39
|
-
"resourceTemplates": [
|
40
|
-
{
|
41
|
-
"name": "template_2",
|
42
|
-
"url": "repo2/url",
|
43
|
-
"targets": [
|
44
|
-
{
|
45
|
-
"ref": "main",
|
46
|
-
"namespace": {"path": "/namespace2.yml"},
|
47
|
-
"promotion": {
|
48
|
-
"subscribe": ["channel-a"],
|
49
|
-
"auto": True,
|
50
|
-
"promotion_data": [
|
51
|
-
{
|
52
|
-
"channel": "channel-a",
|
53
|
-
"data": [
|
54
|
-
{
|
55
|
-
"target_config_hash": "channel-a-hash",
|
56
|
-
"parent_saas": "saas_1",
|
57
|
-
"type": "type",
|
58
|
-
}
|
59
|
-
],
|
60
|
-
}
|
61
|
-
],
|
62
|
-
},
|
63
|
-
}
|
64
|
-
],
|
65
|
-
}
|
66
|
-
],
|
67
|
-
},
|
68
|
-
])
|
69
|
-
inventory = SaasFilesInventory(saas_files=saas_files)
|
70
|
-
assert len(inventory.publishers) == 2
|
71
|
-
assert len(inventory.publishers_with_subscribers) == 1
|
72
|
-
assert len(inventory.subscribers) == 1
|
73
|
-
assert not inventory.subscribers[0]._use_target_config_hash
|
@@ -1,64 +0,0 @@
|
|
1
|
-
from collections.abc import (
|
2
|
-
Callable,
|
3
|
-
Iterable,
|
4
|
-
Mapping,
|
5
|
-
)
|
6
|
-
|
7
|
-
from reconcile.saas_auto_promotions_manager.utils.saas_files_inventory import (
|
8
|
-
SaasFilesInventory,
|
9
|
-
)
|
10
|
-
from reconcile.typed_queries.saas_files import SaasFile
|
11
|
-
|
12
|
-
|
13
|
-
def test_saas_files_without_auto_promote(
|
14
|
-
saas_files_builder: Callable[[Iterable[Mapping]], list[SaasFile]],
|
15
|
-
):
|
16
|
-
saas_files = saas_files_builder([
|
17
|
-
{
|
18
|
-
"path": "/saas1.yml",
|
19
|
-
"name": "saas_1",
|
20
|
-
"resourceTemplates": [
|
21
|
-
{
|
22
|
-
"name": "template_1",
|
23
|
-
"url": "repo1/url",
|
24
|
-
"targets": [
|
25
|
-
{
|
26
|
-
"ref": "main",
|
27
|
-
"namespace": {"path": "/namespace1.yml"},
|
28
|
-
"promotion": {
|
29
|
-
"publish": ["channel-a"],
|
30
|
-
},
|
31
|
-
}
|
32
|
-
],
|
33
|
-
}
|
34
|
-
],
|
35
|
-
},
|
36
|
-
{
|
37
|
-
"path": "/saas2.yml",
|
38
|
-
"name": "saas_2",
|
39
|
-
"resourceTemplates": [
|
40
|
-
{
|
41
|
-
"name": "template_2",
|
42
|
-
"url": "repo2/url",
|
43
|
-
"targets": [
|
44
|
-
{
|
45
|
-
"ref": "main",
|
46
|
-
"namespace": {"path": "/namespace2.yml"},
|
47
|
-
"promotion": {
|
48
|
-
"publish": ["channel-b"],
|
49
|
-
"subscribe": ["channel-a"],
|
50
|
-
},
|
51
|
-
},
|
52
|
-
{
|
53
|
-
"ref": "main",
|
54
|
-
"namespace": {"path": "/namespace3.yml"},
|
55
|
-
},
|
56
|
-
],
|
57
|
-
}
|
58
|
-
],
|
59
|
-
},
|
60
|
-
])
|
61
|
-
inventory = SaasFilesInventory(saas_files=saas_files)
|
62
|
-
assert len(inventory.publishers) == 2
|
63
|
-
assert len(inventory.publishers_with_subscribers) == 0
|
64
|
-
assert len(inventory.subscribers) == 0
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc764.dist-info → qontract_reconcile-0.10.1rc765.dist-info}/top_level.txt
RENAMED
File without changes
|