Skip to content

Comments

feat(cd): set DEFANG_ETAG env in CD task#1943

Merged
lionello merged 1 commit intomainfrom
lio/set-etag-env
Feb 23, 2026
Merged

feat(cd): set DEFANG_ETAG env in CD task#1943
lionello merged 1 commit intomainfrom
lio/set-etag-env

Conversation

@lionello
Copy link
Member

@lionello lionello commented Feb 19, 2026

Description

GCP was already using DEFANG_ETAG so doing the same for AWS and DO.

Linked Issues

Checklist

  • I have performed a self-review of my code
  • I have added appropriate tests
  • I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

Summary by CodeRabbit

  • Infrastructure Improvements
    • Enhanced continuous deployment operation tracking and identification across AWS and DigitalOcean BYOC providers, enabling improved monitoring and log retrieval throughout the deployment lifecycle.

Copy link
Member

@jordanstephens jordanstephens left a comment

Choose a reason for hiding this comment

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

Nice!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The pull request introduces per-CD-operation etag handling in BYOC AWS and DO client implementations. An etag field is added to cdCommand structs and threaded through CD command construction, deployment flows, and log retrieval operations, with the etag propagated via environment variable.

Changes

Cohort / File(s) Summary
BYOC AWS CD Etag Handling
src/pkg/cli/client/byoc/aws/byoc.go
Added etag field to cdCommand struct. Generate etag during deploy flow and include in ProjectUpdate payload. Thread etag through CD command creation and pass via DEFANG_ETAG environment variable. Updated log retrieval to match etag against stored cdEtag or CD task ID. Store etag in provider state on CD execution.
BYOC DO CD Etag Handling
src/pkg/cli/client/byoc/do/byoc.go
Added etag field to cdCommand struct. Initialize etag in CdCommand creation and propagate through deploy and CdCommand paths. Support DEFANG_ETAG injection in Pulumi environment during CD command execution. Update b.cdEtag tracking accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jordanstephens
  • edwardrf

Poem

🐰 Per-operation etags now flow,
Through AWS and DO, all aglow,
Each CD command gets its own ID,
No more ambiguity, hooray for thee! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cd): set DEFANG_ETAG env in CD task' directly and specifically describes the main change: adding the DEFANG_ETAG environment variable to CD tasks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 lio/set-etag-env

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter"
level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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

@lionello lionello merged commit 50baef4 into main Feb 23, 2026
14 checks passed
@lionello lionello deleted the lio/set-etag-env branch February 23, 2026 08:03
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