Skip to content

Commit 277e1c9

Browse files
authored
Merge pull request #113 from Chisanan232/develop
[CU-86evcmf04] Improve the document and CI workflow of CI scripts
2 parents 76bddbd + 7948d4e commit 277e1c9

File tree

10 files changed

+925
-10
lines changed

10 files changed

+925
-10
lines changed

.github/workflows/rw_uv_run_test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ on:
7575
type: string
7676
required: false
7777
default: '["ubuntu-latest", "ubuntu-22.04", "macos-latest", "macos-14"]'
78+
handle-coverage-report:
79+
description: "Enable to rename and upload pytest coverage reports."
80+
type: boolean
81+
required: false
82+
default: true
7883
secrets:
7984
e2e_test_api_token:
8085
description: "Set the API token for end-to-end test if it needs."
@@ -106,6 +111,7 @@ jobs:
106111
107112
- name: Install all the project dependencies
108113
if: ${{ inputs.install_dependency_with_group == '' }}
114+
working-directory: ${{ inputs.test_working_directory }}
109115
run: uv sync --locked --all-extras --dev
110116

111117
- name: Build Python runtime environment by UV with dependency group *${{ inputs.install_dependency_with_group }}*
@@ -147,11 +153,13 @@ jobs:
147153
E2E_TEST_API_TOKEN: ${{ secrets.e2e_test_api_token }}
148154

149155
- name: Rename the code coverage result file
156+
if: ${{ inputs.handle-coverage-report }}
150157
working-directory: ${{ inputs.test_working_directory }}
151158
run: |
152159
mv ./.coverage ./.coverage.${{ inputs.test_type }}.${{ matrix.os }}-${{ matrix.python-version }}
153160
154161
- name: Upload code coverage result file
162+
if: ${{ inputs.handle-coverage-report }}
155163
uses: actions/upload-artifact@v5
156164
with:
157165
name: coverage_${{ inputs.test_type }}_${{ matrix.os }}_${{ matrix.python-version }}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
# No matter for push or pull request events, it would trigger CI for safely saving the source code.
5+
# For the push event, it only runs building and testing.
6+
push:
7+
branches:
8+
- "master"
9+
paths:
10+
# For GitHub Action
11+
- ".github/workflows/test-ci-scripts.yaml"
12+
# For source code and test
13+
- "scripts/ci/**/*.py"
14+
- "scripts/test/**/*.py"
15+
# For configurations for test or CI
16+
- "scripts/pytest.ini"
17+
# For Python project configuration
18+
- "scripts/pyproject.toml"
19+
- "scripts/uv.lock"
20+
21+
# For the push event, in addition to build and test would be run, it would trigger other service to keep the reports
22+
# or other checking, i.e., record the test report by CodeCov and check the code quality by SonarQube.
23+
pull_request:
24+
branches:
25+
- "master"
26+
paths:
27+
# For GitHub Action
28+
- ".github/workflows/test-ci-scripts.yaml"
29+
# For source code and test
30+
- "scripts/ci/**/*.py"
31+
- "scripts/test/**/*.py"
32+
# For configurations for test or CI
33+
- "scripts/pytest.ini"
34+
# For Python project configuration
35+
- "scripts/pyproject.toml"
36+
- "scripts/uv.lock"
37+
38+
jobs:
39+
run_script-test:
40+
# name: Run all contract test items
41+
uses: ./.github/workflows/rw_uv_run_test.yaml
42+
with:
43+
test_type: ci-script-test
44+
test_folder: './test/ci_script_test'
45+
python-versions: '["3.13"]'
46+
operating-systems: '["ubuntu-latest", "ubuntu-22.04", "macos-latest", "macos-14"]'
47+
test_working_directory: './scripts'
48+
handle-coverage-report: false

docs/src/pages/showcase.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const PROJECTS: ShowcaseProject[] = [
1414
isTemplate: true,
1515
},
1616
{
17-
title: 'Slack-MCP-Server-Backend-MQ-Template',
18-
description: 'A specialized template for building Slack MCP servers with message queue backends, featuring production-ready CI/CD workflows.',
19-
website: 'https://github.com/Chisanan232/Slack-MCP-Server-Backend-MQ-Template',
20-
source: 'https://github.com/Chisanan232/Slack-MCP-Server-Backend-MQ-Template',
17+
title: 'Abstract Backend Implementation Template',
18+
description: 'An opinionated starter kit that implements the Abstract Backend Execution pattern end-to-end with queue orchestration, observability, and CI/CD already wired in.',
19+
website: 'https://github.com/Chisanan232/abstract-backend-implementation-template',
20+
source: 'https://github.com/Chisanan232/abstract-backend-implementation-template',
2121
tags: ['template', 'mcp', 'message-queue', 'poetry'],
2222
isTemplate: true,
2323
},
@@ -43,10 +43,10 @@ const PROJECTS: ShowcaseProject[] = [
4343
tags: ['library', 'framework', 'backend', 'python'],
4444
},
4545
{
46-
title: 'MCP-BackEnd-Message-Queue-Redis',
47-
description: 'Redis-based message queue backend for MCP servers, showcasing integration testing with external services.',
48-
website: 'https://github.com/Chisanan232/MCP-BackEnd-Message-Queue-Redis',
49-
source: 'https://github.com/Chisanan232/MCP-BackEnd-Message-Queue-Redis',
46+
title: 'ABE Redis',
47+
description: 'Redis-backed queue implementation for the Abstract Backend Execution ecosystem, featuring async job processing, telemetry hooks, and integration test fixtures.',
48+
website: 'https://github.com/Chisanan232/abe-redis',
49+
source: 'https://github.com/Chisanan232/abe-redis',
5050
tags: ['library', 'redis', 'message-queue', 'integration'],
5151
},
5252
];

scripts/ci/release_intent.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,25 @@ class ReleaseIntentError(Exception):
2929
"""Custom exception for release intent parsing errors."""
3030

3131

32+
def _resolve_tag_and_release_path() -> Path:
33+
"""Return the directory containing tag and release artifacts."""
34+
candidates = [
35+
Path.cwd() / ".github" / "tag_and_release",
36+
Path.cwd().parent / ".github" / "tag_and_release",
37+
Path(__file__).resolve().parent.parent / ".github" / "tag_and_release",
38+
]
39+
40+
for candidate in candidates:
41+
if candidate.exists():
42+
return candidate
43+
44+
# Fall back to current working directory even if it doesn't exist yet to provide consistent error messaging
45+
return candidates[0]
46+
47+
3248
def load_schema() -> SchemaType:
3349
"""Load and return the JSON schema for release intent validation."""
34-
schema_path = Path("../.github/tag_and_release/schema.json")
50+
schema_path = _resolve_tag_and_release_path() / "schema.json"
3551

3652
if not schema_path.exists():
3753
raise ReleaseIntentError(f"Schema file not found: {schema_path}")
@@ -45,7 +61,7 @@ def load_schema() -> SchemaType:
4561

4662
def load_intent_file() -> Optional[ReleaseIntent]:
4763
"""Load the release intent YAML file if it exists."""
48-
intent_path = Path("../.github/tag_and_release/intent.yaml")
64+
intent_path = _resolve_tag_and_release_path() / "intent.yaml"
4965

5066
if not intent_path.exists():
5167
return None

scripts/pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ dependencies = [
1616
[project.scripts]
1717
release-intent = "ci.release_intent:main"
1818

19+
[dependency-groups]
20+
dev = [
21+
"pytest>=8.4.1,<9",
22+
]
23+
1924
[tool.hatch.build.targets.sdist]
2025
include = ["ci/"]
2126

scripts/pytest.ini

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# pytest.ini
2+
[pytest]
3+
minversion = 7.0.0
4+
addopts =
5+
; --cov=slack_mcp/
6+
; --cov-config=./.coveragerc
7+
; --cov-report=term-missing
8+
; --cov-fail-under=95
9+
-r a
10+
-vv
11+
; --reruns 1
12+
13+
log_cli = 1
14+
log_cli_level = INFO
15+
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)
16+
log_cli_date_format=%Y-%m-%d %H:%M:%S
17+
18+
# Filter warnings
19+
filterwarnings =
20+
# Ignore coverage warning about --include being ignored
21+
ignore:--include is ignored because --source is set

scripts/test/__init__.py

Whitespace-only changes.

scripts/test/ci_script_test/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)