Skip to content

Commit e3da14b

Browse files
chore: Improve repository structure with templates and documentation
1 parent 0f7efef commit e3da14b

File tree

11 files changed

+463
-295
lines changed

11 files changed

+463
-295
lines changed

.github/CODEOWNERS

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Code owners for msgtrace-sdk
2+
#
3+
# These owners will be automatically requested for review
4+
# when someone opens a pull request.
5+
6+
# Default owner for everything
7+
* @vilsonrodrigues
8+
9+
# Documentation
10+
/docs/ @vilsonrodrigues
11+
*.md @vilsonrodrigues
12+
13+
# CI/CD and automation
14+
/.github/ @vilsonrodrigues
15+
/scripts/ @vilsonrodrigues
16+
17+
# Core SDK
18+
/src/msgtrace/sdk/ @vilsonrodrigues
19+
/src/msgtrace/core/ @vilsonrodrigues
20+
21+
# Tests
22+
/tests/ @vilsonrodrigues
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to report a bug! Please fill out the information below.
10+
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Description
15+
description: A clear and concise description of what the bug is.
16+
placeholder: What happened?
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: reproduce
22+
attributes:
23+
label: Steps to Reproduce
24+
description: Steps to reproduce the behavior
25+
placeholder: |
26+
1. Install msgtrace-sdk
27+
2. Run code with '...'
28+
3. See error
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: expected
34+
attributes:
35+
label: Expected Behavior
36+
description: What did you expect to happen?
37+
placeholder: What should have happened?
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
id: actual
43+
attributes:
44+
label: Actual Behavior
45+
description: What actually happened?
46+
placeholder: What actually happened instead?
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: code
52+
attributes:
53+
label: Code Example
54+
description: Minimal code to reproduce the issue
55+
render: python
56+
placeholder: |
57+
from msgtrace.sdk import Spans, MsgTraceAttributes
58+
59+
# Your code here
60+
61+
- type: input
62+
id: version
63+
attributes:
64+
label: msgtrace-sdk Version
65+
description: What version are you using?
66+
placeholder: "1.0.0"
67+
validations:
68+
required: true
69+
70+
- type: input
71+
id: python-version
72+
attributes:
73+
label: Python Version
74+
description: What Python version are you using?
75+
placeholder: "3.11"
76+
validations:
77+
required: true
78+
79+
- type: input
80+
id: os
81+
attributes:
82+
label: Operating System
83+
description: What OS are you running?
84+
placeholder: "Ubuntu 22.04 / macOS 14 / Windows 11"
85+
86+
- type: textarea
87+
id: additional
88+
attributes:
89+
label: Additional Context
90+
description: Any other information that might be helpful (logs, screenshots, etc.)
91+
placeholder: Add any other context about the problem here
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Feature Request
2+
description: Suggest an idea or enhancement
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for suggesting a new feature! Please describe your idea below.
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem Statement
15+
description: Is your feature request related to a problem? Please describe.
16+
placeholder: I'm frustrated when...
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: solution
22+
attributes:
23+
label: Proposed Solution
24+
description: Describe the solution you'd like
25+
placeholder: I would like to be able to...
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: alternatives
31+
attributes:
32+
label: Alternatives Considered
33+
description: Have you considered any alternative solutions or workarounds?
34+
placeholder: I've tried...
35+
36+
- type: textarea
37+
id: use-case
38+
attributes:
39+
label: Use Case
40+
description: Describe your use case and how this feature would help
41+
placeholder: This would help me...
42+
validations:
43+
required: true
44+
45+
- type: textarea
46+
id: example
47+
attributes:
48+
label: Code Example (Optional)
49+
description: If applicable, show how you'd like to use this feature
50+
render: python
51+
placeholder: |
52+
from msgtrace.sdk import Spans
53+
54+
# Your desired API usage
55+
56+
- type: textarea
57+
id: additional
58+
attributes:
59+
label: Additional Context
60+
description: Any other information that might be helpful
61+
placeholder: Add any other context or screenshots about the feature request here

.github/pull_request_template.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## Summary
2+
3+
<!-- Brief description of what this PR does -->
4+
5+
## Changes
6+
7+
<!-- List the main changes in this PR -->
8+
-
9+
-
10+
-
11+
12+
## Type of Change
13+
14+
<!-- Mark the relevant option with an "x" -->
15+
- [ ] Bug fix (non-breaking change which fixes an issue)
16+
- [ ] New feature (non-breaking change which adds functionality)
17+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
18+
- [ ] Documentation update
19+
- [ ] Code refactoring
20+
- [ ] Performance improvement
21+
- [ ] Test improvement
22+
- [ ] CI/CD improvement
23+
- [ ] Chore/maintenance
24+
25+
## Testing
26+
27+
<!-- Describe how you tested these changes -->
28+
- [ ] Tests pass locally (`uv run pytest -v`)
29+
- [ ] Added new tests for this change
30+
- [ ] Updated existing tests
31+
32+
## Documentation
33+
34+
<!-- Check if documentation needs updating -->
35+
- [ ] Updated README.md (if API changed)
36+
- [ ] Updated CHANGELOG.md (if notable change)
37+
- [ ] Added/updated code comments
38+
- [ ] Added/updated docstrings
39+
40+
## Checklist
41+
42+
<!-- Mark completed items with an "x" -->
43+
- [ ] Code formatted (`uv run ruff format`)
44+
- [ ] Lint checks pass (`uv run ruff check`)
45+
- [ ] Tests pass (`uv run pytest -v`)
46+
- [ ] **Version NOT changed** (maintainers bump version after merge)
47+
- [ ] Commit messages follow [conventional commits](https://www.conventionalcommits.org/)
48+
- [ ] No breaking changes (or documented above)
49+
- [ ] Added tests for new features
50+
- [ ] Documentation is up to date
51+
52+
## Additional Notes
53+
54+
<!-- Any additional information reviewers should know -->

.github/release-drafter.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,49 @@ name-template: 'v$RESOLVED_VERSION'
22
tag-template: 'v$RESOLVED_VERSION'
33

44
categories:
5+
- title: '🚨 Breaking Changes'
6+
labels:
7+
- 'breaking-change'
8+
- 'breaking'
59
- title: '🚀 Features'
610
labels:
711
- 'enhancement'
812
- 'feat'
13+
- 'feature'
914
- title: '🐛 Bug Fixes'
1015
labels:
1116
- 'bug'
1217
- 'fix'
18+
- title: '⚡ Performance'
19+
labels:
20+
- 'performance'
21+
- 'perf'
22+
- title: '🔐 Security'
23+
labels:
24+
- 'security'
1325
- title: '📚 Documentation'
1426
labels:
1527
- 'documentation'
1628
- 'docs'
29+
- title: '🔄 Refactoring'
30+
labels:
31+
- 'refactor'
32+
- 'refactoring'
1733
- title: '🧪 Tests'
1834
labels:
1935
- 'tests'
2036
- 'test'
21-
- title: '⚡ Performance'
37+
- title: '🤖 CI/CD'
2238
labels:
23-
- 'performance'
24-
- 'perf'
39+
- 'ci'
40+
- 'ci-cd'
41+
- title: '📦 Dependencies'
42+
labels:
43+
- 'dependencies'
2544
- title: '🔧 Maintenance'
2645
labels:
2746
- 'maintenance'
2847
- 'chore'
29-
- title: '🔐 Security'
30-
labels:
31-
- 'security'
32-
- title: '📦 Dependencies'
33-
labels:
34-
- 'dependencies'
3548

3649
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
3750
change-title-escapes: '\<*_&'

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
default_install_hook_types: [pre-commit, pre-push]
2+
3+
repos:
4+
# Security: Detect secrets and credentials
5+
- repo: https://github.com/gitleaks/gitleaks
6+
rev: v8.23.1
7+
hooks:
8+
- id: gitleaks
9+
10+
# UV: Keep uv.lock in sync
11+
- repo: https://github.com/astral-sh/uv-pre-commit
12+
rev: 0.8.3
13+
hooks:
14+
- id: uv-lock
15+
16+
# Ruff: Linting and formatting
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.11.7
19+
hooks:
20+
- id: ruff
21+
args: [--fix]
22+
- id: ruff-format

CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,67 @@ https://github.com/msgflux/msgtrace-sdk/settings/secrets/actions
491491
- `PYPI_API_TOKEN` - From https://pypi.org/manage/account/token/
492492
- `TEST_PYPI_API_TOKEN` - From https://test.pypi.org/manage/account/token/
493493

494+
## 📦 Development Setup
495+
496+
### Setup
497+
498+
```bash
499+
# Clone repository
500+
git clone https://github.com/msgflux/msgtrace-sdk.git
501+
cd msgtrace-sdk
502+
503+
# Install dependencies
504+
uv sync
505+
506+
# Install with dev dependencies
507+
uv sync --group dev
508+
```
509+
510+
### Testing
511+
512+
```bash
513+
# Run tests
514+
uv run pytest -v
515+
516+
# With coverage
517+
uv run pytest -v --cov=src/msgtrace --cov-report=html
518+
519+
# Run specific test
520+
uv run pytest tests/test_attributes.py -v
521+
```
522+
523+
### Code Quality
524+
525+
```bash
526+
# Format code
527+
uv run ruff format
528+
529+
# Lint
530+
uv run ruff check
531+
532+
# Auto-fix
533+
uv run ruff check --fix
534+
```
535+
536+
### CI/CD
537+
538+
The project uses GitHub Actions for CI/CD:
539+
540+
- **CI** (`ci.yml`) - Lint, format, test on Python 3.10-3.13
541+
- **Validate Release** (`validate-release.yml`) - Security validation for releases
542+
- **Publish** (`publish.yml`) - Publishes to PyPI after validation
543+
- **Merge Bot** (`merge-bot.yml`) - Command-based PR merging with `/merge` and `/update`
544+
- **Stale Bot** (`stale.yml`) - Closes stale issues/PRs
545+
- **Release Drafter** (`release-drafter.yml`) - Auto-generates release notes
546+
- **CodeQL** (`codeql.yml`) - Security scanning
547+
- **Dependabot** - Automated dependency updates
548+
549+
See [AUTOMATION.md](docs/AUTOMATION.md) for detailed automation documentation.
550+
551+
### Release Process
552+
553+
To release a new version, use the automated release script. See the "For Maintainers: Creating Releases" section above for detailed instructions.
554+
494555
## 📚 Resources
495556

496557
- [Conventional Commits](https://www.conventionalcommits.org/)
@@ -499,3 +560,5 @@ https://github.com/msgflux/msgtrace-sdk/settings/secrets/actions
499560
- [Ruff Documentation](https://docs.astral.sh/ruff/)
500561
- [pytest Documentation](https://docs.pytest.org/)
501562
- [GitHub Actions](https://docs.github.com/en/actions)
563+
- [Automation Guide](docs/AUTOMATION.md)
564+
- [Roadmap](docs/ROADMAP.md)

0 commit comments

Comments
 (0)