Skip to content

Pass the Sidekiq Pro login to the build as a BuildKit secret - #2059

Merged
cru-Luis-Rodriguez merged 2 commits into
masterfrom
fix/sidekiq-creds-buildkit-secret
Nov 17, 2026
Merged

cru-Luis-Rodriguez merged 2 commits into
masterfrom
fix/sidekiq-creds-buildkit-secret

Conversation

@cru-Luis-Rodriguez

Copy link
Copy Markdown
Contributor

Why

The Sidekiq Pro login (SIDEKIQ_CREDS) reaches the image as a build arg, and bundle config --global then writes it to /root/.bundle/config. That leaves it in an image layer and in the image history. This PR passes it as a BuildKit secret instead, as we agreed with the Apps team. It's the same change as CruGlobal/fl-pos-admin#118.

What changes

  • build.sh passes the login with --secret id=sidekiq_creds,env=SIDEKIQ_CREDS instead of --build-arg.
  • The bundle install RUN mounts that secret as BUNDLE_GEMS__CONTRIBSYS__COM, the variable Bundler reads for gems.contribsys.com. It only exists while that RUN runs.
  • ARG SIDEKIQ_CREDS and the bundle config --global line are gone.
  • The same RUN removes /root/.bundle. Bundler names its index cache folder there after the source URL, and that name includes the gem server username. Gems install to /usr/local/bundle, so nothing later needs that folder.

What was checked

  • This repo's CI built the branch, build only with no deploy (run 43907415720, image staging-11387). Bundler fetched and installed sidekiq-pro 8.0.3 with the login from the secret.
  • No entry in that image's history records the login. The current production image (production-11386) has 4.

Notes

  • .env keeps its empty SIDEKIQ_CREDS= placeholder. dotenv only loads it in dev and test, and nothing reads that variable.
  • staging still has the old Dockerfile, so staging builds keep the build arg until this reaches it. After review, the On Staging label has merge-bot merge it there and build stage.
  • Merging to master builds and deploys production. Rollback is redeploying production-11386.
  • Once master has built with this change, I'll clear the Linux-buildx-* Actions caches so the next builds start clean.

@frett, this is the mobile-content-api PR from the SIDEKIQ_CREDS thread. Could you or someone on the GodTools team run the agent-review on it when you have a minute?

🤖 Generated with Claude Code

build.sh passed SIDEKIQ_CREDS as a build arg, and the Dockerfile saved it
with bundle config --global. That put the gem server login in the image
history and in /root/.bundle/config in a layer.

Now build.sh hands it over with --secret, and only the bundle install RUN
mounts it, as BUNDLE_GEMS__CONTRIBSYS__COM. The same RUN removes
/root/.bundle, because Bundler names its index cache folder there after
the source URL, username included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cru-Luis-Rodriguez

Copy link
Copy Markdown
Contributor Author

@JasonBennett41 @frett Friendly nudge on this one too. It's green after the master update, and it's the same Sidekiq login change that's already live on fl-pos-admin and staff-conf-onsite. Thanks!

@frett frett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cru-Luis-Rodriguez I'll approve it, but I no longer work on godtools

@cru-Luis-Rodriguez
cru-Luis-Rodriguez merged commit 76d6690 into master Nov 17, 2026
13 checks passed
@cru-Luis-Rodriguez
cru-Luis-Rodriguez deleted the fix/sidekiq-creds-buildkit-secret branch November 17, 2026 17:31
cru-Luis-Rodriguez added a commit that referenced this pull request Nov 17, 2026
Resolve the Dockerfile conflict with #2059: keep its BuildKit secret mount and /root/.bundle removal, then run the gem cleanup in the same RUN.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants