Skip to content

Add component_path to the outputs of atmos describe affected command - #321

Merged
Andriy Knysh (aknysh) merged 3 commits into
masterfrom
update-describe-affected-3
Feb 10, 2023
Merged

Andriy Knysh (aknysh) merged 3 commits into
masterfrom
update-describe-affected-3

Conversation

@aknysh

Copy link
Copy Markdown
Member

what

  • Add component_path to the outputs of atmos describe affected command

why

  • Output the path to the terraform or helmfile component
  • Useful when we want to run certain workflows (e.g. in GitHub actions) for specific components and need to know what the component path is for each

@bridgecrew bridgecrew Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bridgecrew has found errors in this PR ⬇️

Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
Comment thread go.sum Resolved
@aknysh
Andriy Knysh (aknysh) merged commit b53808d into master Feb 10, 2023
@aknysh
Andriy Knysh (aknysh) deleted the update-describe-affected-3 branch February 10, 2023 15:56
Erik Osterman (Cloud Posse) (osterman) added a commit that referenced this pull request Oct 7, 2026
Bump shell-quote, proxy-addr, compression, joi and postcss-selector-parser
via pnpm.overrides to their patched versions (Dependabot #321, #317, #315,
#316, #314). Not fixed: tinypool (major bump blocked by dependabot policy),
source-map-js (patched release is inside the 7-day minimum-release-age window),
katex (breaking 0.x minor), and alerts with no patched version.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Erik Osterman (Cloud Posse) (osterman) added a commit that referenced this pull request Oct 7, 2026
Bump the patched versions through pnpm.overrides in website/ (all within the
current major, so the dependabot.yml ignore policy is respected):

- shell-quote 1.10.0 -> 1.11.0 (#321)
- source-map-js 1.2.1 -> 1.2.2 (#318)
- proxy-addr 2.0.7 -> 2.0.8 (#317)
- joi 17.13.7 -> 17.13.8 (#316)
- compression 1.8.1 -> 1.8.2 (#315)
- postcss-selector-parser 7.1.5 -> 7.1.6 (#314)

The remaining open alerts are not auto-fixable (no patch, major bump blocked
by policy, or an unfamiliar CodeQL/Semgrep rule).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Erik Osterman (Cloud Posse) (osterman) added a commit to arcaven/atmos that referenced this pull request Oct 18, 2026
…loudposse#3285)

* feat(store): add tags and expires options to Azure Key Vault store

Organizations that enforce an Azure Policy requiring tags and an expiration
date on every Key Vault secret could not use the Azure Key Vault store,
because Atmos wrote only the secret value.

Add `tags` (string map) and `expires` options, applied to every secret Atmos
writes. `expires` accepts a relative duration (`90d`, `2160h`), recalculated
on each write, or a specific date (RFC 3339 or `YYYY-MM-DD`). Invalid values
fail when the store is created. Includes docs, agent skill updates, a blog
post, and a roadmap milestone.

Closes cloudposse#1549

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(website): add related_docs to scaffolding-yaml-functions and fix broken anchor

The example-docs prebuild test requires every example README to declare at
least two related_docs links, which failed website-deploy-preview. Also point
scaffold/validate at the real heading anchor on scaffold/generate.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(store): reject sub-second Azure Key Vault expires durations

Key Vault stores expiration in whole Unix seconds, so a duration under one
second could collapse to the current second and leave a new secret already
expired. Reject such durations when the store is created and document the
one-second minimum.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(security): remediate 5 Dependabot alerts

Bump shell-quote, proxy-addr, compression, joi and postcss-selector-parser
via pnpm.overrides to their patched versions (Dependabot cloudposse#321, cloudposse#317, cloudposse#315,
cloudposse#316, cloudposse#314). Not fixed: tinypool (major bump blocked by dependabot policy),
source-map-js (patched release is inside the 7-day minimum-release-age window),
katex (breaking 0.x minor), and alerts with no patched version.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(stores): use labels for Azure Key Vault metadata

* fix(toolchain): retry Windows socket denial during verification

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Erik Osterman (Cloud Posse) (osterman) added a commit to arcaven/atmos that referenced this pull request Oct 18, 2026
…loudposse#3297)

* feat(describe affected): add --tags and --labels selectors

Native CI had no per-instance opt-out and the affected matrix could not be
filtered, so privileged components (iam, aws-teams, tfstate-backend) always
reached the plan/apply matrix.

`atmos describe affected` and `atmos list affected` now accept `--tags`
(match any) and `--labels` (match all) with the same semantics as
`atmos terraform --tags/--labels`, applied to every output format including
`--format=matrix`. Combining them with `--upload` is rejected because the
upload is always unfiltered. The positional `excludeLocked` parameter is
replaced by an `AffectedFilter` struct.

Docs cover the default-label-plus-override pattern and an OPA backstop, with
a changelog post, roadmap entry, migration-guide note and atmos-ci skill update.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(security): remediate 6 website Dependabot alerts

Bump the patched versions through pnpm.overrides in website/ (all within the
current major, so the dependabot.yml ignore policy is respected):

- shell-quote 1.10.0 -> 1.11.0 (cloudposse#321)
- source-map-js 1.2.1 -> 1.2.2 (cloudposse#318)
- proxy-addr 2.0.7 -> 2.0.8 (cloudposse#317)
- joi 17.13.7 -> 17.13.8 (cloudposse#316)
- compression 1.8.1 -> 1.8.2 (cloudposse#315)
- postcss-selector-parser 7.1.5 -> 7.1.6 (cloudposse#314)

The remaining open alerts are not auto-fixable (no patch, major bump blocked
by policy, or an unfamiliar CodeQL/Semgrep rule).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(test): restore gomonkey doubles for the affected wrappers

TestGetAffectedComponents patches the public ExecuteDescribeAffectedWithTarget*
wrappers, which keep their `excludeLocked bool` parameter (only the *WithOptions
variants take an AffectedFilter). The doubles had been switched to
`filter AffectedFilter`, so gomonkey's ApplyFunc type check panicked on Linux and
Windows ("target type ... and double type ... are different") and aborted the
whole internal/exec package. The test is skipped on darwin/arm64, so it was not
caught locally.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(describe affected): apply --tags/--labels to deleted components and dependents

A field test of the new selectors found two paths that bypassed them. A
component deleted in HEAD, including every component of a deleted stack, was
always reported, so a privileged `ci: manual` component still reached the
`--labels=ci=auto` matrix. With --include-dependents, non-matching components
were still nested under their parents.

Deleted components are now matched against their metadata from the base ref.
Nested dependents are pruned recursively, promoting matching descendants of a
removed dependent to the nearest remaining ancestor. `terraform --affected` is
unchanged. `atmos list affected` picks up the deleted-component fix.

Docs, the changelog post and the atmos-ci skill now cover the
schemas.opa.base_path prerequisite for the OPA backstop, the empty-value
behavior, deleted and dependents handling, and the list affected flags. A fix
record is added under docs/fixes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(config): don't panic on schema path overrides when atmos.yaml has no schemas

Setting ATMOS_SCHEMAS_OPA_BASE_PATH (or the jsonschema, cue and atmos-manifest
variants, or the matching --schemas-* flags) panicked with "assignment to entry
in nil map" when the loaded atmos.yaml had no `schemas:` section, because the
Schemas map is left nil in that case.

AtmosConfiguration already had a nil-safe SetSchemaRegistry, but eight write
sites in pkg/config/utils.go still assigned into the map directly. Add the
matching SetResourcePath setter and use the nil-safe setters at all eight
sites. Regression tests cover the environment variable path, the flag path and
the setter, and they fail with the original panic without the change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs: regenerate affected help screengrabs and update the fix record

Regenerate only the describe affected and list affected --help casts so they
show the new --tags and --labels flags, using the casts generator's --filter
option. Update the fix record: both pass-through follow-ups were resolved in
this pull request.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(describe affected): record dependent metadata only when selectors are set

The nested-dependents pruning attached each dependent's metadata inside
addDependentsToAffected unconditionally. That added a populated field to every
dependent, so the whole-struct comparisons in TestDescribeAffectedWithDependents,
...WithoutTemplates and ...FilteredByStack failed on Linux, macOS and Windows CI.
Those tests skip inside a git worktree (go-git rejects the worktreeconfig
extension), which is why they were not caught locally.

addDependentsToAffected keeps its signature and original behavior and now
delegates to addDependentsToAffectedWithFilter. Execute uses the filtered variant
only when --tags or --labels is set, and the transient metadata is cleared after
pruning. The shared settings move into a dependentsOptions struct, which also
brings the touched functions within the argument and length limits.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(describe affected): promote dependents, prune terraform dependents, stop selector env leaks

Field-test fixes for the --tags/--labels selectors:

- describe affected --include-dependents now applies selectors after
  dependents are resolved, so matching dependents of an excluded
  (e.g. ci: manual) component are promoted to top-level entries with
  affected: dependent instead of disappearing.
- New --flatten flag (ATMOS_DESCRIBE_AFFECTED_FLATTEN) lifts every
  remaining dependent into the top-level list for every format,
  including --format=matrix.
- list affected --include-dependents now resolves dependents and emits
  dependent rows through the same finalizer.
- terraform --affected/--all --include-dependents --tags/--labels now
  prunes non-matching closure-added dependents and contracts dropped
  intermediates so execution order survives; prerequisites still run.
- Per-flag Viper keys (flags.WithViperKey) move the list, vendor, and
  auth tags/labels flags off the bare keys so a job-level ATMOS_TAGS /
  ATMOS_LABELS no longer leaks through AutomaticEnv; terraform ignores
  env-only selectors when a component argument is given and normalizes
  ATMOS_TAGS the same way describe affected does.
- --upload ignores env-sourced selectors with a warning and rejects CLI
  selectors with hints; --labels parse errors name the flag and env var
  and carry a hint.
- --exclude-locked now also drops deleted components whose BASE
  metadata is locked.
- Real-stack regression fixture and test, docs, blog, skills, matrix
  count guard, screengrabs, and a fix record.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(describe affected): honor --exclude-locked for promoted and flattened dependents; separate vendor tags Viper key

Addresses CodeRabbit review on cloudposse#3297:

- Promoted and flattened dependents now skip components whose metadata
  is locked when --exclude-locked is set, so a locked dependent of an
  excluded parent cannot reach the matrix. Nested dependents of kept
  items stay untouched, as before. Dependent metadata is recorded
  whenever selectors are set or --flatten runs with --exclude-locked.
- list vendor binds ATMOS_VENDOR_TAGS to its own list.vendor.tags Viper
  key, so ATMOS_COMPONENT_TAGS and ATMOS_VENDOR_TAGS no longer reach
  each other's commands.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(describe affected): keep dependent metadata through flatten so --exclude-locked applies with selectors

Addresses CodeRabbit review on cloudposse#3297:

- With --tags/--labels set, the selector pass cleared dependent metadata
  before --flatten ran, so a locked dependent of a kept parent was still
  lifted into the top-level list despite --exclude-locked. The finalizer
  now keeps metadata through flattening and clears it once at the end;
  the direct applySelectorsToAffectedForest callers are unchanged.
- Add doc comments to functions touched by this PR that lacked them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: streamline CI selector announcement and guides

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
preview — 4fffe6a2 Deployed Feb 10, 2023 by aknysh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants