Feat: Make cli argument vars to be slice of string#1024
Open
Lirt wants to merge 1 commit into
Open
Conversation
Lirt
force-pushed
the
args/varsfile-slice
branch
2 times, most recently
from
May 9, 2025 12:35
ffcaea0 to
3819332
Compare
Author
|
Hello @aelsabbahy, any time expectation when you could look at this change? |
Author
|
Ping for visibility. If there is low amount of maintainers, I can offer my help. |
uk-bolly
added a commit
to uk-bolly/bolly_goss
that referenced
this pull request
Jun 24, 2026
Taken changes and issues from upstream and incorporated Fixed other issues around some integration tests workflow actions updated ### PRs Incorporated - Thanks to [@kgaughan](https://github.com/kgaughan) for authoring the `urfave/cli` v3 migration - [#1060](goss-org/goss#1060) - CLI migrated from `urfave/cli` v1 to `urfave/cli/v3` v3.9.0; v3 is actively maintained and drops transitive dependencies (`go-md2man`, `blackfriday`) - Thanks to [@kgaughan](https://github.com/kgaughan) for restoring clearer `ContainElements` matcher error messages - [#1067](goss-org/goss#1067) - pre-validates array/slice/map types before delegating to gomega, restoring the pre-iterator error text forinvalid inputs (e.g. strings) - Thanks to [@kgaughan](https://github.com/kgaughan) for the dependency and tooling refresh - [#1064](goss-org/goss#1064) - golangci-lint v2.12.2 config (staticcheck settings, `noinlineerr` disabled), dependency bumps (`gomega` v1.41.0, `prometheus/common` v0.68.1), Trivy action updates, and minor lint cleanups; fork already had most workflow, Dockerfile, and code changes at equal or newer versions ### Security - CLI announce output logs resource type and ID only; no longer marshals and prints full resource JSON (fixes CodeQL clear-text logging of password and other sensitive fields) - Health probe debug logging records HTTP status only; no longer logs response body on non-OK status (avoids clear-text logging of password and other sensitive fields from test output) - Health probe content negotiation errors no longer log the raw `Accept` header value from untrusted requests ### Fixed - Integration test `add.goss.yaml` expectations updated for announce output change (resource type and ID only, not full marshaled YAML) - `bullseye` apache2 version bumped to `2.4.67-1~deb11u3` in `vars.yaml` (Debian security update) - Integration test fixtures: removed duplicate `service: apache2` / `service: httpd` definitions between `goss-shared.yaml` and `goss-service.yaml`; eliminates duplicate-key warnings during `validate` in CI ### Added - Multiple `--vars` files supported; vars are merged in flag order with later files overriding overlapping keys; `--vars-inline` still applies last ([#1023](goss-org/goss#1023); thanks to [@Lirt](https://github.com/Lirt) for [PR #1024](goss-org/goss#1024))
uk-bolly
added a commit
to uk-bolly/bolly_goss
that referenced
this pull request
Jun 25, 2026
Taken changes and issues from upstream and incorporated Fixed other issues around some integration tests workflow actions updated ### PRs Incorporated - Thanks to [@kgaughan](https://github.com/kgaughan) for authoring the `urfave/cli` v3 migration - [#1060](goss-org/goss#1060) - CLI migrated from `urfave/cli` v1 to `urfave/cli/v3` v3.9.0; v3 is actively maintained and drops transitive dependencies (`go-md2man`, `blackfriday`) - Thanks to [@kgaughan](https://github.com/kgaughan) for restoring clearer `ContainElements` matcher error messages - [#1067](goss-org/goss#1067) - pre-validates array/slice/map types before delegating to gomega, restoring the pre-iterator error text forinvalid inputs (e.g. strings) - Thanks to [@kgaughan](https://github.com/kgaughan) for the dependency and tooling refresh - [#1064](goss-org/goss#1064) - golangci-lint v2.12.2 config (staticcheck settings, `noinlineerr` disabled), dependency bumps (`gomega` v1.41.0, `prometheus/common` v0.68.1), Trivy action updates, and minor lint cleanups; fork already had most workflow, Dockerfile, and code changes at equal or newer versions ### Security - CLI announce output logs resource type and ID only; no longer marshals and prints full resource JSON (fixes CodeQL clear-text logging of password and other sensitive fields) - Health probe debug logging records HTTP status only; no longer logs response body on non-OK status (avoids clear-text logging of password and other sensitive fields from test output) - Health probe content negotiation errors no longer log the raw `Accept` header value from untrusted requests ### Fixed - Integration test `add.goss.yaml` expectations updated for announce output change (resource type and ID only, not full marshaled YAML) - `bullseye` apache2 version bumped to `2.4.67-1~deb11u3` in `vars.yaml` (Debian security update) - Integration test fixtures: removed duplicate `service: apache2` / `service: httpd` definitions between `goss-shared.yaml` and `goss-service.yaml`; eliminates duplicate-key warnings during `validate` in CI ### Added - Multiple `--vars` files supported; vars are merged in flag order with later files overriding overlapping keys; `--vars-inline` still applies last ([#1023](goss-org/goss#1023); thanks to [@Lirt](https://github.com/Lirt) for [PR #1024](goss-org/goss#1024))
Contributor
|
@Lirt Could you fix the merge conflicts on this PR? I suspect that the main cause is that urfave/cli has been updated to v3. |
Lirt
force-pushed
the
args/varsfile-slice
branch
from
June 29, 2026 18:59
3819332 to
23fc438
Compare
This change allows passing multiple variables files as input to CLI. Order of files is important as overlapped non-empty keys in yaml or json files will be overwritten by subsequent file. This change is backwards compatible as CLI library makes the slice definition to be repetition of the --vars argument. Using goss with single file produces same outputs with this code change as it was before. Usage: ``` ./goss --vars file1.yaml --vars file2.yaml validate ``` Issue ref: goss-org#1023 Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
Lirt
force-pushed
the
args/varsfile-slice
branch
from
June 29, 2026 19:00
23fc438 to
d9ef0f5
Compare
Author
|
Hello @kgaughan, I rebased the PR. There was only small diff in the config. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change allows passing multiple variables files as input to CLI. Order of files is important as overlapped non-empty keys in yaml or json files will be overwritten by subsequent file.
This change is backwards compatible because CLI library implements slice definition as repetition of the
--varsargument. Using goss with single file produces the same outputs with the code change as it was before.Usage:
Checklist
make test-alldoesn't exist anymore. Probably should bemake test-int-all.make testpasses correctly.make test-all(UNIX) passes. CI will also test thisDescription of change
Closes #1023
📚 Documentation preview 📚: https://goss--1024.org.readthedocs.build/en/1024/