From 7e2693f6e2a17141353552f7634344cfdb8045ca Mon Sep 17 00:00:00 2001 From: Ralph McTeggart Date: Tue, 28 Nov 2023 16:58:05 +0000 Subject: [PATCH 1/5] Changing synchronise -> synchronize --- README.md | 4 ++-- cloudsmith_cli/cli/commands/list_.py | 2 +- cloudsmith_cli/cli/commands/push.py | 10 +++++----- cloudsmith_cli/cli/commands/status.py | 2 +- cloudsmith_cli/cli/decorators.py | 6 +++--- .../cli/tests/commands/test_package_commands.py | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a83a1331..4ec2b1ec 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,8 @@ The CLI currently supports the following commands (and sub-commands): - `get`|`list`|`ls`: List repositories for a user, in a namespace or get details for a specific repository. - `update`: Update a repository in a namespace. - `delete`|`rm`: Delete a repository from a namespace. -- `resync`: Resynchronise a package in a repository. -- `status`: Get the synchronisation status for a package. +- `resync`: Resynchronize a package in a repository. +- `status`: Get the synchronization status for a package. - `tags`: Manage the tags for a package in a repository. - `add`: Add tags to a package in a repository. - `clear`: Clear all existing (non-immutable) tags from a package in a repository. diff --git a/cloudsmith_cli/cli/commands/list_.py b/cloudsmith_cli/cli/commands/list_.py index 1fa5f5af..f71ba833 100644 --- a/cloudsmith_cli/cli/commands/list_.py +++ b/cloudsmith_cli/cli/commands/list_.py @@ -254,7 +254,7 @@ def _get_package_status(package): """Get the status for a package.""" status = package["status_str"] or "Unknown" stage = package["stage_str"] or "Unknown" - if stage == "Fully Synchronised": + if stage == "Fully Synchronized": return status return f"{status} / {stage}" diff --git a/cloudsmith_cli/cli/commands/push.py b/cloudsmith_cli/cli/commands/push.py index c128e6cf..e6fda137 100644 --- a/cloudsmith_cli/cli/commands/push.py +++ b/cloudsmith_cli/cli/commands/push.py @@ -188,7 +188,7 @@ def create_package(ctx, opts, owner, repo, package_type, skip_errors, **kwargs): def wait_for_package_sync( ctx, opts, owner, repo, slug, wait_interval, skip_errors, attempts=3 ): - """Wait for a package to synchronise (or fail).""" + """Wait for a package to synchronize (or fail).""" # pylint: disable=too-many-locals attempts -= 1 click.echo() @@ -208,7 +208,7 @@ def display_status(current): ) start = datetime.now() - context_msg = "Failed to synchronise file!" + context_msg = "Failed to synchronize file!" with handle_api_exceptions( ctx, opts=opts, context_msg=context_msg, reraise_on_error=skip_errors ): @@ -254,14 +254,14 @@ def display_status(current): if ok: click.secho( - "Package synchronised successfully in %(seconds)s second(s)!" + "Package synchronized successfully in %(seconds)s second(s)!" % {"seconds": click.style(str(seconds), bold=True)}, fg="green", ) return click.secho( - "Package failed to synchronise in %(seconds)s during stage: %(stage)s" + "Package failed to synchronize in %(seconds)s during stage: %(stage)s" % { "seconds": click.style(str(seconds), bold=True), "stage": click.style(stage_str or "Unknown", fg="yellow"), @@ -397,7 +397,7 @@ def upload_files_and_create_package( if no_wait_for_sync: return - # 5. (optionally) Wait for the package to synchronise + # 5. (optionally) Wait for the package to synchronize wait_for_package_sync( ctx=ctx, opts=opts, diff --git a/cloudsmith_cli/cli/commands/status.py b/cloudsmith_cli/cli/commands/status.py index 53aa7b03..4122f1bc 100644 --- a/cloudsmith_cli/cli/commands/status.py +++ b/cloudsmith_cli/cli/commands/status.py @@ -22,7 +22,7 @@ @click.pass_context def status(ctx, opts, owner_repo_package): """ - Get the synchronisation status for a package. + Get the synchronization status for a package. - OWNER/REPO/PACKAGE: Specify the OWNER namespace (i.e. user or org), the REPO name where the package is stored, and the PACKAGE name (slug) of the diff --git a/cloudsmith_cli/cli/decorators.py b/cloudsmith_cli/cli/decorators.py index a8b41173..892e80c9 100644 --- a/cloudsmith_cli/cli/decorators.py +++ b/cloudsmith_cli/cli/decorators.py @@ -32,7 +32,7 @@ def common_package_action_options(f): "--no-wait-for-sync", default=False, is_flag=True, - help="Don't wait for package synchronisation to complete before exiting.", + help="Don't wait for package synchronization to complete before exiting.", ) @click.option( "-I", @@ -50,9 +50,9 @@ def common_package_action_options(f): "--sync-attempts", default=3, type=int, - help="Number of times to attempt package synchronisation. If the " + help="Number of times to attempt package synchronization. If the " "package fails the first time, the client will attempt to " - "automatically resynchronise it.", + "automatically resynchronize it.", ) @click.pass_context @functools.wraps(f) diff --git a/cloudsmith_cli/cli/tests/commands/test_package_commands.py b/cloudsmith_cli/cli/tests/commands/test_package_commands.py index 83671b6b..0ecdd281 100644 --- a/cloudsmith_cli/cli/tests/commands/test_package_commands.py +++ b/cloudsmith_cli/cli/tests/commands/test_package_commands.py @@ -55,7 +55,7 @@ def test_push_and_delete_raw_package( for _ in range(10): time.sleep(5) result = runner.invoke(status, args=[org_repo_package], catch_exceptions=False) - if "Fully Synchronised" in result.output: + if "Fully Synchronized" in result.output: break else: raise TimeoutError("Test timed out waiting for package sync") From a16f99571687b1a6d37282dd07f44ec457e005ad Mon Sep 17 00:00:00 2001 From: Ralph McTeggart Date: Tue, 28 Nov 2023 17:02:22 +0000 Subject: [PATCH 2/5] organisation -> organization --- README.md | 6 +++--- cloudsmith_cli/cli/commands/policy/license.py | 2 +- cloudsmith_cli/cli/commands/policy/vulnerability.py | 2 +- cloudsmith_cli/cli/commands/quota/command.py | 2 +- cloudsmith_cli/cli/commands/quota/history.py | 2 +- cloudsmith_cli/cli/commands/quota/quota.py | 2 +- cloudsmith_cli/cli/commands/upstream.py | 8 ++++---- cloudsmith_cli/cli/tests/commands/test_repos.py | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4ec2b1ec..540823e1 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,9 @@ The CLI currently supports the following commands (and sub-commands): - `quarantine`|`block`: Manage quarantined packages in a repository. - `add`: Add a package to quarantine. - `remove`|`rm`|`restore`: Add a package to quarantine. -- `quota`: Quota limits and history for a organisation. - - `limits`: Display the Quota (bandwidth & storage usage/limits) for a specific organisation. - - `history`: Display the Quota History (upload, download, and storage usage/limits) for a specific organisation. +- `quota`: Quota limits and history for a organization. + - `limits`: Display the Quota (bandwidth & storage usage/limits) for a specific organization. + - `history`: Display the Quota History (upload, download, and storage usage/limits) for a specific organization. - `repositories`|`repos`: Manage repositories. - `create`|`new`: Create a new repository in a namespace. - `get`|`list`|`ls`: List repositories for a user, in a namespace or get details for a specific repository. diff --git a/cloudsmith_cli/cli/commands/policy/license.py b/cloudsmith_cli/cli/commands/policy/license.py index 6096f938..d7c8e39a 100644 --- a/cloudsmith_cli/cli/commands/policy/license.py +++ b/cloudsmith_cli/cli/commands/policy/license.py @@ -91,7 +91,7 @@ def ls(ctx, opts, owner, page, page_size): List license policies. This requires appropriate permissions for the owner (a member of the - organisation and a valid API key). + organization and a valid API key). - OWNER: Specify the OWNER namespace (i.e. org) diff --git a/cloudsmith_cli/cli/commands/policy/vulnerability.py b/cloudsmith_cli/cli/commands/policy/vulnerability.py index ff883837..768c92eb 100644 --- a/cloudsmith_cli/cli/commands/policy/vulnerability.py +++ b/cloudsmith_cli/cli/commands/policy/vulnerability.py @@ -79,7 +79,7 @@ def ls(ctx, opts, owner, page, page_size): List vulnerability policies. This requires appropriate permissions for the owner (a member of the - organisation and a valid API key). + organization and a valid API key). - OWNER: Specify the OWNER namespace (i.e. org) diff --git a/cloudsmith_cli/cli/commands/quota/command.py b/cloudsmith_cli/cli/commands/quota/command.py index 60fde227..d6e4fffc 100644 --- a/cloudsmith_cli/cli/commands/quota/command.py +++ b/cloudsmith_cli/cli/commands/quota/command.py @@ -14,7 +14,7 @@ @click.pass_context def quota(ctx, opts): # pylink: disable=unused-argument """ - Display Quota limits and history for an organisation. + Display Quota limits and history for an organization. See the help for subcommands for more information on each. """ diff --git a/cloudsmith_cli/cli/commands/quota/history.py b/cloudsmith_cli/cli/commands/quota/history.py index b11b448e..3957427b 100644 --- a/cloudsmith_cli/cli/commands/quota/history.py +++ b/cloudsmith_cli/cli/commands/quota/history.py @@ -92,7 +92,7 @@ def usage(ctx, opts, owner, oss): Retrieve Quota history for namespace. This requires appropriate permissions for the owner (a member of the - organisation and a valid API key). + organization and a valid API key). - OWNER: Specify the OWNER namespace (i.e. org) diff --git a/cloudsmith_cli/cli/commands/quota/quota.py b/cloudsmith_cli/cli/commands/quota/quota.py index ed9cbc81..a2907f7f 100644 --- a/cloudsmith_cli/cli/commands/quota/quota.py +++ b/cloudsmith_cli/cli/commands/quota/quota.py @@ -77,7 +77,7 @@ def usage(ctx, opts, owner, oss): Retrieve Quota limits. This requires appropriate permissions for the owner (a member of the - organisation and a valid API key). + organization and a valid API key). - OWNER: Specify the OWNER namespace (i.e. org) diff --git a/cloudsmith_cli/cli/commands/upstream.py b/cloudsmith_cli/cli/commands/upstream.py index 1ca0eb82..4cf328c7 100644 --- a/cloudsmith_cli/cli/commands/upstream.py +++ b/cloudsmith_cli/cli/commands/upstream.py @@ -186,7 +186,7 @@ def func(ctx, opts, owner_repo, page, page_size): func.__doc__ = f""" List {upstream_fmt} upstreams for a repository. - This requires appropriate permissions for the owner (a member of the organisation, repository privileges and a valid API key). + This requires appropriate permissions for the owner (a member of the organization, repository privileges and a valid API key). - OWNER/REPO: Specify the OWNER namespace (organization) and REPO (repository) to target a specific Cloudsmith repository. @@ -253,7 +253,7 @@ def func(ctx, opts, owner_repo, upstream_config_file): func.__doc__ = f""" Create a {upstream_fmt} upstream for a repository. - This requires appropriate permissions for the owner (a member of the organisation, repository privileges and a valid API key). + This requires appropriate permissions for the owner (a member of the organization, repository privileges and a valid API key). - OWNER/REPO: Specify the OWNER namespace (organization) and REPO (repository) to target a specific Cloudsmith repository. @@ -332,7 +332,7 @@ def func(ctx, opts, owner_repo_slug_perm, upstream_config_file): func.__doc__ = f""" Update a {upstream_fmt} upstream for a repository. - This requires appropriate permissions for the owner (a member of the organisation, repository privileges and a valid API key). + This requires appropriate permissions for the owner (a member of the organization, repository privileges and a valid API key). - OWNER/REPO/SLUG_PERM: Specify the OWNER namespace (organization), REPO (repository) and SLUG_PERM (upstream) to target a specific upstream belonging to a repo. @@ -417,7 +417,7 @@ def func(ctx, opts, owner_repo_slug_perm, yes): func.__doc__ = f""" Delete a {upstream_fmt} upstream for a repository. - This requires appropriate permissions for the owner (a member of the organisation, repository privileges and a valid API key). + This requires appropriate permissions for the owner (a member of the organization, repository privileges and a valid API key). - OWNER/REPO/SLUG_PERM: Specify the OWNER namespace (organization), REPO (repository) and SLUG_PERM (upstream) to target a specific upstream belonging to a repo. diff --git a/cloudsmith_cli/cli/tests/commands/test_repos.py b/cloudsmith_cli/cli/tests/commands/test_repos.py index d879b197..7da8fd8e 100644 --- a/cloudsmith_cli/cli/tests/commands/test_repos.py +++ b/cloudsmith_cli/cli/tests/commands/test_repos.py @@ -61,14 +61,14 @@ def parse_table(output): return dict(zip(column_headers, row_values)) -def assert_output_is_equal_to_repo_config(output, organisation, repo_config_file_path): +def assert_output_is_equal_to_repo_config(output, organization, repo_config_file_path): output_table = parse_table(output) repo_config = json.loads(repo_config_file_path.read_text()) assert output_table["Name"] == repo_config["name"] assert output_table["Type"] == repo_config["repository_type_str"] assert ( output_table["Owner / Repository (Identifier)"] - == organisation + "/" + repo_config["slug"] + == organization + "/" + repo_config["slug"] ) From c153fb4d584950f94133ef9e418773278e5c9992 Mon Sep 17 00:00:00 2001 From: Ralph McTeggart Date: Tue, 28 Nov 2023 17:11:00 +0000 Subject: [PATCH 3/5] Quarantine rm command help fixed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 540823e1..0b23b9c8 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ The CLI currently supports the following commands (and sub-commands): - `vagrant`: Push (upload) a new Vagrant package upstream. - `quarantine`|`block`: Manage quarantined packages in a repository. - `add`: Add a package to quarantine. - - `remove`|`rm`|`restore`: Add a package to quarantine. + - `remove`|`rm`|`restore`: Remove a package from quarantine. - `quota`: Quota limits and history for a organization. - `limits`: Display the Quota (bandwidth & storage usage/limits) for a specific organization. - `history`: Display the Quota History (upload, download, and storage usage/limits) for a specific organization. From 7dc8f76be95e328871c0183217b1311b75800fb7 Mon Sep 17 00:00:00 2001 From: Ralph McTeggart Date: Fri, 15 Dec 2023 09:21:20 +0000 Subject: [PATCH 4/5] Changing one synchronized reference back to UK spelling cause API uses it --- cloudsmith_cli/cli/tests/commands/test_package_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudsmith_cli/cli/tests/commands/test_package_commands.py b/cloudsmith_cli/cli/tests/commands/test_package_commands.py index 0ecdd281..83671b6b 100644 --- a/cloudsmith_cli/cli/tests/commands/test_package_commands.py +++ b/cloudsmith_cli/cli/tests/commands/test_package_commands.py @@ -55,7 +55,7 @@ def test_push_and_delete_raw_package( for _ in range(10): time.sleep(5) result = runner.invoke(status, args=[org_repo_package], catch_exceptions=False) - if "Fully Synchronized" in result.output: + if "Fully Synchronised" in result.output: break else: raise TimeoutError("Test timed out waiting for package sync") From 99e0d00a04df31335cba1d2036b1e0c3ed5e152f Mon Sep 17 00:00:00 2001 From: Ralph McTeggart Date: Fri, 15 Dec 2023 09:23:04 +0000 Subject: [PATCH 5/5] API response has "s" in synchronized --- cloudsmith_cli/cli/commands/list_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudsmith_cli/cli/commands/list_.py b/cloudsmith_cli/cli/commands/list_.py index f71ba833..1fa5f5af 100644 --- a/cloudsmith_cli/cli/commands/list_.py +++ b/cloudsmith_cli/cli/commands/list_.py @@ -254,7 +254,7 @@ def _get_package_status(package): """Get the status for a package.""" status = package["status_str"] or "Unknown" stage = package["stage_str"] or "Unknown" - if stage == "Fully Synchronized": + if stage == "Fully Synchronised": return status return f"{status} / {stage}"