-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): skip docs-only changes for clusterfuzzlite and container-image #793
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ce7f357
fix(ci): skip docs-only changes for clusterfuzzlite and container-image
seonghobae d978f70
fix(ci): make docs-only filters match GitHub path semantics
seonghobae 9e8bbe7
test(ci): require docs-only filters on each PR trigger
seonghobae b09ac9e
fix(ci): skip manual assets in ClusterFuzzLite PRs
seonghobae a1910e6
fix(ci): skip manual assets in container PR builds
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,10 @@ name: container-image | |
|
|
||
| on: | ||
| pull_request: | ||
| paths-ignore: | ||
| - "docs/**" | ||
| - "manual/**" | ||
| - "**.md" | ||
|
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
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,65 @@ | ||
| """Contracts for documentation-only GitHub Actions filtering.""" | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| _DOC_ONLY_PATHS = {"docs/**", "manual/**", "**.md"} | ||
|
|
||
|
|
||
| def _event_block(workflow: str, event: str) -> list[str]: | ||
| """Return one peer event block from the workflow's top-level ``on`` mapping.""" | ||
| lines = workflow.splitlines() | ||
| marker = f" {event}:" | ||
| try: | ||
| start = lines.index(marker) | ||
| except ValueError as exc: | ||
| raise AssertionError(f"missing workflow event: {event}") from exc | ||
|
|
||
| block: list[str] = [] | ||
| for line in lines[start + 1 :]: | ||
| if line.startswith(" ") and not line.startswith(" "): | ||
| break | ||
| block.append(line) | ||
| return block | ||
|
|
||
|
|
||
| def _paths_ignore(block: list[str]) -> set[str]: | ||
| """Read the ``paths-ignore`` list from one event block without quote coupling.""" | ||
| try: | ||
| start = block.index(" paths-ignore:") | ||
| except ValueError as exc: | ||
| raise AssertionError("event is missing paths-ignore") from exc | ||
|
|
||
| entries: set[str] = set() | ||
| for line in block[start + 1 :]: | ||
| if not line.startswith(" - "): | ||
| break | ||
| entries.add(line.removeprefix(" - ").strip().strip("'\"")) | ||
| return entries | ||
|
Comment on lines
+28
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "workflow_path", | ||
| ( | ||
| ".github/workflows/clusterfuzzlite.yml", | ||
| ".github/workflows/container-image.yml", | ||
| ), | ||
| ) | ||
| def test_pr_filters_ignore_all_documentation_assets(workflow_path: str) -> None: | ||
| """PR filters skip Markdown, generated docs, and non-Markdown manual assets.""" | ||
| workflow = Path(workflow_path).read_text(encoding="utf-8") | ||
| pull_request = _event_block(workflow, "pull_request") | ||
|
|
||
| assert _paths_ignore(pull_request) == _DOC_ONLY_PATHS | ||
|
|
||
|
|
||
| def test_tagged_container_release_does_not_claim_path_filtering() -> None: | ||
| """Tag pushes retain their release trigger without an ineffective path filter.""" | ||
| workflow = Path(".github/workflows/container-image.yml").read_text(encoding="utf-8") | ||
| push_section = _event_block(workflow, "push") | ||
|
|
||
| assert " paths-ignore:" not in push_section | ||
| assert " tags:" in push_section | ||
| assert " - 'v*'" in push_section | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 대규모 혼합 PR의 검증 누락
변경 파일이 300개를 넘고 코드가 비교 목록 밖이면,
paths-ignore와 컨테이너 필터는 워크플로를 건너뜁니다. 코드 변경이 퍼징과 컨테이너 빌드 없이 통과합니다.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.