fix: extend --job-array-* now tracks and reports per-instance reload failures - #518
Merged
Conversation
…failures triggerReload's error was discarded with `_ = triggerReload(&inst)` in the job-array path, unlike the single-instance path which warns and prints a manual SSH fallback. A caller extending N instances had no signal, per instance, about whether the on-instance reload actually happened vs. just the tag write. Extracted the per-instance update+reload loop into extendJobArrayInstances so the accounting is unit-tested without a real AWS client or SSH. Fixes #512
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extendJobArrayWithAuditdiscardedtriggerReload's per-instance error with_ = triggerReload(&inst), unlike the single-instancerunExtendpath, which warns and prints a manualssh ... sudo spored reloadfallback on a reload failure.extendJobArrayInstances(instances, updateTags, reload, stderr)so the accounting is unit-tested without a real AWS client or SSH. Reload failures are now tracked in a separatereloadFailedInstanceslist, printed with the same manual-fallback message as the single-instance path, and reflected in the summary output (Reloaded: N/M instances) and audit log (reload_failed_count).Test plan
go build ./...go vet ./cmd/...go test ./cmd/...— new tests:TestExtendJobArrayInstances_ReloadFailureIsTrackedNotDiscarded,TestExtendJobArrayInstances_TagFailureSkipsReload,TestExtendJobArrayInstances_AllSucceedgolangci-lint run ./cmd/...— no new findings in touched files (pre-existing findings in unrelated files unchanged)[Unreleased]Fixes #512