Skip to content

Commit 9250432

Browse files
authored
Add internal cloud image release workflow [skip ci]
Adds a manual-only internal ECR image release path and makes Sentry optional only when explicitly disabled by that caller. Existing production callers retain strict Sentry requirements.
1 parent 42c9244 commit 9250432

3 files changed

Lines changed: 50 additions & 9 deletions

File tree

.github/workflows/_build-cloud.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
required: false
2323
type: string
2424
default: us-west-1
25+
require_sentry:
26+
description: "Require complete Sentry build configuration and source-map upload credentials"
27+
required: false
28+
type: boolean
29+
default: true
2530

2631
jobs:
2732
build:
@@ -58,13 +63,14 @@ jobs:
5863
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
5964
SENTRY_WEBAPP_PROJECT: ${{ vars.SENTRY_WEBAPP_PROJECT }}
6065
SENTRY_BACKEND_PROJECT: ${{ vars.SENTRY_BACKEND_PROJECT }}
66+
REQUIRE_SENTRY: ${{ inputs.require_sentry }}
6167
run: |
6268
missing=0
63-
for name in SENTRY_AUTH_TOKEN AWS_ECR_ROLE_ARN \
64-
NEXT_PUBLIC_SENTRY_ENVIRONMENT \
65-
NEXT_PUBLIC_SENTRY_WEBAPP_DSN \
66-
NEXT_PUBLIC_SENTRY_BACKEND_DSN \
67-
SENTRY_ORG SENTRY_WEBAPP_PROJECT SENTRY_BACKEND_PROJECT; do
69+
required_names="AWS_ECR_ROLE_ARN"
70+
if [ "$REQUIRE_SENTRY" = "true" ]; then
71+
required_names="$required_names SENTRY_AUTH_TOKEN NEXT_PUBLIC_SENTRY_ENVIRONMENT NEXT_PUBLIC_SENTRY_WEBAPP_DSN NEXT_PUBLIC_SENTRY_BACKEND_DSN SENTRY_ORG SENTRY_WEBAPP_PROJECT SENTRY_BACKEND_PROJECT"
72+
fi
73+
for name in $required_names; do
6874
if [ -z "${!name}" ]; then
6975
echo "::error::${name} is not set on the '${ENVIRONMENT}' environment (or the repository)."
7076
missing=1
@@ -73,9 +79,12 @@ jobs:
7379
fi
7480
done
7581
if [ "$missing" -ne 0 ]; then
76-
echo "::error::Refusing to build: the image would ship without Sentry wiring."
82+
echo "::error::Refusing to build: required environment configuration is missing."
7783
exit 1
7884
fi
85+
if [ "$REQUIRE_SENTRY" != "true" ]; then
86+
echo "Sentry wiring is intentionally disabled for the isolated internal demo image."
87+
fi
7988
8089
- name: Check Prisma migrations
8190
uses: ./.github/actions/check-prisma-migrations
@@ -128,8 +137,7 @@ jobs:
128137
SENTRY_RELEASE=${{ steps.commit.outputs.sha }}
129138
# Passed as a secret, not a build-arg: build args are recorded in layer
130139
# metadata that `mode=max` exports to the cache. @see: Dockerfile
131-
secrets: |
132-
sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}
140+
secrets: ${{ inputs.require_sentry && format('sentry_auth_token={0}', secrets.SENTRY_AUTH_TOKEN) || '' }}
133141
# Cache scope is per-environment, and distinct from the OSS build's
134142
# (which is keyed on platform alone). Sharing a scope would let a build
135143
# that never sees SENTRY_AUTH_TOKEN restore layers from one that did.
@@ -141,15 +149,20 @@ jobs:
141149
ENVIRONMENT: ${{ inputs.environment }}
142150
COMMIT_SHA: ${{ steps.commit.outputs.sha }}
143151
TAGS: ${{ steps.meta.outputs.tags }}
152+
REQUIRE_SENTRY: ${{ inputs.require_sentry }}
144153
run: |
154+
sentry_summary="disabled"
155+
if [ "$REQUIRE_SENTRY" = "true" ]; then
156+
sentry_summary="$COMMIT_SHA"
157+
fi
145158
{
146159
echo "### Pushed to ECR"
147160
echo
148161
echo "| | |"
149162
echo "|---|---|"
150163
echo "| Environment | \`${ENVIRONMENT}\` |"
151164
echo "| Commit | \`${COMMIT_SHA}\` |"
152-
echo "| Sentry release | \`${COMMIT_SHA}\` |"
165+
echo "| Sentry | \`${sentry_summary}\` |"
153166
echo
154167
echo '```'
155168
echo "$TAGS"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Sourcebot (Cloud - Internal Demo)
2+
3+
permissions:
4+
contents: read
5+
id-token: write
6+
7+
on:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: release-cloud-internal
12+
cancel-in-progress: false
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/_build-cloud.yml
17+
with:
18+
environment: internal
19+
# Pin the checkout and image tags to the same dispatch commit so metadata
20+
# can never identify image contents as a different revision.
21+
git_ref: ${{ github.sha }}
22+
require_sentry: false
23+
docker_tags: |
24+
type=raw,value=main
25+
type=raw,value=sha-${{ github.sha }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- Added a manually triggered cloud image release workflow for isolated internal deployments. [#1566](https://github.com/sourcebot-dev/sourcebot/pull/1566)
12+
1013
## [5.1.6] - 2026-08-10
1114

1215
### Added

0 commit comments

Comments
 (0)