← Back to issue list

`--format json` ignored in 3.2.1

View original Github issue

Metadata

Project
charmcraft
Number
#1985
Type
issue
State
open
Author
PietroPasotti
Labels
—
Created
Updated
Closed
—

Current evaluation

charmcraft pack accepts --format json but never emits JSON output; flag is parsed but unused in PackCommand._run. Still present at current HEAD.

Suggested action: needs triage

Reason: The issue has no labels, comments, or maintainer acknowledgement, so it has not been triaged. Source inspection confirms the bug: PackCommand._fill_parser defines --format but _run never reads parsed_args.format, and this remains true at current HEAD (0712d308). The reproducer is clear, but the fix requires deciding what JSON output should contain and possibly upstream craft-application support.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 20 Complexity: 35 Confidence: 80 Actionability: 70

Issue body

### Bug Description ![image](https://github.com/user-attachments/assets/426d910c-36fd-41bd-b0f3-7ad61d405a42) ### To Reproduce `charmcraft pack --format json` ### Environment installed: 3.2.1 (4914) 61MB classic ### charmcraft.yaml ```yaml # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. name: tempo-coordinator-k8s type: charm assumes: - k8s-api # Juju 3.4.0 needed for pebble notify - juju >= 3.4.0 description: | Tempo is a distributed tracing backend by Grafana, supporting Jaeger, Zipkin, and OpenTelemetry protocols. summary: | Tempo is a distributed tracing backend by Grafana. containers: nginx: resource: nginx-image nginx-prometheus-exporter: resource: nginx-prometheus-exporter-image resources: nginx-image: type: oci-image description: OCI image for nginx upstream-source: ubuntu/nginx:1.24-24.04_beta nginx-prometheus-exporter-image: type: oci-image description: OCI image for nginx-prometheus-exporter upstream-source: nginx/nginx-prometheus-exporter:1.1.0 links: documentation: https://discourse.charmhub.io/t/tempo-coordinator-k8s-docs-index/15419 website: https://charmhub.io/tempo-coordinator-k8s source: https://github.com/canonical/tempo-coordinator-k8s-operator issues: https://github.com/canonical/tempo-coordinator-k8s-operator/issues provides: tempo-cluster: interface: tempo_cluster description: | Connect any number of tempo-worker-k8s charms to cluster the Tempo components off to different nodes. grafana-dashboard: interface: grafana_dashboard description: | Forwards the built-in grafana dashboard(s) for monitoring Tempo. grafana-source: interface: grafana_datasource description: | Configures Grafana to be able to use this Tempo instance as a datasource. metrics-endpoint: interface: prometheus_scrape description: | Exposes the Prometheus metrics endpoint providing telemetry about the Tempo instance. tracing: interface: tracing description: | Integration to offer other charms the possibility to send traces to Tempo. requires: self-tracing: interface: tracing description: | Integration to enable Tempo to send its own traces to another Tempo instance. limit: 1 s3: interface: s3 limit: 1 description: | Obtains access to the s3 bucket for data storage. logging: interface: loki_push_api description: | Integration with Loki to push Tempo logs to the observability stack. ingress: interface: traefik_route description: | Ingress integration for Tempo server and Tempo receiver endpoints, so that cross-model workloads can send their traces to Tempo through the ingress. Uses `traefik_route` to open ports on Traefik host for tracing ingesters. certificates: interface: tls-certificates limit: 1 description: | Certificate and key files for securing Tempo internal and external communications with TLS. send-remote-write: interface: prometheus_remote_write description: | Prometheus-like remote write endpoints to push traces' metrics generated by the `metrics-generator` component. storage: data: type: filesystem location: /tempo-data actions: list-receivers: description: | Returns a list of all enabled receiver endpoints. peers: peers: interface: tempo_peers description: | peer relation for internal coordination bases: - build-on: - name: "ubuntu" channel: "22.04" run-on: - name: "ubuntu" channel: "22.04" parts: charm: build-snaps: - rustup - astral-uv override-build: | rustup toolchain install stable make generate-requirements craftctl default # uncomment this if you add git+ dependencies in requirements.txt # build-packages: # - "git" charm-binary-python-packages: - "pydantic>=2" - "cryptography" - "jsonschema" - "opentelemetry-exporter-otlp-proto-http==1.21.0" prime: - -*.charm - -spread.yaml - -rockcraft.yaml - -.venv - -CONTRIBUTING.md - -Makefile - -pyproject.toml - -README.md - -requirements-dev.txt - -scripts/ - -tests/ - -uv.lock - -*.egg-info config: options: retention-period: description: | Maximum trace retention period, in hours. This will be used to configure the compactor to clean up trace data after this time. Defaults to 720 hours, which is equivalent to 30 days. Per-stream retention limits are currently not supported. type: int default: 720 always_enable_zipkin: description: Force-enable the receiver for the 'zipkin' protocol in Tempo, even if there is no integration currently requesting it. type: boolean default: false always_enable_otlp_grpc: description: Force-enable the receiver for the 'otlp_grpc' protocol in Tempo, even if there is no integration currently requesting it. type: boolean default: false always_enable_otlp_http: description: Force-enable the receiver for the 'otlp_http' protocol in Tempo, even if there is no integration currently requesting it. type: boolean default: false always_enable_jaeger_thrift_http: description: Force-enable the receiver for the 'jaeger_thrift_http' protocol in Tempo, even if there is no integration currently requesting it. type: boolean default: false always_enable_jaeger_grpc: description: Force-enable the receiver for the 'jaeger_grpc' protocol in Tempo, even if there is no integration currently requesting it. type: boolean default: false cpu_limit: description: | K8s cpu resource limit, e.g. "1" or "500m". Default is unset (no limit). This value is used for the "limits" portion of the resource requirements. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: string memory_limit: description: | K8s memory resource limit, e.g. "1Gi". Default is unset (no limit). This value is used for the "limits" portion of the resource requirements. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: string ``` ### Relevant log output ```shell ❯ charmcraft pack --format json  tempo-coordinator-k8s-operator IMPORTANT: The behaviour of the 'prime' keyword has changed in Charmcraft 3. This keyword will no longer add files that would otherwise be excluded from the charm, instead filtering existing files. Additional files may be added using the 'dump' plugin. To include extra files, see: https://juju.is/docs/sdk/include-extra-files-in-a-charm Packed tempo-coordinator-k8s_ubuntu-22.04-amd64.charm ```

Evaluation history

Date Model Scores Action Summary
~deepseek/deepseek-pro-latest
Impact: 45
Quick Win: 20
Complexity: 35
Confidence: 80
Actionability: 70
needs triage charmcraft pack accepts --format json but never emits JSON output; flag is parsed but unused in PackCommand._run. Still present at current HEAD.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 20
Complexity: 25
Confidence: 80
Actionability: 75
needs triage charmcraft pack --format json argument is defined but never acted upon; JSON output is not produced despite the flag being accepted.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 32
Staleness: 55
Complexity: 30
Confidence: 82
Support Request: 5
needs triage charmcraft pack --format json is silently ignored in 3.2.1; the flag is accepted but no JSON output is produced. Bug still present in current codebase (4.x) — the --format arg is defined in PackCommand but never handled in _run(). No maintainer response, no labels, 0 comments.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 85
Support Request: 5
needs triage charmcraft pack --format json fails to output JSON in version 3.2.1, printing plain text instead. Issue is unlabelled, has zero comments, and has been inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 85
Support Request: 5
needs triage charmcraft pack --format json flag is ignored in v3.2.1, outputting plain text instead of JSON. Issue is unlabelled, has no maintainer comments, and requires triage.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 75
Support Request: 10
needs triage charmcraft pack --format json flag appears ignored in version 3.2.1. Report remains unlabelled and unassessed by maintainers after 600 days.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.