Skip to content
Draft
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
1 change: 0 additions & 1 deletion .github/workflows/commercial-readiness-agent-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ on:
- ".github/workflows/commercial-readiness-loop.yml"
- ".github/workflows/commercial-readiness-agent-coverage.yml"
pull_request:
branches: [develop, main]
paths:
- "scripts/ci/commercial_readiness_loop.py"
- "scripts/ci/commercial_readiness_reconcile.py"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/controlplane-schema-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- "CHANGELOG.d/871-retention-schema-migration.md"
- ".github/workflows/controlplane-schema-coverage.yml"
pull_request:
branches: [develop, main]
paths:
- "appguardrail_core/controlplane_schema.py"
- "appguardrail_core/__init__.py"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/openssf-evidence-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: OpenSSF Evidence Coverage

on:
pull_request:
branches: [develop, main]
push:
branches: [develop, main]

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pinned-https-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Pinned HTTPS Coverage

on:
pull_request:
branches: [develop, main]
push:
branches: [develop, main]

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/retention-audit-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Retention Audit Coverage

on:
pull_request:
branches: [develop, main]
push:
branches: [develop, main]

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/scan-path-context-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]

permissions:
contents: read
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/security-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [develop, main, master]
pull_request:
branches: [develop, main, master]
schedule:
- cron: "31 4 * * 1"
workflow_dispatch:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]

permissions:
contents: read
Expand Down
61 changes: 61 additions & 0 deletions tests/test_docs_only_workflow_filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""Contracts preventing CI admission gaps for documentation and stacked pull requests."""

from pathlib import Path

import pytest


CONTRACT_SENSITIVE_WORKFLOWS = (
".github/workflows/tests.yml",
".github/workflows/openssf-evidence-coverage.yml",
".github/workflows/pinned-https-coverage.yml",
".github/workflows/retention-audit-coverage.yml",
".github/workflows/scan-path-context-coverage.yml",
)

STACKED_PR_WORKFLOWS = (
".github/workflows/tests.yml",
".github/workflows/security-process.yml",
".github/workflows/openssf-evidence-coverage.yml",
".github/workflows/pinned-https-coverage.yml",
".github/workflows/retention-audit-coverage.yml",
".github/workflows/scan-path-context-coverage.yml",
".github/workflows/controlplane-schema-coverage.yml",
".github/workflows/commercial-readiness-agent-coverage.yml",
)


def _event_block(workflow: str, event: str) -> 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 "\n".join(block)


@pytest.mark.parametrize("workflow_path", CONTRACT_SENSITIVE_WORKFLOWS)
def test_contract_sensitive_workflows_do_not_skip_documentation(
workflow_path: str,
) -> None:
"""Docs and policy Markdown remain covered until a dedicated contract lane exists."""
workflow = Path(workflow_path).read_text(encoding="utf-8")

for event in ("push", "pull_request"):
assert "paths-ignore:" not in _event_block(workflow, event)
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.


@pytest.mark.parametrize("workflow_path", STACKED_PR_WORKFLOWS)
def test_pull_request_checks_admit_stacked_bases(workflow_path: str) -> None:
"""PR checks must materialize when a reviewable stack targets another feature branch."""
workflow = Path(workflow_path).read_text(encoding="utf-8")

assert "branches:" not in _event_block(workflow, "pull_request")
Loading