Skip to content
Merged
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
48 changes: 48 additions & 0 deletions .github/scripts/tests/test_closed_issue_comment_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import re
from pathlib import Path
from typing import Any

import pytest
import yaml

WORKFLOW_PATH = Path(__file__).parents[2] / "workflows" / "closed-issue-comment.yml"
TEST_PARSER_PATH = Path(__file__).parents[2] / "workflows" / "test-parser.yml"


@pytest.fixture(name="workflow")
def workflow_fixture() -> dict[Any, Any]:
return yaml.safe_load(WORKFLOW_PATH.read_text())


def test_runs_on_new_issue_comments_only(workflow: dict[Any, Any]) -> None:
# PyYAML reads the bare key `on` as the boolean True.
assert workflow[True] == {"issue_comment": {"types": ["created"]}}


def test_calls_shared_workflow_pinned_to_commit(workflow: dict[Any, Any]) -> None:
uses = workflow["jobs"]["closed-issue-comment"]["uses"]

assert re.fullmatch(
r"aws/aws-durable-execution-ci/\.github/workflows/closed-issue-comment\.yml"
r"@[0-9a-f]{40}",
uses,
)


def test_passes_issue_webhook_secret(workflow: dict[Any, Any]) -> None:
secrets = workflow["jobs"]["closed-issue-comment"]["secrets"]

assert secrets == {"SLACK_WEBHOOK_URL_ISSUE": "${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}"}


def test_grants_no_token_permissions(workflow: dict[Any, Any]) -> None:
assert workflow["permissions"] == {}
assert "permissions" not in workflow["jobs"]["closed-issue-comment"]


def test_workflow_triggers_script_tests() -> None:
parser = yaml.safe_load(TEST_PARSER_PATH.read_text())
path = ".github/workflows/closed-issue-comment.yml"

assert path in parser[True]["pull_request"]["paths"]
assert path in parser[True]["push"]["paths"]
13 changes: 13 additions & 0 deletions .github/workflows/closed-issue-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Closed Issue Comment

This comment was marked as outdated.


on:
issue_comment:
types: [created]
Comment on lines +4 to +5

This comment was marked as outdated.

Comment on lines +4 to +5

This comment was marked as outdated.

Comment on lines +4 to +5

This comment was marked as outdated.


permissions: {}

jobs:
closed-issue-comment:

This comment was marked as outdated.

uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e04e810d6d7e452377bbefc04f007ad7373d19e2 # v0.6.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex AI review · Finding arf_v1_2xohdvw7bsaig56rojp7jzl2a2

[P2] Return the undocumented decisions to design review

The description lists the runner, commenter exclusions, and immediate notification policy as decisions but supplies no reasons. This breaks rule 7, List the decisions that the task did not cover, which requires a reason for each decision. For example, the stated ubuntu-latest choice differs from the existing shared-workflow callers’ explicit CodeBuild selection without explaining why. Please return to the design phase under rule 8, step 6, document the rationales, and obtain maintainer agreement.

To suppress repeats, reply /ai verdict deferred, /ai verdict false-positive, or /ai verdict out-of-scope on the first nonblank line. Add rationale on later lines. A new /ai verdict accepted allows future repeats again.

secrets:
SLACK_WEBHOOK_URL_ISSUE: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}
2 changes: 2 additions & 0 deletions .github/workflows/test-parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- '.github/scripts/js_examples/**'
- '.github/scripts/tests/**'
- '.github/workflows/ai-pr-review.yml'
- '.github/workflows/closed-issue-comment.yml'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex AI review · Finding arf_v1_vbxiwfrqy5apoiq7z2uckvluh7

[P2] Include the new test module in the CI invocation

This path filter starts test-scripts, but its Run script tests step explicitly enumerates test modules and omits test_closed_issue_comment_workflow.py. Root pytest discovery also excludes .github/scripts/tests, so the main CI job does not collect it either. Consequently, none of the five new checks runs in CI, allowing workflow regressions to pass unnoticed. Add the new module to the script-test invocation.

To suppress repeats, reply /ai verdict deferred, /ai verdict false-positive, or /ai verdict out-of-scope on the first nonblank line. Add rationale on later lines. A new /ai verdict accepted allows future repeats again.

- '.github/workflows/issue-triage.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/stale-issue-closer.yml'
Expand All @@ -30,6 +31,7 @@ on:
- '.github/scripts/js_examples/**'
- '.github/scripts/tests/**'
- '.github/workflows/ai-pr-review.yml'
- '.github/workflows/closed-issue-comment.yml'
- '.github/workflows/issue-triage.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/stale-issue-closer.yml'
Expand Down
Loading