git-bot-feedback 0.4.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- git_bot_feedback-0.5.1/AGENTS.md +135 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/CHANGELOG.md +18 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/Cargo.lock +88 -88
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/Cargo.toml +1 -1
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/PKG-INFO +16 -2
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/README.md +13 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/README.rst +15 -1
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/bindings/python/CHANGELOG.md +20 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/bindings/python/Cargo.toml +2 -2
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/bindings/python/README.rst +15 -1
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/cspell.config.yml +1 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/common.rs +1 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitea/mod.rs +18 -23
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitea/serde_structs.rs +13 -6
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitea/specific_api.rs +98 -33
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitlab/mod.rs +12 -1
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/mod.rs +8 -1
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/.gitattributes +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/.gitignore +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/.pre-commit-config.yaml +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/CONTRIBUTING.md +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/LICENSE +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/bindings/python/git_bot_feedback.pyi +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/bindings/python/src/lib.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/bindings/python/src/wrapper.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/build.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/codecov.yml +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/client.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/file-annotations.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/file-changes.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/index.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/output-variables.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/pr-reviews.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/API/thread-comments.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/_static/favicon.ico +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/_static/logo.png +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/conf.py +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/index.rst +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/logo.xcf +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/docs/permissions/gitlab.md +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/git_bot_feedback.pyi +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/nurfile +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/pyproject.toml +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/github/graphql.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/github/mod.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/github/serde_structs.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/github/specific_api.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitlab/diff_positions.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitlab/reviews.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitlab/serde_structs.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/gitlab/specific_api.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/client/local.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/comments/mod.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/comments/review_comments.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/comments/thread_comments.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/error.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/file_annotations.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/file_utils/file_filter.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/file_utils/mod.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/git_diff.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/lib.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/src/output_variable.rs +0 -0
- {git_bot_feedback-0.4.0 → git_bot_feedback-0.5.1}/uv.lock +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Agent Guidelines for git-bot-feedback
|
|
2
|
+
|
|
3
|
+
This document provides conventions, architectural context, and workflow commands for AI coding agents operating on this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
`git-bot-feedback` is a Rust library designed for CI workflows and automation tools to provide feedback on git hosting platforms:
|
|
8
|
+
- **Supported git servers**: GitHub, GitLab (>= v17.9), Gitea, Forgejo (BitBucket planned).
|
|
9
|
+
- **Core capabilities**: Thread comments (PR and commit), CI step summaries, output variables, log grouping, file annotations, Pull Request reviews, and changed file analysis.
|
|
10
|
+
- **Multi-language project**: Rust crate at workspace root (`git-bot-feedback`) and Python bindings in `bindings/python` (`git-bot-feedback-py` built with PyO3/Maturin).
|
|
11
|
+
- **License**: LGPL-3.0-or-later.
|
|
12
|
+
|
|
13
|
+
## Critical Invariants & Rules
|
|
14
|
+
|
|
15
|
+
### 1. Test Execution Rule: Never Run `cargo test` Directly
|
|
16
|
+
> [!IMPORTANT]
|
|
17
|
+
> Do **not** run raw `cargo test` for unit or integration tests!
|
|
18
|
+
> The test suite relies heavily on manipulating environment variables. `cargo test` executes tests concurrently within the same process space, causing severe cross-test pollution and intermittent failures.
|
|
19
|
+
> Always execute tests through `cargo-nextest` (or `nur test`), which provides process isolation for each individual test.
|
|
20
|
+
|
|
21
|
+
Note, this project is primarily hosted on GitHub; any mirrors on other platforms are considered unofficial. Therefore, the CI workflows and tests all are designed for GitHub Actions.
|
|
22
|
+
|
|
23
|
+
### 2. Line Endings & Whitespace
|
|
24
|
+
- **Line endings**: All files must strictly use LF (`\n`), never CRLF (`\r\n`).
|
|
25
|
+
- **Trailing whitespace**: No trailing whitespace permitted.
|
|
26
|
+
- **End of file**: Every file must terminate with a single trailing newline.
|
|
27
|
+
- **File size**: Do not commit large files (> 500 kB).
|
|
28
|
+
|
|
29
|
+
### 3. Commit Messages and Pull Request Titles
|
|
30
|
+
- Must strictly conform to [Conventional Commits](https://www.conventionalcommits.org) specifications.
|
|
31
|
+
- Allowed commit types (enforced in `.config/committed.toml`):
|
|
32
|
+
`fix`, `feat`, `build`, `chore`, `docs`, `style`, `refactor`, `remove`, `deprecate`, `security`, `add`, `perf`, `test`.
|
|
33
|
+
- **Subject casing**: Must start with a lowercase letter (`subject_capitalized = false`).
|
|
34
|
+
- Pull request titles are validated in CI against Conventional Commits via `committed` and spell-checked via CSpell.
|
|
35
|
+
- Feature branches are squashed into a single commit upon merge into `main` so `git-cliff` can generate release notes and `CHANGELOG.md`.
|
|
36
|
+
|
|
37
|
+
### 4. Spelling & Terminology
|
|
38
|
+
- CI enforces CSpell across all project files (`cspell.config.yml`).
|
|
39
|
+
- If you introduce new technical terms, acronyms, or crate names, verify they do not fail spell checking or add them to `cspell.config.yml`.
|
|
40
|
+
|
|
41
|
+
## Task Runner: `nur`
|
|
42
|
+
|
|
43
|
+
This project uses [nur](https://crates.io/crates/nur) (a task runner using Nushell syntax) defined in `nurfile`. Prefer `nur` tasks over composite manual commands.
|
|
44
|
+
|
|
45
|
+
| Task | Command | Description |
|
|
46
|
+
| :--- | :--- | :--- |
|
|
47
|
+
| **Run Tests** | `nur test` | Runs tests with `cargo-nextest` under the `default` profile (marks tests > 10s as "SLOW"). |
|
|
48
|
+
| **Run CI Tests** | `nur test -p ci` | Runs all tests including slow tests with verbose output. |
|
|
49
|
+
| **Run Doc Tests** | `nur test docs` | Runs doc tests (`cargo test --doc --features file-changes`). |
|
|
50
|
+
| **Generate Coverage** | `nur test lcov` / `nur test html` | Generates LCOV or HTML coverage via `cargo-llvm-cov`. |
|
|
51
|
+
| **Lint & Format Check** | `nur lint --check` | Runs `cargo clippy --workspace --features file-changes --all-targets -- -D warnings` and `cargo fmt -- --check`. |
|
|
52
|
+
| **Auto-Fix Lint & Fmt** | `nur lint` | Applies clippy auto-fixes and formats code with `cargo fmt`. |
|
|
53
|
+
| **Pre-Commit Checks** | `nur pre-commit` | Runs pre-commit hooks via `uvx` on all files. |
|
|
54
|
+
| **Build Examples** | `nur examples` | Builds all examples in `examples/`. |
|
|
55
|
+
| **Build Docs** | `nur docs` | Builds Rust documentation (`cargo doc --no-deps --lib --features file-changes`). |
|
|
56
|
+
| **Build Python Docs**| `nur docs py` | Builds Python documentation using Sphinx and `uv`. |
|
|
57
|
+
|
|
58
|
+
### Fallback Commands (if `nur` is unavailable)
|
|
59
|
+
- **Run tests**:
|
|
60
|
+
Without coverage measurements:
|
|
61
|
+
```shell
|
|
62
|
+
cargo nextest run --features "test-skip-wait-for-rate-limit,file-changes" --profile default
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
With coverage measurements:
|
|
66
|
+
```shell
|
|
67
|
+
cargo llvm-cov --no-report --features "test-skip-wait-for-rate-limit,file-changes" nextest --profile default
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
To generate a coverage report:
|
|
71
|
+
```shell
|
|
72
|
+
cargo llvm-cov report --lcov --output-path lcov.info
|
|
73
|
+
# or for json output
|
|
74
|
+
cargo llvm-cov report --json --output-path coverage.json
|
|
75
|
+
```
|
|
76
|
+
Git ignores both lcov.info and coverage.json files.
|
|
77
|
+
|
|
78
|
+
Use `cargo llvm-cov clean` to flush previous coverage measurements, if fresh coverage report is needed. This will invoke a fresh compile when running the test suite.
|
|
79
|
+
- **Lint check**:
|
|
80
|
+
```shell
|
|
81
|
+
cargo clippy --workspace --features file-changes --all-targets -- -D warnings
|
|
82
|
+
cargo fmt -- --check
|
|
83
|
+
```
|
|
84
|
+
- **Pre-commit**:
|
|
85
|
+
```shell
|
|
86
|
+
uvx pre-commit run --all-files
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## CI Pipeline Overview
|
|
90
|
+
|
|
91
|
+
Automated GitHub Actions workflows run on pushes and PRs to `main`:
|
|
92
|
+
1. **`pre-commit.yml`**:
|
|
93
|
+
- `all-files`: Runs pre-commit hooks (whitespace, LF line endings, YAML/TOML syntax, file size limits, CSpell, Ruff, Mypy).
|
|
94
|
+
- `lint-rust`: Runs `nur lint --check` (`cargo clippy` with `-D warnings` and `cargo fmt -- --check`).
|
|
95
|
+
- `check-pr-title`: Verifies PR title with `committed` and `cspell-cli`.
|
|
96
|
+
- `lint-ci`: Checks GitHub Actions workflows with `zizmor`.
|
|
97
|
+
2. **`rust.yml`**:
|
|
98
|
+
- Runs `nur test docs` (documentation examples).
|
|
99
|
+
- Runs `nur examples` (compiles all examples).
|
|
100
|
+
- Runs `nur test --profile ci` (runs nextest test suite under CI profile).
|
|
101
|
+
- Generates and uploads `lcov.info` coverage report to Codecov.
|
|
102
|
+
- Publishes to crates.io upon tagged release (`git-bot-feedback/v*`).
|
|
103
|
+
3. **`docs.yml`**:
|
|
104
|
+
- Builds Python Sphinx docs and deploys to GitHub Pages on `main`.
|
|
105
|
+
- Builds Rustdoc documentation and uploads artifacts.
|
|
106
|
+
4. **`python.yml`**:
|
|
107
|
+
- Compiles and packages Python wheels across platforms (Linux, macOS, Windows) and architectures using `maturin`.
|
|
108
|
+
- Validates distribution packages with `twine check`.
|
|
109
|
+
- Publishes to PyPI upon tagged release (`git-bot-feedback-py/v*`).
|
|
110
|
+
5. **`bump-n-release.yml`**:
|
|
111
|
+
- Automated version bumping and release orchestration script (`bump-n-release.nu`).
|
|
112
|
+
|
|
113
|
+
## Cargo Features & TLS Architecture
|
|
114
|
+
|
|
115
|
+
- **Default features**: `["github", "gitea", "gitlab"]`.
|
|
116
|
+
- **Optional features**:
|
|
117
|
+
- `file-changes`: Enables git diff inspection (`fast-glob`, `regex`).
|
|
118
|
+
- `pyo3`: Enables Python binding support.
|
|
119
|
+
- `custom-git-server-impl`: Silences compiler error when git server implementations are disabled.
|
|
120
|
+
- `test-skip-wait-for-rate-limit`: Dev-only feature to bypass rate-limit wait timeouts in unit tests.
|
|
121
|
+
- **TLS backend**: The library intentionally does not specify a TLS backend for `reqwest` so consumers can select their preferred backend. For dev/testing workflows, `reqwest` dev-dependencies enable `features = ["default-tls"]`.
|
|
122
|
+
|
|
123
|
+
## Repository Structure
|
|
124
|
+
|
|
125
|
+
- `src/`: Core library implementation.
|
|
126
|
+
- `client/`: Git server client implementations (`github/`, `gitlab/`, `gitea/`, and common traits).
|
|
127
|
+
- `types.rs`, `lib.rs`: Public APIs, data models, and error types.
|
|
128
|
+
- `tests/`: Integration tests using `cargo-nextest`, `mockito`, and `tempfile`.
|
|
129
|
+
- `examples/`: Example executables demonstrating library usage.
|
|
130
|
+
- `bindings/python/`: Python bindings using PyO3 and Maturin (`git-bot-feedback-py`).
|
|
131
|
+
- `docs/`: Sphinx documentation sources for Python and web guides.
|
|
132
|
+
- `.config/`: Configuration files for `nextest.toml`, `committed.toml`, and `cliff.toml`.
|
|
133
|
+
- `nurfile`: Nushell-based task runner definitions.
|
|
134
|
+
- `.pre-commit-config.yaml`: Pre-commit hook definitions.
|
|
135
|
+
- `cspell.config.yml`: Spelling dictionary configuration.
|
|
@@ -6,12 +6,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
<!-- markdownlint-disable MD024 -->
|
|
8
8
|
|
|
9
|
+
## [git-bot-feedback/v0.11.0] - 2026-10-27
|
|
10
|
+
|
|
11
|
+
### <!-- 1 --> 🚀 Added
|
|
12
|
+
|
|
13
|
+
- Support Forgejo Actions by @shenxianpeng in [#154](https://github.com/2bndy5/git-bot-feedback/pull/154)
|
|
14
|
+
|
|
15
|
+
### <!-- 4 --> 🛠️ Fixed
|
|
16
|
+
|
|
17
|
+
- Add impl for `GitlabApiClient::workspace_root()` by @2bndy5 in [#153](https://github.com/2bndy5/git-bot-feedback/pull/153)
|
|
18
|
+
|
|
19
|
+
[git-bot-feedback/v0.11.0]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback/v0.10.0...git-bot-feedback/v0.11.0
|
|
20
|
+
|
|
21
|
+
Full commit diff: [`git-bot-feedback/v0.10.0...git-bot-feedback/v0.11.0`][git-bot-feedback/v0.11.0]
|
|
22
|
+
|
|
9
23
|
## [git-bot-feedback/v0.10.0] - 2026-10-27
|
|
10
24
|
|
|
11
25
|
### <!-- 1 --> 🚀 Added
|
|
12
26
|
|
|
13
27
|
- Add GitLab support by @shenxianpeng in [#146](https://github.com/2bndy5/git-bot-feedback/pull/146)
|
|
14
28
|
|
|
29
|
+
### <!-- 6 --> 📦 Dependency updates
|
|
30
|
+
|
|
31
|
+
- Bump version to git-bot-feedback/v0.10.0 by @2bndy5 in [`cb5351a`](https://github.com/2bndy5/git-bot-feedback/commit/cb5351aa30c18e2d3c94235d0c932a7e93b8f254)
|
|
32
|
+
|
|
15
33
|
[git-bot-feedback/v0.10.0]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback/v0.9.0...git-bot-feedback/v0.10.0
|
|
16
34
|
|
|
17
35
|
Full commit diff: [`git-bot-feedback/v0.9.0...git-bot-feedback/v0.10.0`][git-bot-feedback/v0.10.0]
|