Skip to content

Commit e075713

Browse files
authored
pr into review from xueyulinn/feature/set-up-backend-server
Set up server, router, and GitHub webhook handling with tests
2 parents d48d643 + e50b4c1 commit e075713

27 files changed

Lines changed: 1292 additions & 27 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Bug Report
2+
description: Report a bug or regression.
3+
title: "[Bug]: "
4+
labels:
5+
- bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
# Bug Report
11+
12+
- type: textarea
13+
id: summary
14+
attributes:
15+
label: Summary
16+
placeholder: Briefly describe the bug.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: steps_to_reproduce
22+
attributes:
23+
label: Steps to Reproduce
24+
placeholder: |
25+
1. Go to ...
26+
2. Run ...
27+
3. Observe ...
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: expected_behavior
33+
attributes:
34+
label: Expected Behavior
35+
placeholder: Describe the expected result.
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: actual_behavior
41+
attributes:
42+
label: Actual Behavior
43+
placeholder: Describe what actually happened.
44+
validations:
45+
required: true
46+
47+
- type: textarea
48+
id: environment
49+
attributes:
50+
label: Environment
51+
placeholder: |
52+
- OS:
53+
- Python version:
54+
- Package manager:
55+
- FastAPI version:
56+
- Deployment environment:
57+
validations:
58+
required: true
59+
60+
- type: textarea
61+
id: logs_or_error_message
62+
attributes:
63+
label: Logs / Error Message
64+
placeholder: Paste relevant logs, stack traces, or error messages.
65+
render: shell
66+
67+
- type: input
68+
id: related_repository_pr_issue
69+
attributes:
70+
label: Related Repository / PR / Issue
71+
placeholder: e.g. org/repo, #123, or PR #456
72+
73+
- type: textarea
74+
id: additional_context
75+
attributes:
76+
label: Additional Context
77+
placeholder: Add any extra context, screenshots, or links.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Feature Request
2+
description: Suggest an improvement or new capability.
3+
title: "[Feature]: "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
# Feature Request
11+
12+
- type: textarea
13+
id: problem
14+
attributes:
15+
label: Problem
16+
placeholder: What problem are you trying to solve?
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: proposed_solution
22+
attributes:
23+
label: Proposed Solution
24+
placeholder: Describe the proposed change.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: use_case
30+
attributes:
31+
label: Use Case
32+
placeholder: Explain the practical use case for this feature.
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: expected_user_experience
38+
attributes:
39+
label: Expected User Experience
40+
placeholder: Describe the desired end-user experience.
41+
42+
- type: textarea
43+
id: alternatives_considered
44+
attributes:
45+
label: Alternatives Considered
46+
placeholder: Describe any alternatives you considered.
47+
48+
- type: dropdown
49+
id: priority
50+
attributes:
51+
label: Priority
52+
options:
53+
- Low
54+
- Medium
55+
- High
56+
validations:
57+
required: true
58+
59+
- type: textarea
60+
id: additional_context
61+
attributes:
62+
label: Additional Context
63+
placeholder: Add any extra details, links, or examples.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Agent Review Feedback
2+
description: Report low-quality or incorrect agent review output.
3+
title: "[Agent Review]: "
4+
labels:
5+
- feedback
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
# Agent Review Feedback
11+
12+
- type: dropdown
13+
id: feedback_type
14+
attributes:
15+
label: Feedback Type
16+
options:
17+
- False positive
18+
- False negative
19+
- Low-quality suggestion
20+
- Incorrect explanation
21+
- Security-related issue
22+
- Performance-related issue
23+
- Other
24+
validations:
25+
required: true
26+
27+
- type: input
28+
id: repository_pr_link
29+
attributes:
30+
label: Repository / PR Link
31+
placeholder: Paste the repository or pull request link.
32+
validations:
33+
required: true
34+
35+
- type: input
36+
id: agent_comment_link
37+
attributes:
38+
label: Agent Comment Link
39+
placeholder: Paste the link to the relevant agent comment.
40+
41+
- type: textarea
42+
id: original_agent_comment
43+
attributes:
44+
label: Original Agent Comment
45+
placeholder: Paste the original agent comment.
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
id: why_this_feedback_is_needed
51+
attributes:
52+
label: Why This Feedback Is Needed
53+
placeholder: Explain why the review output was problematic.
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
id: expected_correct_behavior
59+
attributes:
60+
label: Expected Correct Behavior
61+
placeholder: Describe the expected correct behavior or review outcome.
62+
validations:
63+
required: true
64+
65+
- type: textarea
66+
id: relevant_code_snippet
67+
attributes:
68+
label: Relevant Code Snippet
69+
placeholder: Paste any relevant code snippet.
70+
render: text
71+
72+
- type: dropdown
73+
id: severity
74+
attributes:
75+
label: Severity
76+
options:
77+
- Low
78+
- Medium
79+
- High
80+
- Critical
81+
validations:
82+
required: true
83+
84+
- type: textarea
85+
id: additional_context
86+
attributes:
87+
label: Additional Context
88+
placeholder: Add any supporting context, screenshots, or links.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Questions and discussions
4+
url: https://github.com/xueyulinn/codehawk/discussions
5+
about: Ask questions or start general discussions here.

.github/pull_request_template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Pull Request
2+
3+
## Summary
4+
5+
## Related Issue
6+
7+
## Type of Change
8+
- [ ] Bug fix
9+
- [ ] New feature
10+
- [ ] Refactor
11+
- [ ] Documentation
12+
- [ ] Test
13+
- [ ] CI/CD
14+
- [ ] Chore
15+
16+
## Changes Made
17+
18+
## How to Test
19+
20+
## Checklist
21+
- [ ] Code builds successfully
22+
- [ ] Tests added or updated
23+
- [ ] Existing tests pass
24+
- [ ] Documentation updated if needed
25+
- [ ] No secrets or sensitive data included
26+
- [ ] Breaking changes documented
27+
28+
## Breaking Changes
29+
30+
## Additional Notes

.github/workflows/pr.yaml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version-file: ".python-version"
21+
22+
- name: Set up uv
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
enable-cache: true
26+
cache-dependency-glob: |
27+
pyproject.toml
28+
uv.lock
29+
30+
- name: Install dependencies
31+
run: uv sync --frozen --group dev
32+
33+
- name: Compile Python sources
34+
run: uv run python -m compileall codehawk
35+
36+
lint:
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Check out repository
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version-file: ".python-version"
47+
48+
- name: Set up uv
49+
uses: astral-sh/setup-uv@v5
50+
with:
51+
enable-cache: true
52+
cache-dependency-glob: |
53+
pyproject.toml
54+
uv.lock
55+
56+
- name: Install dependencies
57+
run: uv sync --frozen --group dev
58+
59+
- name: Run lint checks
60+
run: uv run ruff check .
61+
62+
unit-test:
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- name: Check out repository
67+
uses: actions/checkout@v4
68+
69+
- name: Set up Python
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version-file: ".python-version"
73+
74+
- name: Set up uv
75+
uses: astral-sh/setup-uv@v5
76+
with:
77+
enable-cache: true
78+
cache-dependency-glob: |
79+
pyproject.toml
80+
uv.lock
81+
82+
- name: Install dependencies
83+
run: uv sync --frozen --group dev
84+
85+
- name: Run unit tests
86+
if: ${{ hashFiles('tests/**/*.py', '**/test_*.py', '**/*_test.py') != '' }}
87+
run: uv run pytest
88+
89+
- name: Skip unit tests when no tests are present
90+
if: ${{ hashFiles('tests/**/*.py', '**/test_*.py', '**/*_test.py') == '' }}
91+
run: echo "No test files found; skipping pytest."
92+
93+
type-check:
94+
runs-on: ubuntu-latest
95+
96+
steps:
97+
- name: Check out repository
98+
uses: actions/checkout@v4
99+
100+
- name: Set up Python
101+
uses: actions/setup-python@v5
102+
with:
103+
python-version-file: ".python-version"
104+
105+
- name: Set up uv
106+
uses: astral-sh/setup-uv@v5
107+
with:
108+
enable-cache: true
109+
cache-dependency-glob: |
110+
pyproject.toml
111+
uv.lock
112+
113+
- name: Install dependencies
114+
run: uv sync --frozen --group dev
115+
116+
- name: Run type checks
117+
run: uv run mypy codehawk

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ wheels/
1111

1212
# envs
1313
.env
14+
15+
# fastapi cloud
16+
.fastapicloud
17+
18+
# static checks
19+
.ruff_cache
20+
.mypy_cache
21+
pytest*
22+
.pytest*

0 commit comments

Comments
 (0)