canonical / charming-actions

A collection of Github Actions for interaction with Charmhub, and validating Charmed Operator code
9 stars 22 forks source link

`upload-bundle` action fails: `'.' is not a file` #150

Closed mvlassis closed 2 weeks ago

mvlassis commented 3 weeks ago

Bug Description

The issue has occurred in the bundle-kubeflow repository and documented in this issue.

I have tried to trace the problem in this comment.

The gist is that the action calls the juju-bundle executable, which in turn calls the upload_charmhub function from the juju-rs Rust interface, found here. The interface calls charmcraft pack and tries to capture the output between the first 2 quotes, as seen in this snippet. I assume that the issue is because and the charmcraft executable now doesn't add single quotes to the output, and juju-rs hasn't been updated to reflect the change.

To Reproduce

Trigger the release-bundle-to-charmhub.yaml action from the bundle-kubeflow repo. This in turns calls the upload-bundle action from the main branch in this repository.

Environment

Branch: charming-actions/main

Relevant log output

Run canonical/charming-actions/upload-bundle@1.0.0
  with:
    credentials: ***
    github-token: ***
    bundle-path: ./releases/latest/edge/
    channel: latest/edge
    charmcraft-channel: latest/edge
/usr/bin/sudo snap install charmcraft --classic --channel latest/edge
charmcraft (edge) 2.5.5.post85+g75722ac from Canonical** installed
/usr/bin/sudo snap install juju-bundle --classic
juju-bundle 0.4.0 from Kenneth Koski (kennethkoski) installed
/snap/bin/juju-bundle publish --destructive-mode --serial --release latest/edge
Ensuring valid credentials with `charmcraft whoami`.
name: Michal Huckko
username: michalhucko
id: TdvDVO8EijykLIQGmU3P3FWRaEHfEJUW
permissions:
- account-register-package
- account-view-packages
- package-manage
- package-view
Error: Error running subcommand ``charmcraft upload  --release latest/edge``: `'.' is not a file.
Full execution log: '/home/runner/.local/state/charmcraft/log/charmcraft-20240219-084250.355679.log'
`
Error: The process '/snap/bin/juju-bundle' failed with exit code 1
Error: Error: The process '/snap/bin/juju-bundle' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/canonical/charming-actions/1.0.0/dist/upload-bundle/index.js:2600:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/canonical/charming-actions/1.0.0/dist/upload-bundle/index.js:2583:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/canonical/charming-actions/1.0.0/dist/upload-bundle/index.js:2477:27)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Socket.<anonymous> (node:internal/child_process:458:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:301:12)
No charmcraft logs generated, skipping artifact upload.

Additional context

Since this is the only action that uses juju-bundle, and both the juju-bundle executable and the juju-rs interface hasn't been updated in a relatively long time, I suggest we don't use juju-bundle and try to implement the logic from the action itself.

ca-scribner commented 3 weeks ago

Removing juju-bundle has been mentioned for a while now (#23) but nobody has actually implemented it.

ca-scribner commented 3 weeks ago

I am +1 for removing juju-bundle, but I'd also have designed upload-charm differently. the syntax for uploading charms and bundles is identical - I don't know why we need separate actions for them

orfeas-k commented 2 weeks ago

the syntax for uploading charms and bundles is identical - I don't know why we need separate actions for them

From what I remember, when we upload a charm, we 're also handling uploading resources etc which is not the case for a bundle. Maybe, we could have designed an upload action that would handle both cases, but I think it would still need to have different cases for a bundle and a charm.

mvlassis commented 2 weeks ago

Closed by #151.