-
Notifications
You must be signed in to change notification settings - Fork 1
fix(containers): publish explicit split runtime targets #1365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
14
commits into
develop
Choose a base branch
from
fix/publish-independent-runtime-targets
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b38b0d2
test(containers): require explicit runtime image targets
seonghobae 159245c
fix(containers): name combined runtime build target
seonghobae 4525556
fix(containers): name frontend runtime build target
seonghobae 43666be
fix(containers): bind release images to explicit targets
seonghobae a84a666
Merge branch 'develop' into fix/publish-independent-runtime-targets
seonghobae 042b0c7
Fix path-traversal vulnerability in attachment filename parsing (#1455)
seonghobae 8c71263
Merge a84a666e5501a43fa010809c1cc00395a9ca9700 into 042b0c70531b229af…
seonghobae 1bda1b5
fix: 프런트엔드 컨테이너 시작 명령의 외부 shell 제거
seonghobae 807eaa8
fix: 릴리스 검증의 컨테이너 시작 명령 계약 동기화
seonghobae ae002eb
fix: 독립 백엔드 이미지의 OCI 기본 라벨 보존
seonghobae b533aa6
fix: 고정 컨테이너 UID의 시스템 계정 범위 명시
seonghobae 08417ad
fix: 로컬 가상환경을 컨테이너 빌드에서 제외
seonghobae 597192f
docs: 독립 이미지 수리와 실제 검증 경계 기록
seonghobae 9b137f2
fix(ci): PR 이미지 검증의 캐시 출력을 명시
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| """Regression contracts for independently deployable OCI runtime images. | ||
|
|
||
| The release workflow publishes three compatibility surfaces: a backend image, a | ||
| frontend image, and the legacy combined ``naruon`` image. Each matrix entry must | ||
| select an explicit Docker build target so a future Dockerfile stage reorder | ||
| cannot silently turn the backend artifact back into the combined runtime. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import yaml | ||
|
|
||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[2] | ||
| DOCKER_PUBLISH_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "docker-publish.yml" | ||
|
|
||
|
|
||
| def _component_entry(workflow: dict[object, object], job_name: str, component: str) -> dict[str, object]: | ||
| """Return one named image-matrix entry from a release workflow job.""" | ||
| jobs = workflow["jobs"] | ||
| assert isinstance(jobs, dict) | ||
| job = jobs[job_name] | ||
| assert isinstance(job, dict) | ||
| strategy = job["strategy"] | ||
| assert isinstance(strategy, dict) | ||
| matrix = strategy["matrix"] | ||
| assert isinstance(matrix, dict) | ||
| entries = matrix["include"] | ||
| assert isinstance(entries, list) | ||
| matches = [entry for entry in entries if entry.get("component") == component] | ||
| assert len(matches) == 1, f"expected exactly one {component!r} matrix entry" | ||
| entry = matches[0] | ||
| assert isinstance(entry, dict) | ||
| return entry | ||
|
|
||
|
|
||
| def test_release_workflow_selects_explicit_independent_runtime_targets() -> None: | ||
| """Publish backend/frontend artifacts from explicit independent stages.""" | ||
| workflow_text = DOCKER_PUBLISH_WORKFLOW.read_text(encoding="utf-8") | ||
| workflow = yaml.safe_load(workflow_text) | ||
| assert isinstance(workflow, dict) | ||
|
|
||
| for job_name in ("pull_request_image_validation", "publish_images"): | ||
| backend = _component_entry(workflow, job_name, "backend") | ||
| frontend = _component_entry(workflow, job_name, "frontend") | ||
| combined = _component_entry(workflow, job_name, "naruon") | ||
|
|
||
| assert backend["dockerfile"] == "Dockerfile" | ||
| assert backend["target"] == "backend-runtime" | ||
| assert frontend["dockerfile"] == "frontend/Dockerfile" | ||
| assert frontend["target"] == "frontend-runtime" | ||
| assert combined["dockerfile"] == "Dockerfile" | ||
| assert combined["target"] == "combined-runtime" | ||
|
|
||
| assert workflow_text.count("target: ${{ matrix.target }}") == 2 | ||
|
|
||
| root_dockerfile = (REPO_ROOT / "Dockerfile").read_text(encoding="utf-8") | ||
| frontend_dockerfile = (REPO_ROOT / "frontend" / "Dockerfile").read_text( | ||
| encoding="utf-8" | ||
| ) | ||
| assert "FROM backend-runtime AS combined-runtime" in root_dockerfile | ||
| assert " AS frontend-runtime" in frontend_dockerfile.splitlines()[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.