Skip to content

feat: strip unused fields from describe affected --upload output - #2067

Merged
Dan Miller (milldr) merged 7 commits into
mainfrom
feat/DEV-3940-describe-affected-upload
Feb 13, 2026
Merged

Dan Miller (milldr) merged 7 commits into
mainfrom
feat/DEV-3940-describe-affected-upload

Conversation

@milldr

@milldr Dan Miller (milldr) commented Feb 12, 2026 •

Copy link
Copy Markdown
Member

what

  • When --upload flag is used, strips fields not needed by Atmos Pro's Inngest processing
  • Reduces payload size by ~70-75% to stay within Inngest's 256KB limit
  • Fields kept: component, stack, included_in_dependents, dependents, settings.pro
  • Fields removed: settings.depends_on, settings.github, component_type, component_path, namespace, tenant, environment, stage, stack_slug, affected

why

  • Large infrastructure repos exceed Inngest's 256KB payload limit, causing 500 errors
  • The removed fields are not used in Atmos Pro's Inngest event handlers
  • Stripping at CLI level prevents uploading unnecessary data (vs server-side stripping)
  • Tested against realistic fixtures: 328KB → 85KB (74% reduction)

references

  • Linear: DEV-3940
  • PRD: docs/prd/describe-affected-upload-flag.md
  • Related Atmos Pro PR: cloudposse-corp/apps#636

Summary by CodeRabbit

  • New Features

    • Added a --upload option to describe-affected that produces a minimized payload for external uploads.
  • Documentation

    • Added a PRD detailing the upload behavior, retained fields, compatibility, testing, and migration guidance.
  • Tests

    • Added unit tests covering payload trimming, recursive dependents, nil/empty cases, and settings retention.

@github-actions github-actions Bot added the size/l Large size PR label Feb 12, 2026
@github-actions

github-actions Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@codecov

codecov Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.28%. Comparing base (186ca89) to head (07bb9f2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/exec/describe_affected.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2067      +/-   ##
==========================================
+ Coverage   76.27%   76.28%   +0.01%     
==========================================
  Files         800      801       +1     
  Lines       75374    75410      +36     
==========================================
+ Hits        57491    57527      +36     
+ Misses      14297    14296       -1     
- Partials     3586     3587       +1     
Flag Coverage Δ
unittests 76.28% <94.44%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/exec/describe_affected_upload.go 100.00% <100.00%> (ø)
internal/exec/describe_affected.go 66.00% <0.00%> (-0.67%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/prd/describe-affected-upload-flag.md Outdated
Comment thread docs/prd/describe-affected-upload-flag.md Outdated
Comment thread docs/prd/describe-affected-upload-flag.md Outdated
@milldr Dan Miller (milldr) added the patch A minor, backward compatible change label Feb 12, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 12, 2026
@milldr
Dan Miller (milldr) marked this pull request as ready for review February 12, 2026 14:22
@milldr
Dan Miller (milldr) requested a review from a team as a code owner February 12, 2026 14:23
Comment thread docs/prd/describe-affected-upload-flag.md Outdated
@coderabbitai

coderabbitai Bot commented Feb 12, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds a PRD and implementation to strip non-essential fields from "describe affected" payloads when the --upload flag is used, plus unit tests; the stripping runs before upload and prunes nested dependents and settings to reduce event size.

Changes

Cohort / File(s) Summary
Documentation
docs/prd/describe-affected-upload-flag.md
New PRD specifying the --upload flag behavior, payload format, fields to keep/remove, implementation guidance, testing, migration, and success metrics.
Command entrypoint
internal/exec/describe_affected.go
Invoke payload pruning when a.Upload is true; preprocessing added to execution path before rendering or uploading.
Payload pruning logic
internal/exec/describe_affected_upload.go
Added exported StripAffectedForUpload and helpers (stripAffected, stripDependents, stripDependent, stripSettings) to recursively remove large/unneeded fields while preserving identification, dependents (pruned), and settings.pro where present.
Unit tests
internal/exec/describe_affected_upload_test.go
Added multiple tests verifying preservation/removal of fields, recursive dependent handling, nil/empty edge cases, and empty input behavior using testify assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested labels

minor

Suggested reviewers

  • osterman
  • aknysh
🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: stripping unused fields from describe affected --upload output, which is the core objective.
Linked Issues check ✅ Passed The PR fulfills all core requirements from DEV-3940: strips designated fields (settings.depends_on, affected, component_type), preserves required fields (component, stack, included_in_dependents, dependents, settings.pro), implements stripUnnecessaryFields logic, and applies recursion to dependents.
Out of Scope Changes check ✅ Passed All changes are directly aligned with DEV-3940 scope: PRD documentation, implementation in describe_affected.go and describe_affected_upload.go, and comprehensive unit tests. No extraneous changes detected.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/DEV-3940-describe-affected-upload

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@milldr Dan Miller (milldr) added the release/feature Create release from this PR label Feb 12, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 12, 2026
@github-actions

Copy link
Copy Markdown

These changes were released in v1.206.0-test.0.

Comment thread internal/exec/describe_affected_upload.go Outdated
Comment thread internal/exec/describe_affected_upload.go Outdated
Comment thread internal/exec/describe_affected.go Outdated
Comment thread docs/prd/describe-affected-upload-flag.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/prd/describe-affected-upload-flag.md`:
- Line 265: Update the broken PR link and make the PR number consistent: replace
the erroneous URL "https://github.com/cloudposse-corp/apps/pull/683" (and the
reference "apps#683") with the correct PR number used elsewhere ("apps#636" or
the actual intended PR) so the link resolves (ensure the visible text and the
href match the chosen PR number).
🧹 Nitpick comments (2)
internal/exec/describe_affected_upload.go (2)

24-30: Missing perf.Track on exported function.

Per coding guidelines, public functions need performance tracking.

Proposed fix
+import (
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/cloudposse/atmos/pkg/utils/perf"
+)
+
 func StripAffectedForUpload(affected []schema.Affected) []schema.Affected {
+	defer perf.Track(nil, "exec.StripAffectedForUpload")()
+
 	result := make([]schema.Affected, len(affected))

As per coding guidelines, "Add defer perf.Track(atmosConfig, "pkg.FuncName")() + blank line to all public functions, use nil if no atmosConfig param."


7-23: Comments missing trailing periods.

The godot linter requires all comments to end with periods. Line 23 (// - stack_slug, affected: Not used in downstream processing) and line 68 (// Only keep settings.pro if it exists) need periods.

As per coding guidelines, "All comments must end with periods (enforced by godot linter)."

Comment thread docs/prd/describe-affected-upload-flag.md
@milldr
Dan Miller (milldr) enabled auto-merge (squash) February 13, 2026 00:25
@milldr
Dan Miller (milldr) merged commit f2f788f into main Feb 13, 2026
56 of 58 checks passed
@milldr
Dan Miller (milldr) deleted the feat/DEV-3940-describe-affected-upload branch February 13, 2026 00:41
@github-actions

Copy link
Copy Markdown

These changes were released in v1.206.1-rc.0.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.207.0.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.208.0-rc.0.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.208.0-test.15.

This branch had an error being deployed

1 failed deployment
feature-releases — 07bb9f21 Deployed Feb 13, 2026 by milldr via release / goreleaser #12478
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 release/feature Create release from this PR size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants