ci: foundational CodeBuild infra + ci-plugin canary (#168)#150
Merged
Conversation
Implements the first canary of the GHA → CodeBuild migration described in
docs/decisions/13-gha-to-codebuild-migration.md.
* templates/codebuild-project.yaml — reusable CFN module (one CodeBuild
project per workflow, IAM Pattern B service role, webhook filter
groups for PR + push, optional batch builds, optional deploy-target
role assumption). Copyable into 8th-layer-marketing-website and
8th-layer-marketplace for #169 / #170.
* ci/buildspecs/ci-plugin.yml — buildspec for the ci-plugin canary.
Mirrors .github/workflows/ci-plugin.yaml exactly: install uv, run
`make setup-plugin lint-plugin`, cache uv install dir.
* ci/README.md — deploy + rollback instructions.
Existing .github/workflows/ci-plugin.yaml is intentionally untouched —
dual-runs alongside CodeBuild during the canary period per the decision
doc's Week-0 rollback plan.
Blocked on operator handshake of the shared CodeStar Connection
(arn:aws:codestar-connections:us-east-1:124074140789:connection/
59c82259-9b0e-4a07-990e-732a9eedec71). Once AVAILABLE, deploy via the
command in ci/README.md.
Refs #168
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
First canary of the GHA → CodeBuild migration scoped in
docs/decisions/13-gha-to-codebuild-migration.md.templates/codebuild-project.yaml— reusable CloudFormation module: one CodeBuild project per workflow, IAM Pattern B service role (<workflow>-<repo-short>-cb-role), webhook filter groups for PR (created/updated/reopened) + push tomain, optionalBatchBuildfor matrix workflows, optionalsts:AssumeRoleon a deploy-target role (e.g.marketing-website-deployer). Source = GitHub via CodeStarConnections so PR commit-status reports back automatically. Copyable verbatim into8th-layer-marketing-website/8th-layer-marketplacefor feat(L2 ui): apply 8th-Layer brand theme (replace mainline cq defaults) #169 / feat(L2 ui): Personas/agents directory + per-persona activity timeline #170.ci/buildspecs/ci-plugin.yml— buildspec mirroring.github/workflows/ci-plugin.yamlexactly (installuv, runmake setup-plugin lint-plugin, cache uv install dir). No tighten / no loosen.ci/README.md— deploy + rollback runbook.Status — blocked on operator action
Foundational AWS resources are already created in
8th-layer-app(124074140789/us-east-1):OneZero1ai-githubarn:aws:codestar-connections:us-east-1:124074140789:connection/59c82259-9b0e-4a07-990e-732a9eedec71/8th-layer-agent/pypi-api-tokenarn:aws:secretsmanager:us-east-1:124074140789:secret:/8th-layer-agent/pypi-api-token-OgN382Operator step: AWS console → Developer Tools → Settings → Connections → select
OneZero1ai-github→ Update pending connection → click through GitHub OAuth → install / reuse the AWS Connector for GitHub app on theOneZero1aiorg → grant the App access to8th-layer-agent(and later8th-layer-marketing-website,8th-layer-marketplace). Status flips toAVAILABLE.Deploy command (run after the connection is
AVAILABLE)aws --profile 8th-layer-app --region us-east-1 cloudformation deploy \ --template-file templates/codebuild-project.yaml \ --stack-name codebuild-ci-plugin-agent \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides \ RepoFullName=OneZero1ai/8th-layer-agent \ RepoShort=agent \ WorkflowName=ci-plugin \ BuildspecPath=ci/buildspecs/ci-plugin.yml \ ConnectionArn=arn:aws:codestar-connections:us-east-1:124074140789:connection/59c82259-9b0e-4a07-990e-732a9eedec71 \ WebhookFilePathFilter='^(plugins/cq/.*|schema/.*|\.github/workflows/ci-plugin\.yaml|ci/buildspecs/ci-plugin\.yml)$'Test plan
OneZero1ai-githubCodeStar Connection (statusAVAILABLE).cloudformation deploycommand above succeeds; stack reachesCREATE_COMPLETE.plugins/cq/**shows aci-plugin-agentcommit-status check on the PR head SHA, green alongside the existingPlugin CI / LintGHA check.Plugin CI / Lint→ci-plugin-agentand delete the GHA workflow in a follow-up PR.Notes / surprises
codestar-connectionsvscodeconnections. AWS renamed the service in 2024. CFNAWS::CodeBuild::Projectsource usesAuth.Type: CODECONNECTIONS(new spelling), but IAM actions exist under bothcodestar-connections:UseConnectionandcodeconnections:UseConnection. Service role policy grants both for forward compatibility.EVENT=PULL_REQUEST_*ANDBASE_REF=mainAND (optional)FILE_PATH=<regex>; push group:EVENT=PUSHANDHEAD_REF=main. Two groups joined by OR is the equivalent shape of GHAon: { push, pull_request }.ReportBuildStatus: trueunderSourceis what wires GitHub commit-status reporting; no separate webhook config needed.Refs #168.