Skip to content

fix: add Hub and Cube env vars to Docker build secrets#7950

Merged
Dhruwang merged 7 commits into
epic/v5from
fix/docker-build-hub-api-url
May 7, 2026
Merged

fix: add Hub and Cube env vars to Docker build secrets#7950
Dhruwang merged 7 commits into
epic/v5from
fix/docker-build-hub-api-url

Conversation

@Dhruwang
Copy link
Copy Markdown
Member

@Dhruwang Dhruwang commented May 7, 2026

Summary

  • Makes HUB_API_URL, HUB_API_KEY, CUBEJS_API_URL, and CUBEJS_API_SECRET required in env.ts — Hub and Cube are mandatory in v5
  • Adds all four as Docker build secrets with dummy fallbacks
  • Fixes the 5.0.0-beta.1 Docker release build failure

Changes

  • apps/web/lib/env.tsHUB_API_KEY: z.string().trim().min(1), CUBEJS_API_SECRET: z.string().trim().min(1), CUBEJS_API_URL: z.url() (HUB_API_URL was already required)
  • read-secrets.sh — reads Hub and Cube secrets with fallbacks
  • Dockerfile — mounts hub_api_url, hub_api_key, cubejs_api_url, cubejs_api_secret secrets
  • build-and-push-docker/action.yml — passes new secrets and env vars to Depot build
  • All Docker workflows — provides dummy values from secrets.*

Required repo secrets

Secret Value
DUMMY_HUB_API_URL http://localhost:4000
DUMMY_HUB_API_KEY any non-empty string
DUMMY_CUBEJS_API_URL http://localhost:4000
DUMMY_CUBEJS_API_SECRET any non-empty string

Note: read-secrets.sh has built-in fallbacks, so builds won't break before secrets are added.

Test plan

  • Re-run the release Docker build to verify it passes
  • Verify docker-build-validation workflow passes on this PR
  • Add the 4 new repo secrets listed above

🤖 Generated with Claude Code

Dhruwang and others added 2 commits May 7, 2026 16:18
HUB_API_URL is required by the Zod env validation at build time but was
not provided as a Docker secret, causing the release build to fail.

Adds HUB_API_URL with a dummy fallback (http://localhost:4000) to the
build pipeline, following the same pattern as DATABASE_URL/REDIS_URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

Walkthrough

This pull request adds a new hub_api_url build secret throughout the Docker build and CI/CD pipeline. The change flows from the composite GitHub Action definition through workflow environment setup, into the Dockerfile secret mounting, and finally to the runtime script that reads and exports the secret. The composite action now passes hub_api_url to the underlying build tool, workflows supply the DUMMY_HUB_API_URL environment variable, the Dockerfile mounts it as a BuildKit secret, and the read-secrets.sh script loads it with a fallback value when unavailable.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title references 'Hub and Cube' but the raw_summary shows only HUB_API_URL changes, while the description mentions CUBEJS vars that aren't reflected in the title. Clarify if both Hub and Cube changes are included; if so, the title accurately reflects both main changes, making it complete.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description provides comprehensive context on purpose, changes made, and test plan, covering most template requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Makes Cube env vars mandatory in env.ts (per PR #7913) and adds them
as Docker build secrets with fallback values, following the same pattern
as DATABASE_URL, REDIS_URL, and HUB_API_URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dhruwang Dhruwang changed the title fix: add HUB_API_URL to Docker build secrets fix: add Hub and Cube env vars to Docker build secrets May 7, 2026
Dhruwang and others added 2 commits May 7, 2026 16:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hub is mandatory in v5, so HUB_API_KEY should fail fast at startup
if not configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dhruwang Dhruwang requested a review from pandeymangg May 7, 2026 11:37
Tests now expect validation failures when CUBEJS_API_URL, CUBEJS_API_SECRET,
or HUB_API_KEY are missing, and all test env helpers provide HUB_API_KEY.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@Dhruwang Dhruwang merged commit f4ca7c4 into epic/v5 May 7, 2026
12 checks passed
@Dhruwang Dhruwang deleted the fix/docker-build-hub-api-url branch May 7, 2026 11:52
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