Repository navigation
refactor: deepen health, poll cycle, config, and fix modules - #62
Merged
Merged
Conversation
Status rules, the poll cycle and fix execution each lived across several packages that re-read raw status strings with their own rules. Concentrate them behind small interfaces: - internal/health (was aggregator) owns what a status means: StackStatus and Service decide Stoplight, stuck reason and fix eligibility. - poller: fetchProject holds the fetch-or-carry-forward rule, a stuckTracker holds alert bookkeeping, one clock stamps both, and per-account clients are reused across cycles. - state: fetchers return state types directly; mirrored DTOs removed. - config: Clone() so the poller owns its copy; AccountFor works on literals. - fix: Apply builds the actioner, runs the plan and classifies the outcome; the dashboard only renders it. Fixes found along the way: - a crash-looping ECS service now raises a stuck alert - REVIEW_IN_PROGRESS stacks are no longer stuck - cancel-update is offered only for UPDATE_IN_PROGRESS - cfn.FetchStacks returns call errors, so stacks go stale and alert like pipelines instead of turning grey - webhooks no longer delay the dashboard snapshot - fix actions load config through awscfg (adaptive retry) - editing a disabled project no longer re-enables it - data race between the manage screen and the poller's config
Skeyelab
enabled auto-merge (squash)
September 29, 2026 03:20
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
Architecture pass: six "deepening" refactors that pull logic scattered across packages behind small interfaces. The code shrinks by ~700 lines, and several real bugs turned up along the way.
internal/health(renamed fromaggregator) is the one place that decides what a status means.StackStatusandServicereturn the Stoplight, the stuck reason and whether a fix applies. cfn, ecs, poller, fix and ui call them instead of each parsing raw status strings.fetchProjectholds the fetch-or-carry-forward rule, and is tested with plain values.stuckTrackerholds the alert bookkeeping.poller.gowent from 649 to 295 lines.awscfg.Clone()of the config.AccountForworks on aConfigbuilt in code, not only one loaded from disk.statetypes directly, andstateno longer imports aws/cfn/ecs. Removed:PipelineData,StageState,ActionData,StackDataandServiceDatastatetypesConsoleURL,PipelineQuery, the unusedprofilefieldfix.Applybuilds the actioner, runs the plan and classifies the result into anOutcome, which the dashboard just renders. The confirm-then-execute path is now tested end to end.Bugs fixed
ecs_tasks_failing, with the task detail.REVIEW_IN_PROGRESSshows ⚪ but alerted as stuck. It no longer does.*_IN_PROGRESSstatus. It now offers it only forUPDATE_IN_PROGRESS, the only statusCancelUpdateStackaccepts.cfn.FetchStacksswallowed errors and showed grey "UNKNOWN" stacks. Stacks now carry forward as stale, firefetch_failedand show the auth hint. A stack that no longer exists still shows greyNOT_FOUND.Behaviour changes
no client available for account "prod": no credentials.Not in scope
ForceRefreshandReloadConfigcan run at the same time as a scheduled poll.fixis still hard-coded.Test plan
go test -race ./...passesgolangci-lint runreports 0 issues