Add reusable CI actions and workflows for Rails services - #197
Conversation
Composite actions (common/): - common/slack: Slack notify that resolves the triggerer to a Slack @mention via email - common/buf-generate: cache + buf generate (configurable cache path / template) - common/deploy-staging: generic staging EKS deploy via deploy/build.sh; frontend build and delayed-jobs stripped; prepare-build gated on MULTI_STEP_BUILD; buf cache on USE_BUF; parameterized ENVIRONMENT/TIMEOUT/ATOMIC/BUILD_ARGS/REF_NAME Reusable workflows (.github/workflows/): - buf-push: Ruby set up only when GENERATE_KEY_PROTOS; breaking-against URL derived from repo - database-schema-check: full schema-drift check; USE_BUF + SQL_MODE optional; documents the testing:unload_migrations rake task requirement - deploy-comment: @Deploy PR-comment deploy via github/branch-deploy; composes the above; USE_BUF + MULTI_STEP_BUILD optional Genericized from fadmin/store-admin; buf optional since vendors/ftp-sync don't use it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dcbickfo
left a comment
There was a problem hiding this comment.
The reusable workflows force a flat structure under .github/workflows and we need to support multiple languages. With that in mind I don't beleive we should be putting the reusable workflows in this repo.
The bulk of the repo is composite actions that we can string together to form small workflows in our services. The workflows and the added actions also re-implement substantial portions of the existing ruby and common actions. I strongly suggest porting in the improvements.
| with: | ||
| bundler-cache: true | ||
| env: | ||
| "BUNDLE_HTTPS://FLIPPLIB__JFROG__IO/FLIPPLIB/API/GEMS/FLIPP___GEMS/": ${{ secrets.BUNDLE_TOKEN }} |
There was a problem hiding this comment.
This looks like it uses a different convention than the database-schema-check.yml. Are the : and / also valid for env?
| name: 'Deploy to Staging' | ||
| description: 'Deploy a service to a staging EKS environment via deploy/build.sh. Generic — frontend build and delayed-jobs are not included.' | ||
|
|
||
| inputs: |
There was a problem hiding this comment.
This has substantial overlap with the existing deploy/eks actions and uses the (now deprecated) way to authenticate with AWS. The deploy/eks action supports both OIDC and the legacy method. Can we fold whatever we're looking at here in instead?
There was a problem hiding this comment.
Yep, I can look at this!
| @@ -0,0 +1,141 @@ | |||
| name: slack | |||
There was a problem hiding this comment.
This has substantial overlap with slack but does add new features in a meaningful way, can we fold it in instead of re-writing it?
There was a problem hiding this comment.
I didn't want to risk breaking things - one annoying part of the way we have this set up is that we'd have to bump the version on everything to v1 if we introduce breaking changes. If you're not worried about backwards compatibility or people accidentally pulling in the new version, I can definitely just replace the existing one with this.
| using: 'composite' | ||
| steps: | ||
| - name: Buf cache | ||
| uses: actions/cache@v4 |
There was a problem hiding this comment.
This pins to an older version of the cache action and follows a different idiom than the existing ruby/deps.
There was a problem hiding this comment.
Hmm... the point is that this is useful completely outside the scope of Ruby - i.e. it can be used for bare deploys which are language-agnostic. I'll update the cache though.
Not sure I understand this comment. GitHub enforces all reusable workflows to be in a flat structure. I can rename them so the one that's Ruby-specific (the DB one) has "ruby" in the name maybe? |
… versions - Remove common/deploy-staging; add its functionality (USE_BUF cache restore, MULTI_STEP_BUILD prepare-build, BUILD_ARGS, REF_NAME + ref-aware checkout) to the existing deploy/eks action. deploy-comment now composes deploy/eks. - Rename database-schema-check.yml -> ruby-database-schema-check.yml; switch its bundle auth from ARTIFACTORY_RUBY_TOKEN to the BUNDLE_TOKEN form used by buf-push. - Bump actions/cache @v4 -> @v5 and actions/checkout @v4 -> @v6. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@dcbickfo made some changes, please take a look! |
This PR adds a number of actions that we've introduced in fadmin and related repos over the last little while, so they can be used across the org. It also introduces reusable workflows that can be run from other repos.
Composite actions (common/):
@mention.Reusable workflows (.github/workflows/):
testing:unload_migrationsis required for this to work properly.@deploy stagingcomment on any PR.