cloudsmith-io/action

cloudsmith-cli and cloudsmith-api packages version incompatibility

Closed this issue · 3 comments

wowa commented

Due to changes introduced in cloudsmith-api version 2.0.8 (see: cloudsmith-api change), cloudsmith-cli version 1.1.1 and cloudsmith-api version 2.0.8 are not compatible with each other. The following error occurs when attempting to push a package:

cloudsmith push deb xxxxxxx_0.1.9-1_amd64.deb --republish
Traceback (most recent call last):
  File "/usr/local/bin/cloudsmith", line 5, in <module>
    from cloudsmith_cli.cli.commands.main import main
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/cli/commands/__init__.py", line 3, in <module>
    from . import (
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/cli/commands/copy.py", line 10, in <module>
    from .push import wait_for_package_sync
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/cli/commands/push.py", line 568, in <module>
    create_push_handlers()
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/cli/commands/push.py", line 420, in create_push_handlers
    context = create_push_handlers.context = get_package_formats()
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/core/api/packages.py", line 274, in get_package_formats
    return {
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/core/api/packages.py", line 275, in <dictcomp>
    key.replace("PackageUploadRequest", "").lower(): get_parameters(cls)
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_cli/core/api/packages.py", line 251, in get_parameters
    instance = cls(**dummy_kwargs)
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_api/models/cran_package_upload_request.py", line 65, in __init__
    self.architecture = architecture
  File "/usr/local/lib/python3.8/site-packages/cloudsmith_api/models/cran_package_upload_request.py", line 97, in architecture
    raise ValueError(
ValueError: Invalid value for `architecture` (dummy), must be one of ['arm64', 'x86_64']

The cloudsmith-cli has a fixed dependency on cloudsmith-api version 2.0.7, as indicated here. However, the action installs the latest versions by default.

A quick fix is to explicitly set the api-version and cli-version to compatible versions through the action configuration:

[...]
      uses: cloudsmith-io/action@master
        with:
          api-version: "2.0.7"
          cli-version: "1.1.1"
          command: "push"
          format: "deb"
[...]

I get the same error

Same issue here. All our CI pipelines are blocked from uploading packages to cloudsmith because they use the action cloudsmith-io/action@master

Closing - we had an issue with our API release at that time, this should now be working as per usual.