fix: propagate job tags to ECS tasks so cost allocation reaches compute#46
fix: propagate job tags to ECS tasks so cost allocation reaches compute#46nh13 wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR updates AWS Batch submissions to set ChangesAWS Batch tag propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
hi @nh13, could you resolve the conflicts in the docs? |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_batch_job_builder.py`:
- Around line 273-283: Update test_propagate_tags_absent_when_no_tags and the
corresponding test near the alternate line range to assert that “propagateTags”
is not present in submit_job call_args kwargs, rather than checking
kwargs.get("propagateTags") is None. Use direct key-presence validation so an
explicitly supplied None value fails the tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d79f43a5-5756-43e8-9a4e-3e6ffcfac0c4
📒 Files selected for processing (4)
docs/further.mdsnakemake_executor_plugin_aws_batch/__init__.pysnakemake_executor_plugin_aws_batch/batch_job_builder.pytests/test_batch_job_builder.py
🚧 Files skipped from review as they are similar to previous changes (3)
- snakemake_executor_plugin_aws_batch/batch_job_builder.py
- docs/further.md
- snakemake_executor_plugin_aws_batch/init.py
Without propagateTags=True on submit_job, tags on the Batch job object never reach the underlying ECS task, so Cost Explorer attribution by project/run tags misses the actual EC2/ECS spend. Set propagateTags alongside tags whenever the merged tag set is non-empty. Also note in the tags setting help text that ecs:TagResource may be required depending on account tagging-authorization settings.
|
@cademirch done! |
Without
propagateTags=Trueonsubmit_job, tags on the Batch job object never reach the underlying ECS task, so Cost Explorer attribution by project/run tags misses the actual EC2/ECS spend. SetpropagateTagsalongsidetagswhenever the merged tag set is non-empty (completes the per-job-tags feature from #40). Also notes in the tags help text thatecs:TagResourcemay be required on the executor role depending on account ECS tagging-authorization settings.Test Plan
TestSubmitTagPropagation:propagateTags=Truewhen settings tags present, when env-var tags only, and absent when there are no tagsMerge-order note
This adds a kwarg to
submit(), which #44 (pre-existing job definitions) also touches — #44 introduces a separate pre-existing submit path. Whichever of #44 / this lands second needs a trivial rebase, and once both are mergedpropagateTagsmust also be mirrored into #44's pre-existing path. I'll handle that reconciliation on the second-to-merge branch.Summary by CodeRabbit
propagateTagsis set when tags exist and omitted when no tags are configured.