Repository navigation
feat: discover a pipeline's stacks and ECS services when adding a project - #68
Merged
Merged
Conversation
…ject Adding a project from the manage screen saved only its pipeline; stacks and ECS services had to be hand-edited into config.toml. CDK pipelines deploy through CodeBuild, so the pipeline definition never names a stack. New internal/discover links them through the ProjectName tag the CDK blueprints put on the pipeline and every stack (minus the pipeline's own stack), and reads ECS services from those stacks' resources. The manage screen runs it after the form for new projects and for ones with a pipeline but nothing else, and shows a confirmation with the resources named after the project pre-selected, since a shared tag also matches sibling projects. Discovery failure never blocks the save. Closes #67
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.
Closes #67
Summary
Adding a project from the manage screen used to save only its pipeline, so stacks and ECS had to be added to
config.tomlby hand (e.g.testlibnd / reserves).The pipeline definition can't name its stacks, because CDK pipelines deploy through CodeBuild (
cdk deploy). Instead, discovery links them through the tags the blueprints already set:internal/discover:ProjectNametag, then finds every active stack with the same tag, excluding the pipeline's own stack (found viaDescribeStackResources).AWS::ECS::Serviceresources and groups the services by cluster.Result.Likely(project)narrows the results to what's named after the project. A shared tag also matches sibling projects:ProjectName=deccovers honeycomb, beehive and honeypot.Likelypicks pre-selected.entersaves the selection, andescsaves the project without the discovered items.Live check (read-only, real accounts)
reserves-cluster,reserves-service,reserves-test-service, matching the hand config exactlyapi-cluster,api-service,api-test-servicedecstacksFor honeycomb,
Likelypre-selects only the honeycomb stacks and services.Test plan
internal/discover: stacks by tag, own stack excluded, untagged pipeline finds nothing, ECS grouped by cluster, AWS errors surface,Likelynarrowing and its fallback to everything.go test -race ./...passes andgolangci-lintreports 0 issues.