Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/clusterfuzzlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: clusterfuzzlite

on:
pull_request:
paths-ignore:
- "docs/**"
- "manual/**"
- "**.md"
Comment on lines +5 to +8

Copy link
Copy Markdown

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
GitHub Actions의 pull_request 경로 필터는 생성된 변경 파일 목록 중 처음 300개만 평가합니다. .github/workflows/clusterfuzzlite.yml과 .github/workflows/container-image.yml의 paths-ignore 때문에, 앞쪽 300개가 docs/**, manual/** 또는 **.md이고 코드 파일이 그 뒤에 있는 대규모 혼합 PR은 두 검증을 실행하지 않습니다. 워크플로 자체는 모든 PR에서 시작하되 전체 변경 집합을 확인하는 사전 작업으로 문서 전용 여부를 판정하고, 비용이 큰 작업만 조건부로 실행하는 방식 등 300파일 제한을 받지 않는 구조로 바꾸십시오. 두 워크플로에 동일한 동작을 적용하고 대규모 혼합 변경 회귀 사례를 검증하십시오.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

workflow_dispatch:

permissions:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: container-image

on:
pull_request:
paths-ignore:
- "docs/**"
- "manual/**"
- "**.md"
Comment on lines +5 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: 문서 자산의 빌드 영향 없음

Docker 이미지는 선택된 프로젝트 파일만 복사하고, 퍼저는 애플리케이션 소스만 패키징합니다. 일반적인 문서 전용 변경은 두 산출물에 영향을 주지 않습니다.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

push:
tags:
- 'v*'
Expand Down
65 changes: 65 additions & 0 deletions tests/test_ci_path_filter_contract.py
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 실제 YAML 의미 검증 누락

_paths_ignore는 첫 문자열 블록만 읽습니다. 중복 키가 생기면 테스트는 통과해도 GitHub는 다른 최종 필터를 적용할 수 있습니다.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.



@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
Loading