launchpy 0.5.4__tar.gz → 0.5.4.post1__tar.gz

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.
Files changed (37) hide show
  1. {launchpy-0.5.4 → launchpy-0.5.4.post1}/PKG-INFO +1 -1
  2. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/cli.md +164 -16
  3. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/releases.md +3 -1
  4. launchpy-0.5.4.post1/launchpy/__version__.py +1 -0
  5. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/cli/__main__.py +1 -1
  6. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy.egg-info/PKG-INFO +1 -1
  7. {launchpy-0.5.4 → launchpy-0.5.4.post1}/tests/test_synchronizer.py +40 -1
  8. launchpy-0.5.4/launchpy/__version__.py +0 -1
  9. {launchpy-0.5.4 → launchpy-0.5.4.post1}/LICENSE +0 -0
  10. {launchpy-0.5.4 → launchpy-0.5.4.post1}/README.md +0 -0
  11. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/admin.md +0 -0
  12. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/getstarted.md +0 -0
  13. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/library.md +0 -0
  14. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/main.md +0 -0
  15. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/property.md +0 -0
  16. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/synchronizer.md +0 -0
  17. {launchpy-0.5.4 → launchpy-0.5.4.post1}/docs/translator.md +0 -0
  18. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/__init__.py +0 -0
  19. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/admin.py +0 -0
  20. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/cli/__init__.py +0 -0
  21. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/config.py +0 -0
  22. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/configs.py +0 -0
  23. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/connector.py +0 -0
  24. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/launchpy.py +0 -0
  25. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/library.py +0 -0
  26. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/property.py +0 -0
  27. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy/synchronizer.py +0 -0
  28. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy.egg-info/SOURCES.txt +0 -0
  29. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy.egg-info/dependency_links.txt +0 -0
  30. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy.egg-info/entry_points.txt +0 -0
  31. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy.egg-info/requires.txt +0 -0
  32. {launchpy-0.5.4 → launchpy-0.5.4.post1}/launchpy.egg-info/top_level.txt +0 -0
  33. {launchpy-0.5.4 → launchpy-0.5.4.post1}/pyproject.toml +0 -0
  34. {launchpy-0.5.4 → launchpy-0.5.4.post1}/requirements.txt +0 -0
  35. {launchpy-0.5.4 → launchpy-0.5.4.post1}/setup.cfg +0 -0
  36. {launchpy-0.5.4 → launchpy-0.5.4.post1}/tests/test_connector.py +0 -0
  37. {launchpy-0.5.4 → launchpy-0.5.4.post1}/tests/test_proxies.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: launchpy
3
- Version: 0.5.4
3
+ Version: 0.5.4.post1
4
4
  Summary: Adobe Launch API wrapper
5
5
  Author-email: Julien Piccini <piccini.julien@gmail.com>
6
6
  License: Apache License 2.0
@@ -50,6 +50,13 @@ This document provides an overview of the command line interface (CLI) for `laun
50
50
  - [sync\_from\_library](#sync_from_library)
51
51
  - [Behaviors for sync\_from\_library](#behaviors-for-sync_from_library)
52
52
  - [create\_libraries](#create_libraries)
53
+ - [Multi-Organization Synchronization](#multi-organization-synchronization)
54
+ - [1. Create and populate a multi-org config file](#1-create-and-populate-a-multi-org-config-file)
55
+ - [2. Connect the CLI with the multi-org config](#2-connect-the-cli-with-the-multi-org-config)
56
+ - [3. Load the synchronizer across organizations](#3-load-the-synchronizer-across-organizations)
57
+ - [4. End-to-end cross-org synchronization workflow](#4-end-to-end-cross-org-synchronization-workflow)
58
+ - [5. Dynamic component filtering across organizations](#5-dynamic-component-filtering-across-organizations)
59
+ - [6. Multi-org limitations and notes](#6-multi-org-limitations-and-notes)
53
60
 
54
61
 
55
62
 
@@ -343,29 +350,23 @@ synchronizer:Base_Property_Name>
343
350
  ```
344
351
 
345
352
  **Synchronizing across organizations**\
346
- The synchronizer also supports a base property and/or target properties that live in a *different* Adobe organization than the one currently active in the CLI. This is useful when you manage several IMS orgs and want to push the same rules, data elements and extensions from a single base property to properties in other orgs.
353
+ The synchronizer supports a base property and/or target properties across multiple Adobe IMS organizations. Append `@<org_name>` to any property name to resolve it against that `org_name` entry from a multi-org config file (see [create_config_file](#create_config_file)).
347
354
 
348
- To reference a property in another organization, append `@<org_name>` to its name, where `<org_name>` matches an `org_name` entry from a multi-org config file (see [create_config_file](#create_config_file)). Any property name without `@<org_name>` is resolved against the organization that is currently active in the session (the one last set via [config](#config) or [change_org](#change_org)).
355
+ Any property name **without** `@<org_name>` defaults to the **first** organization defined in the multi-org config file (regardless of `--org_name` or `change_org`).
349
356
 
350
- First, load a multi-org config file so every organization you want to reference is available in the session:
351
- ```bash
352
- python -m launchpy.cli -cf <path_to_your_multi_org_config_file> --org_name client_a
353
- launchpy:client_a>
354
- ```
355
-
356
- Then load the synchronizer using `@org_name` on the base and/or the targets:
357
357
  ```bash
358
+ python -m launchpy.cli -cf <path_to_your_multi_org_config_file>
358
359
  launchpy:client_a> load_synchronizer "Base Property Name@client_a" -t "Target Property 1@client_b" "Target Property 2@client_c"
359
- synchronizer:Base_Property_Name>
360
+ synchronizer:Base Property Name>
360
361
  ```
361
362
 
362
- Organizations can be mixed freely; targets that omit `@org_name` resolve to the currently active organization (`client_a` below):
363
+ Organizations can be mixed freely; properties omitting `@org_name` resolve to the first organization in the config file (`client_a` below):
363
364
  ```bash
364
365
  launchpy:client_a> load_synchronizer "Base Property Name" -t "Target Property 1" "Target Property 2@client_b"
365
- synchronizer:Base_Property_Name>
366
+ synchronizer:Base Property Name>
366
367
  ```
367
368
 
368
- **Note**: if a private extension used by the base property is named differently in a target organization, the CLI cannot map the two names for you — this requires passing a `mapping_extensions` dictionary (`{"target-extension-name": "base-extension-name"}`) to `launchpy.Synchronizer` directly through the Python API, usually done via a Notebook, since that option is not exposed as a CLI flag.
369
+ See [Multi-Organization Synchronization](#multi-organization-synchronization) for the complete end-to-end workflow, dynamic filtering behavior, and cross-org limitations.
369
370
 
370
371
  ### Property Layer Commands
371
372
 
@@ -675,11 +676,158 @@ Arguments:
675
676
  `-env`, `--environment`: String. If set to `True`, it will try to find a free environment and assign it to the library. If none is available, it will not assign any environment to the library. If the name of the environment is provided, it will try to assign it to that library. If the environment is already used in a Library, it will remove that association and assign it to the new library. Default False. Possible values: `True`, `False` or a `string` which is the (partial) name of the environment you want to assign to the library.
676
677
 
677
678
  ```bash
678
- synchronizer:Base_Property_Name> create_library "Library Name" -env True
679
+ synchronizer:Base_Property_Name> create_libraries "Library Name" -env True
680
+ ```
681
+
682
+ ```bash
683
+ synchronizer:Base_Property_Name> create_libraries "Library Name" -env "Environment Name"
684
+ ```
685
+
686
+ ### Multi-Organization Synchronization
687
+
688
+ The `launchpy` CLI can synchronize extensions, data elements, rules, and libraries from a base property in one Adobe IMS organization to target properties in one or more other IMS organizations within a single interactive session.
689
+
690
+ #### 1. Create and populate a multi-org config file
691
+
692
+ Generate a multi-org configuration template from the main CLI prompt:
693
+
694
+ ```bash
695
+ python -m launchpy.cli
696
+ (Cmd) create_config_file --multi_org -fn multi_org_config.json
697
+ ```
698
+
699
+ Add `--proxy` (`-p`) if you also want a `"proxy"` placeholder added to the template.
700
+
701
+ Unlike a single-org config file (a JSON object), a multi-org config file is a **JSON array** where each element represents one IMS organization and **must** include a unique `"org_name"` alias:
702
+
703
+ ```json
704
+ [
705
+ {
706
+ "org_id": "11111111111111110A495C00@AdobeOrg",
707
+ "client_id": "<client_id_source>",
708
+ "secret": "<secret_source>",
709
+ "scopes": "openid,AdobeID,read_organizations,additional_info.projectedProductContext,additional_info.job_function,https://ims-na1.adobelogin.com/s/ent_reactor_admin_sdk",
710
+ "org_name": "org_source"
711
+ },
712
+ {
713
+ "org_id": "22222222222222220A495C00@AdobeOrg",
714
+ "client_id": "<client_id_eu>",
715
+ "secret": "<secret_eu>",
716
+ "scopes": "openid,AdobeID,read_organizations,additional_info.projectedProductContext,additional_info.job_function,https://ims-na1.adobelogin.com/s/ent_reactor_admin_sdk",
717
+ "org_name": "org_eu",
718
+ "proxy": "http://proxy.example.com:8080"
719
+ },
720
+ {
721
+ "org_id": "33333333333333330A495C00@AdobeOrg",
722
+ "client_id": "<client_id_us>",
723
+ "secret": "<secret_us>",
724
+ "scopes": "openid,AdobeID,read_organizations,additional_info.projectedProductContext,additional_info.job_function,https://ims-na1.adobelogin.com/s/ent_reactor_admin_sdk",
725
+ "org_name": "org_us"
726
+ }
727
+ ]
679
728
  ```
680
729
 
730
+ * `org_name` is a short alias you choose (for example `org_source`, `client_a`), **not** the Adobe `org_id` (`...@AdobeOrg`). Do **not** include `@` in `org_name`.
731
+ * Each entry can use `client_id` (or legacy `api_key`) and an optional per-organization `proxy`.
732
+
733
+ #### 2. Connect the CLI with the multi-org config
734
+
735
+ Load the multi-org file either when launching the CLI (`launchpy` or `python -m launchpy.cli`) or interactively with `config`:
736
+
681
737
  ```bash
682
- synchronizer:Base_Property_Name> create_library "Library Name" -env "Environment Name
738
+ python -m launchpy.cli -cf multi_org_config.json
739
+ launchpy:org_source>
740
+ ```
683
741
 
742
+ Or interactively:
743
+
744
+ ```text
745
+ (Cmd) config -cf multi_org_config.json -on org_source
746
+ launchpy:org_source>
684
747
  ```
685
-
748
+
749
+ All organizations in the JSON array are registered in memory at once. Before starting the synchronizer, you can optionally verify property names in each organization using `change_org` and `get_properties`:
750
+
751
+ ```text
752
+ launchpy:org_source> get_properties
753
+ launchpy:org_source> change_org org_eu
754
+ launchpy:org_eu> get_properties
755
+ ```
756
+
757
+ #### 3. Load the synchronizer across organizations
758
+
759
+ Run `load_synchronizer` from the main shell (`launchpy:<org_name>>`) using `<Property Name>@<org_name>` for any base or target property:
760
+
761
+ ```text
762
+ launchpy:org_source> load_synchronizer "Global Template@org_source" -t "Brand Web@org_eu" "Brand Web@org_us"
763
+ synchronizer:Global Template>
764
+ ```
765
+
766
+ **Organization resolution rules:**
767
+ * **With `@<org_name>`** (`"Property Name@org_eu"`): `launchpy` creates a dedicated connector for `org_eu` and looks up `"Property Name"` in that organization.
768
+ * **Without `@<org_name>`** (`"Property Name"`): `launchpy` resolves the property against the **first organization** in the multi-org config file (`org_source` in the example above). Changing the active CLI prompt via `--org_name` or `change_org` does **not** change this default fallback.
769
+ * **Prompt and target identifiers**:
770
+ * The synchronizer prompt strips `@<org_name>` from the base property (`synchronizer:Global Template>`).
771
+ * Target identifiers keep their exact input string (`"Brand Web@org_eu"`, `"Brand Web@org_us"`), which you can inspect with `get_targets`. Because `@<org_name>` stays part of each target key, target properties in different organizations can safely share the exact same property name.
772
+
773
+ #### 4. End-to-end cross-org synchronization workflow
774
+
775
+ Once inside `synchronizer:<Base Property>>`, all synchronizer commands automatically route API calls and translate extension/rule IDs per target organization:
776
+
777
+ ```text
778
+ # 1. Verify configured targets
779
+ synchronizer:Global Template> get_targets
780
+
781
+ # 2. Install/align extensions in target orgs first (required before syncing dependent components)
782
+ synchronizer:Global Template> sync_extensions -c -v
783
+ synchronizer:Global Template> upgrade_extension "core" -v
784
+
785
+ # 3. Compare a component across target orgs before syncing
786
+ synchronizer:Global Template> check_component -n "DE - Page Name" -p
787
+
788
+ # 4a. Sync data elements and rules (skipping disabled source components)
789
+ synchronizer:Global Template> sync_data_elements -c -p -i -v
790
+ synchronizer:Global Template> sync_rules -c -p -i -v
791
+
792
+ # 4b. Or preview and sync everything from a specific library in the base property
793
+ synchronizer:Global Template> sync_from_library -n "Release 2026.11" -dr True
794
+ synchronizer:Global Template> sync_from_library -n "Release 2026.11" -c True -v True
795
+
796
+ # 5. Bundle all synced changes into a development library in each target org and build it
797
+ synchronizer:Global Template> create_libraries "Cross-Org Sync 2026.11" -env True
798
+
799
+ # 6. Return to the main CLI prompt
800
+ synchronizer:Global Template> exit
801
+ ```
802
+
803
+ #### 5. Dynamic component filtering across organizations
804
+
805
+ If you pass `-dy "<Data Element Name>"` to `load_synchronizer`, the JSON filter rules are read from that Data Element in the **base** property:
806
+
807
+ ```text
808
+ launchpy:org_source> load_synchronizer "Global Template@org_source" -t "Brand Web@org_eu" "Brand Web@org_us" -dy "DE - Sync Config"
809
+ ```
810
+
811
+ Each filter object's `"targetProperties"` regular expression is matched (`re.search`) against the **target key** stored in the synchronizer — including `@<org_name>` when `@<org_name>` was specified in `-t`. For example, you can exclude GDPR-specific rules for US organization targets:
812
+
813
+ ```json
814
+ [
815
+ {
816
+ "name": "US exclusions",
817
+ "targetProperties": "@org_us$",
818
+ "exclComponents": ["^RL - GDPR .*"],
819
+ "inclComponents": []
820
+ }
821
+ ]
822
+ ```
823
+
824
+ If you write a `"targetProperties"` regex with an end-of-string anchor (`$`), remember to include `@<org_name>` when targets are loaded with `@<org_name>`.
825
+
826
+ #### 6. Multi-org limitations and notes
827
+
828
+ * **First organization credentials are always queried on init**: `Synchronizer` initializes a default `Admin` connection against the first organization in the config file even when `base` and all `targets` include `@<org_name>`, so ensure the first entry in your multi-org config file has valid credentials.
829
+ * **No `@` in property names or `org_name`**: `@` is split using `split('@')`, so neither `org_name` nor property names passed with `@<org_name>` may contain `@`.
830
+ * **Unique component names & aligned extensions**: Rules and data elements are matched by exact name across organizations, and any extension referenced by synced rules or data elements must exist in the target property (use `sync_extensions -c` for catalog extensions).
831
+ * **Private extensions**:
832
+ * A private extension published only to one IMS organization cannot be auto-installed in another IMS organization unless its package is also available there.
833
+ * If equivalent private extensions have **different names** in two organizations, the CLI cannot map them; use `launchpy.Synchronizer(..., mapping_extensions={"target_ext_name": "base_ext_name"})` from Python instead.
@@ -7,7 +7,9 @@ This has been started after the 0.3.0 release.\
7
7
  * Fixing enabled state handling for rules, data elements, and extensions during synchronization. Before release, state enablement was respected only during -published synchronization.
8
8
  * Ensuring that the verbose flag correctly displays detailed information for all synchronized entities, including those with enabled state changes.
9
9
  * Adding the `ignore_disabled` flag to the synchronization commands to allow skipping disabled source entities.
10
- * Adding `-i` / `--ignore_disabled` flag to the CLI synchronization commands.
10
+ * Adding `-i` / `--ignore_disabled` flag to the CLI synchronization commands.\
11
+ Patch:
12
+ * Fixing the header used in multi-organization API requests.
11
13
 
12
14
 
13
15
  ## 0.5.3
@@ -0,0 +1 @@
1
+ __version__ = "0.5.4-1"
@@ -1189,7 +1189,7 @@ class MainShell(cmd.Cmd):
1189
1189
  for org_name, config in config_objects.items():
1190
1190
  myheaders[org_name] = deepcopy(self.header_template)
1191
1191
  myheaders[org_name]["x-gw-ims-org-id"] = config['org_id']
1192
- myheaders[org_name]["x-gw-ims-org-id"] = config['org_id']
1192
+ myheaders[org_name]["x-api-key"] = config['client_id']
1193
1193
  headers.update(myheaders)
1194
1194
  config_key = args.org_name if args.org_name else config_key
1195
1195
  self._configure_connection(org_name=config_key)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: launchpy
3
- Version: 0.5.4
3
+ Version: 0.5.4.post1
4
4
  Summary: Adobe Launch API wrapper
5
5
  Author-email: Julien Piccini <piccini.julien@gmail.com>
6
6
  License: Apache License 2.0
@@ -1,9 +1,13 @@
1
1
  from copy import deepcopy
2
+ import json
3
+ from pathlib import Path
4
+ import tempfile
2
5
  import threading
3
6
  import unittest
4
7
  from unittest.mock import Mock, patch
5
8
 
6
- from launchpy.cli.__main__ import SynchronizerCLI
9
+ from launchpy.cli.__main__ import MainShell, SynchronizerCLI
10
+ from launchpy.config import config_objects, headers
7
11
  from launchpy.launchpy import Translator
8
12
  from launchpy.property import Property
9
13
  from launchpy.synchronizer import Synchronizer
@@ -423,6 +427,41 @@ class SynchronizerCLITests(unittest.TestCase):
423
427
  getattr(sync, method_name).assert_not_called()
424
428
  self.assertTrue(stderr.write.called)
425
429
 
430
+ def test_interactive_multi_org_config_sets_headers_for_all_organizations(self):
431
+ configs = [
432
+ {
433
+ "org_id": "orgA@AdobeOrg",
434
+ "client_id": "client-a",
435
+ "secret": "secret-a",
436
+ "scopes": "scope-a",
437
+ "org_name": "org_a",
438
+ },
439
+ {
440
+ "org_id": "orgB@AdobeOrg",
441
+ "api_key": "client-b",
442
+ "secret": "secret-b",
443
+ "scopes": "scope-b",
444
+ "org_name": "org_b",
445
+ },
446
+ ]
447
+ with (
448
+ tempfile.TemporaryDirectory() as tmp_dir,
449
+ patch.dict(config_objects, {}, clear=True),
450
+ patch.dict(headers, {}, clear=True),
451
+ patch("launchpy.cli.__main__.console"),
452
+ patch("launchpy.Admin"),
453
+ ):
454
+ config_path = Path(tmp_dir) / "multi_org.json"
455
+ config_path.write_text(json.dumps(configs), encoding="utf-8")
456
+ shell = MainShell()
457
+ shell.do_config(f'--config_file "{config_path}"')
458
+
459
+ self.assertEqual(shell.org_name, "org_a")
460
+ self.assertEqual(headers["org_a"]["x-gw-ims-org-id"], "orgA@AdobeOrg")
461
+ self.assertEqual(headers["org_a"]["x-api-key"], "client-a")
462
+ self.assertEqual(headers["org_b"]["x-gw-ims-org-id"], "orgB@AdobeOrg")
463
+ self.assertEqual(headers["org_b"]["x-api-key"], "client-b")
464
+
426
465
 
427
466
  if __name__ == "__main__":
428
467
  unittest.main()
@@ -1 +0,0 @@
1
- __version__ = "0.5.4"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes