Skip to content

Commit faaf75b

Browse files
authored
Merge pull request #605 from posit-dev/update-dgoss-cli-calls
Migrate bakery run dgoss to bakery dgoss run
2 parents 2479cfe + 3c4f0fc commit faaf75b

9 files changed

Lines changed: 36 additions & 16 deletions

File tree

.github/workflows/bakery-build-native.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ jobs:
315315
run: |
316316
GOSS_PATH=${GITHUB_WORKSPACE}/tools/goss \
317317
DGOSS_PATH=${GITHUB_WORKSPACE}/tools/dgoss \
318-
bakery run dgoss \
318+
bakery dgoss run \
319319
--image-name "^${IMAGE_NAME}$" \
320320
--image-version "$IMAGE_VERSION" \
321321
--image-platform "$IMAGE_PLATFORM" \

.github/workflows/bakery-build-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
run: |
223223
GOSS_PATH=${GITHUB_WORKSPACE}/tools/goss \
224224
DGOSS_PATH=${GITHUB_WORKSPACE}/tools/dgoss \
225-
bakery run dgoss \
225+
bakery dgoss run \
226226
--image-name "^${IMAGE_NAME}$" \
227227
--image-version "$IMAGE_VERSION" \
228228
--image-platform "$IMAGE_PLATFORM" \

.github/workflows/bakery-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ jobs:
268268
run: |
269269
GOSS_PATH=${GITHUB_WORKSPACE}/tools/goss \
270270
DGOSS_PATH=${GITHUB_WORKSPACE}/tools/dgoss \
271-
bakery run dgoss \
271+
bakery dgoss run \
272272
--image-name "^${IMAGE_NAME}$" \
273273
--image-version "$IMAGE_VERSION" \
274274
--dev-versions "$DEV_VERSIONS" \

CI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Each has the same set of caller workflows:
5656
| Caller | Trigger | Calls |
5757
|---|---|---|
5858
| `pr.yml` | `pull_request` | `bakery-build-pr.yml` with `cache: false`, because the images exceed the per-layer cache size limit in GHCR and registry caching silently fails. |
59-
| `waml.yml` (Azure ML), `wgcw.yml` (Google Cloud Workstations) | weekly cron + push to main + dispatch | Hand-rolled matrix → build → test → push pipeline using the [`setup-bakery`](setup-bakery) and [`setup-goss`](setup-goss) composite actions plus direct `bakery build` and `bakery run dgoss` calls. `wgcw.yml` additionally authenticates to Google Cloud Platform (GCP) via OpenID Connect (OIDC) and uses a GCP Artifact Registry (`us-central1-docker.pkg.dev/cloud-workstations-cache`) as its build cache. Each workflow's gating `ci` job calls the [`slack-build-notify`](.github/actions/slack-build-notify) composite action to post build outcomes to Slack. |
59+
| `waml.yml` (Azure ML), `wgcw.yml` (Google Cloud Workstations) | weekly cron + push to main + dispatch | Hand-rolled matrix → build → test → push pipeline using the [`setup-bakery`](setup-bakery) and [`setup-goss`](setup-goss) composite actions plus direct `bakery build` and `bakery dgoss run` calls. `wgcw.yml` additionally authenticates to Google Cloud Platform (GCP) via OpenID Connect (OIDC) and uses a GCP Artifact Registry (`us-central1-docker.pkg.dev/cloud-workstations-cache`) as its build cache. Each workflow's gating `ci` job calls the [`slack-build-notify`](.github/actions/slack-build-notify) composite action to post build outcomes to Slack. |
6060
| `release.yml` | `workflow_dispatch` | Hand-rolled version-bump workflow using the [`setup-bakery`](setup-bakery) composite action and direct `bakery update version` / `bakery create version` / `bakery remove version` calls. Does not call `product-release.yml`. |
6161

6262
## Cron schedule across consumer repos
@@ -146,13 +146,13 @@ flowchart TD
146146
subgraph build_amd64[Build/Test amd64]
147147
a_setup[Checkout + bakery + goss + docker + buildx + oras] --> a_login[Login GHCR/DH/ECR]
148148
a_login --> a_build["bakery build --strategy build<br/>--push to temp registry"]
149-
a_build --> a_test["bakery run dgoss"]
149+
a_build --> a_test["bakery dgoss run"]
150150
a_test --> a_meta[Upload metadata artifact]
151151
end
152152
subgraph build_arm64[Build/Test arm64]
153153
r_setup[Checkout + bakery + goss + docker + buildx + oras] --> r_login[Login GHCR/DH/ECR]
154154
r_login --> r_build["bakery build --strategy build<br/>--push to temp registry"]
155-
r_build --> r_test["bakery run dgoss"]
155+
r_build --> r_test["bakery dgoss run"]
156156
r_test --> r_meta[Upload metadata artifact]
157157
end
158158
subgraph merge[Merge / Push]
@@ -204,7 +204,7 @@ flowchart TD
204204
subgraph build[Build / Test / Push]
205205
b_setup[Checkout + bakery + goss + QEMU + buildx] --> b_login[Login GHCR/DH/ECR]
206206
b_login --> b_build["bakery build --load --pull"]
207-
b_build --> b_test["bakery run dgoss"]
207+
b_build --> b_test["bakery dgoss run"]
208208
b_test --> b_push{"push=true?"}
209209
b_push -- yes --> b_pushrun["bakery build --push"]
210210
b_push -- no --> b_skip[skip]

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ This is a monorepo containing multiple projects:
9898
Run `bakery --help` and `bakery <command> --help` for full command reference.
9999
Commands have aliases: `build`/`b`, `create`/`c`, `run`/`r`, `update`/`u`, `remove`/`rm`.
100100

101-
Key commands for product repos: `bakery build`, `bakery build --plan`, `bakery run dgoss`,
101+
Key commands for product repos: `bakery build`, `bakery build --plan`, `bakery dgoss run`,
102102
`bakery update files`, `bakery create version`, `bakery ci matrix`.
103103

104104
## Image Templating System

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ shared template change needs to apply retroactively.
7373

7474
```bash
7575
bakery build --image-name <name> --image-version <edition>
76-
bakery run dgoss --image-name <name> --image-version <edition>
76+
bakery dgoss run --image-name <name> --image-version <edition>
7777
```
7878

7979
4. Open a pull request (PR) that includes both the template change and the re-rendered version

posit-bakery/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ Full documentation is available at **[posit-dev.github.io/images-shared](https:/
3636
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------|:-------------------------------------------------------------------|
3737
| [docker buildx bake](https://github.com/docker/buildx#installing) | `bakery build --strategy bake` | Build containers in parallel |
3838
| [docker](https://github.com/docker/buildx#installing), [podman](https://podman-desktop.io/docs/installation), or [nerdctl](https://github.com/containerd/nerdctl#install) | `bakery build --strategy build` | Build containers in series |
39-
| [dgoss](https://github.com/goss-org/goss#installation) | `bakery run dgoss` | Test container images for expected content & behavior |
40-
| [hadolint](https://github.com/hadolint/hadolint#install) | to be implemented | Lint Dockerfile/Containerfile |
39+
| [dgoss](https://github.com/goss-org/goss#installation) | `bakery dgoss run` | Test container images for expected content & behavior |
40+
| [hadolint](https://github.com/hadolint/hadolint#install) | `bakery hadolint run` | Lint Dockerfile/Containerfile |
4141
| [openscap](https://static.open-scap.org/) | to be implemented | Scan container images for secure configuration and vulnerabilities |
42-
| trivy | to be implemented | Scan container images for vulnerabilities |
43-
| wizcli | to be implemented | Scan container images for vulnerabilities |
42+
| [trivy](https://trivy.dev/docs/latest/getting-started/) | to be implemented | Scan container images for vulnerabilities |
43+
| [wizcli](https://www.wiz.io/lp/wiz-cli) | `bakery wizcli scan` | Scan container images for vulnerabilities |
4444

4545
## Installation
4646

posit-bakery/posit_bakery/cli/run.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def dgoss(
137137
"""Runs dgoss tests against images in the context path
138138
139139
\b
140-
DEPRECATED: Use 'bakery dgoss run' instead.
140+
DEPRECATED: Use 'bakery dgoss run' instead. This command will be removed in a future release.
141141
142142
\b
143143
If no options are provided, the command test all images in the project and write test results to the `results/`
@@ -152,11 +152,14 @@ def dgoss(
152152
`DGOSS_BIN` environment variables if not present in the system PATH.
153153
"""
154154
warnings.warn(
155-
"'bakery run dgoss' is deprecated. Use 'bakery dgoss run' instead.",
155+
"'bakery run dgoss' is deprecated and will be removed in a future release. Use 'bakery dgoss run' instead.",
156156
DeprecationWarning,
157157
stacklevel=2,
158158
)
159-
stderr_console.print("[yellow]Warning: 'bakery run dgoss' is deprecated. Use 'bakery dgoss run' instead.[/yellow]")
159+
stderr_console.print(
160+
"[yellow]Warning: 'bakery run dgoss' is deprecated and will be removed in a future release. "
161+
"Use 'bakery dgoss run' instead.[/yellow]"
162+
)
160163

161164
# Autoselect host architecture platform if not specified.
162165
image_platform = image_platform or SETTINGS.architecture

posit-bakery/test/cli/test_run_dgoss.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ def test_normalizes_platform(self, mocked_bakery_run_dgoss, given, expected):
6060
assert mock_plugin.execute.call_args[1]["platform"] == expected
6161

6262

63+
class TestRunDgossDeprecationWarning:
64+
"""bakery run dgoss must emit a visible deprecation warning that names the
65+
preferred command and states the old form will eventually be removed."""
66+
67+
def test_emits_deprecation_warning(self, mocked_bakery_run_dgoss):
68+
result = runner.invoke(
69+
app,
70+
["run", "dgoss", "--context", BASIC_CONTEXT],
71+
catch_exceptions=False,
72+
)
73+
assert result.exit_code == 0
74+
combined = result.output
75+
assert "deprecated" in combined.lower()
76+
assert "bakery dgoss run" in combined
77+
assert "removed" in combined.lower()
78+
79+
6380
class TestRunDgossLatestFlag:
6481
"""The --latest flag is passed through to settings and warns with dev inclusion."""
6582

0 commit comments

Comments
 (0)