Repository navigation
ci: notify Slack on closed issue comments #962
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
Changes from all commits
18fc54f
a0ef4d2
8ff072b
8e9eaa0
4f083b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: Closed Issue Comment | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
Comment on lines
+4
to
+5
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+4
to
+5
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+4
to
+5
This comment was marked as outdated.
Sorry, something went wrong. |
||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| closed-issue-comment: | ||
This comment was marked as outdated.
Sorry, something went wrong. |
||
| uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e04e810d6d7e452377bbefc04f007ad7373d19e2 # v0.6.0 | ||
|
Contributor
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. Codex AI review · Finding [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 To suppress repeats, reply |
||
| secrets: | ||
| SLACK_WEBHOOK_URL_ISSUE: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ on: | |
| - '.github/scripts/js_examples/**' | ||
| - '.github/scripts/tests/**' | ||
| - '.github/workflows/ai-pr-review.yml' | ||
| - '.github/workflows/closed-issue-comment.yml' | ||
|
Contributor
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. Codex AI review · Finding [P2] Include the new test module in the CI invocation This path filter starts To suppress repeats, reply |
||
| - '.github/workflows/issue-triage.yml' | ||
| - '.github/workflows/notify.yml' | ||
| - '.github/workflows/stale-issue-closer.yml' | ||
|
|
@@ -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' | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.