Skip to content

Restore old error messages for the ContainElements matcher - #1067

Merged
aelsabbahy merged 2 commits into
goss-org:masterfrom
kgaughan:delegate-match
Jun 16, 2026
Merged

aelsabbahy merged 2 commits into
goss-org:masterfrom
kgaughan:delegate-match

Conversation

@kgaughan

Copy link
Copy Markdown
Collaborator
Checklist
  • make test-all (UNIX) passes. CI will also test this
  • unit and/or integration tests are included (if applicable)
  • documentation is changed or added (if applicable)

Description of change

Before delegating to the gomega matcher, it checks for whether its argument is a map, array, or slice, which is a subset of the checks done by gomega. As the configuration file won't have an iterator, this precheck means we can deal with the error a bit more appropriately.

Before delegating to the gomega matcher, it checks for whether its
argument is a map, array, or slice, which is a subset of the checks done
by gomega. As the configuration file won't have an iterator, this
precheck means we can deal with the error a bit more appropriately.
@kgaughan
kgaughan requested a review from aelsabbahy as a code owner June 15, 2026 20:34
@kgaughan kgaughan mentioned this pull request Jun 15, 2026
@aelsabbahy
aelsabbahy merged commit 3b31a4f into goss-org:master Jun 16, 2026
6 checks passed
@aelsabbahy

Copy link
Copy Markdown
Member

Awesome, thanks!

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址