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
- copy.py: move `import requests` to top-level; use `self.api._get_url_server()`
instead of broken `self.api.server_url`; split HTTPError vs RequestException
handlers for precise error messages
- migrate_users.py: add --url/--source-url args for self-hosted instances;
fix _resolve_server_url (base64 padding, error handling, explicit-URL priority);
require --source-api-key explicitly instead of silently reusing COMET_API_KEY;
warn when source and dest URL+key are identical; handle dict-list API response
in _get_existing_workspaces; show per-user output in dry-run; add
--failures-output flag; use json= kwarg in _add_member; fix docstring examples
- tests/unit/test_migrate_users.py: 17 new unit tests covering _resolve_server_url,
_get_existing_workspaces, _add_member, and dry-run behaviour
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -333,24 +333,25 @@ For more information, `cometx log --help`
333
333
334
334
## cometx migrate-users
335
335
336
-
This command is used to migrate users into workspaces from a source Comet environment to a destination environment. It reads workspace membership from a chargeback report from the source environment and invites each user to the corresponding workspace in the destination environment by email. If a user with the email does not exist in the destination environment, they still will be provisioned access to these workspaces once they sign up using that email.
337
-
338
-
The chargeback report can be fetched automatically from the source environment's admin API, or you can provide a pre-downloaded JSON file.
336
+
This command migrates users into workspaces from a source Comet environment to a destination environment. It reads workspace membership from a chargeback report fetched from the source environment's admin API (or a pre-downloaded local file) and invites each user to the corresponding workspace in the destination environment by email. If a user with that email does not yet exist in the destination, they will be provisioned access once they sign up.
*`--api-key API_KEY` - API key for the destination environment where users will be added. Falls back to `COMET_API_KEY` environment variable if not provided.
347
-
*`--source-api-key SOURCE_API_KEY` - API key for the source environment. Used to fetch the chargeback report. Falls back to `COMET_API_KEY` environment variable if not provided. Required unless `--chargeback-report` is given.
348
-
*`--chargeback-report PATH` - Path to a local chargeback report JSON file. When provided, the report is loaded from this file instead of being fetched from the source environment, and `--source-api-key` is not required.
344
+
*`--api-key API_KEY` - API key for the destination environment. Falls back to `COMET_API_KEY` if not provided.
345
+
*`--url URL` - Base URL of the destination Comet environment (e.g. `https://comet.example.com`). Required for self-hosted instances when the API key does not encode the server URL.
346
+
*`--source-api-key SOURCE_API_KEY` - API key for the source environment. Used to fetch the chargeback report. Required unless `--chargeback-report` is given.
347
+
*`--source-url SOURCE_URL` - Base URL of the source Comet environment. Required for self-hosted source instances when the source API key does not encode the server URL.
348
+
*`--chargeback-report PATH` - Path to a local chargeback report JSON file. When provided, `--source-api-key` is not required.
349
349
350
350
### Flags
351
351
352
-
*`--create-workspaces` - Create workspaces on the destination environment if they don't already exist (default: off)
352
+
*`--create-workspaces` - Create workspaces on the destination if they don't already exist (default: off)
353
353
*`--dry-run` - Print what would happen without making any changes
0 commit comments