Build DocumentDB images from custom gitHub sources#354
Build DocumentDB images from custom gitHub sources#354hossain-rayhan wants to merge 3 commits intodocumentdb:mainfrom
Conversation
guanzhousongmicrosoft
left a comment
There was a problem hiding this comment.
the PR is fine, but please set up the github repo so only admin/maintainers can start the build, so approve the build started by external contributors, to protect malicious PR and workflow build
There was a problem hiding this comment.
Pull request overview
Enables building DocumentDB extension and gateway images using configurable upstream sources for personal testing.
Changes:
- Adds
workflow_dispatchinputs to override the DocumentDB release repo and gateway source image repo. - Updates workflow-level env vars to derive
DOCUMENTDB_RELEASE_REPOandGATEWAY_SOURCE_IMAGE_REPOfrom those inputs.
Allowed to modify only the repo/image name, not the owner. Now fork owner can only run workflow with their fork image and same for documentdb official repo. |
WentingWu666666
left a comment
There was a problem hiding this comment.
Suggest taking full owner/repo paths as inputs instead of coupling to github.repository_owner
The current design always prepends ${{ github.repository_owner }} to user-supplied values, so the user can override the repo name but never the owner. That has a few problems:
-
The defaults are only correct on the upstream repo. On any fork say
acme/documentdb-kubernetes-operatorthe defaultdocumentdb_repo: documentdbresolves toacme/documentdb, which probably doesn''t exist. The input has a "default" that''s effectively wrong everywhere exceptdocumentdb/documentdb-kubernetes-operator. -
Common dev workflows break. A developer who forks only the operator and wants to build/test against the upstream
documentdb/documentdbextension can''t they''re forced to also forkdocumentdb/documentdbinto their org just to satisfy the owner coupling. -
It conflates three independent things into one knob: the operator repo owner, the extension repo owner, and the gateway image registry path. They aren''t the same concept and shouldn''t be tied together.
-
The
gateway_source_imageframing is confusing. It''s described as "path under owner" but its default isdocumentdb/documentdb-local(itself a slash-separated path). When concatenated with owner you get a triple-segment ghcr path likeghcr.io/owner/documentdb/documentdb-local, which doesn''t match the "path under owner" mental model. -
The security framing for restricting owner is weak. This is a
workflow_dispatchworkflow only people with write access to the repo can run it. Letting them point at an arbitraryorg/repoisn''t meaningfully more dangerous than letting them edit the workflow file.
Suggested change take full paths
inputs:
documentdb_release_repo:
description: ''GitHub owner/repo for DocumentDB extension releases''
required: false
default: ''documentdb/documentdb''
gateway_source_image_repo:
description: ''Full container image repo for the gateway source image (registry/owner/path)''
required: false
default: ''ghcr.io/documentdb/documentdb/documentdb-local''
env:
DOCUMENTDB_RELEASE_REPO: ${{ github.event.inputs.documentdb_release_repo || ''documentdb/documentdb'' }}
GATEWAY_SOURCE_IMAGE_REPO: ${{ github.event.inputs.gateway_source_image_repo || ''ghcr.io/documentdb/documentdb/documentdb-local'' }}Benefits:
- Defaults are correct on upstream and on any fork
- Forks of just the operator can still build against upstream extension releases
- The input names match what they actually contain (no hidden owner concatenation)
- One knob per independent concept; no implicit coupling to
github.repository_owner - The
repository_dispatchtrigger keeps working unchanged because the env defaults handle the case when no inputs are provided
Signed-off-by: Rayhan Hossain <rhossain@microsoft.com>
Signed-off-by: Rayhan Hossain <rhossain@microsoft.com>
Signed-off-by: Rayhan Hossain <rhossain@microsoft.com>
6d49e26 to
a07e44b
Compare
|
@guanzhousongmicrosoft / @WentingWu666666, Lets go back to original full path repo/image. Its cleaner. I will work with @xgerman to setup strict rules on who can run the workflow. I don't have admin permission. |
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (ci); effort from diff stats (14+6 LOC, 1 files); LLM: Adds CI workflow support for building DocumentDB images from custom GitHub sources, primarily for personal/developer testing convenience. If a label is wrong, remove it manually and ping |
This is needed for personal testing.