git-bot-feedback 0.6.0__tar.gz → 0.6.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.6.0 → git_bot_feedback-0.6.1}/CHANGELOG.md +14 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/Cargo.lock +2 -2
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/Cargo.toml +1 -1
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/PKG-INFO +1 -1
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/CHANGELOG.md +15 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/Cargo.toml +2 -2
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/src/wrapper.rs +8 -1
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitlab/mod.rs +2 -1
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitlab/specific_api.rs +2 -1
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/mod.rs +28 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/.gitattributes +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/.gitignore +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/.pre-commit-config.yaml +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/AGENTS.md +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/CONTRIBUTING.md +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/LICENSE +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/README.md +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/README.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/README.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/git_bot_feedback.pyi +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/src/lib.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/bindings/python/src/py_types.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/build.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/codecov.yml +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/cspell.config.yml +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/client.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/errors.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/file-annotations.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/file-changes.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/http.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/index.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/output-variables.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/pr-reviews.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/API/thread-comments.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/_static/favicon.ico +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/_static/logo.png +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/conf.py +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/index.rst +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/logo.xcf +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/docs/permissions/gitlab.md +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/git_bot_feedback.pyi +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/nurfile +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/pyproject.toml +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/common.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitea/mod.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitea/serde_structs.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitea/specific_api.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/github/graphql.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/github/mod.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/github/serde_structs.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/github/specific_api.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitlab/diff_positions.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitlab/reviews.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/gitlab/serde_structs.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/client/local.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/comments/mod.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/comments/review_comments.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/comments/thread_comments.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/error.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/file_annotations.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/file_utils/file_filter.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/file_utils/mod.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/git_diff.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/lib.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/src/output_variable.rs +0 -0
- {git_bot_feedback-0.6.0 → git_bot_feedback-0.6.1}/uv.lock +0 -0
|
@@ -6,6 +6,16 @@ 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.12.1] - 2026-11-06
|
|
10
|
+
|
|
11
|
+
### <!-- 4 --> 🛠️ Fixed
|
|
12
|
+
|
|
13
|
+
- Use same-origin redirect policy by @2bndy5 in [#165](https://github.com/2bndy5/git-bot-feedback/pull/165)
|
|
14
|
+
|
|
15
|
+
[git-bot-feedback/v0.12.1]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback/v0.12.0...git-bot-feedback/v0.12.1
|
|
16
|
+
|
|
17
|
+
Full commit diff: [`git-bot-feedback/v0.12.0...git-bot-feedback/v0.12.1`][git-bot-feedback/v0.12.1]
|
|
18
|
+
|
|
9
19
|
## [git-bot-feedback/v0.12.0] - 2026-11-06
|
|
10
20
|
|
|
11
21
|
### <!-- 1 --> 🚀 Added
|
|
@@ -17,6 +27,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
27
|
|
|
18
28
|
- Use the API root set by Gitea's runner and fill in missing methods by @shenxianpeng in [#162](https://github.com/2bndy5/git-bot-feedback/pull/162)
|
|
19
29
|
|
|
30
|
+
### <!-- 6 --> 📦 Dependency updates
|
|
31
|
+
|
|
32
|
+
- Bump version to git-bot-feedback/v0.12.0 by @2bndy5 in [`eae30be`](https://github.com/2bndy5/git-bot-feedback/commit/eae30be526aa3ee97954ab314a45b1569f2e3c7d)
|
|
33
|
+
|
|
20
34
|
### <!-- 9 --> 🗨️ Changed
|
|
21
35
|
|
|
22
36
|
- Eliminate fallback to "unknown" event name by @2bndy5 in [#164](https://github.com/2bndy5/git-bot-feedback/pull/164)
|
|
@@ -413,7 +413,7 @@ dependencies = [
|
|
|
413
413
|
|
|
414
414
|
[[package]]
|
|
415
415
|
name = "git-bot-feedback"
|
|
416
|
-
version = "0.12.
|
|
416
|
+
version = "0.12.1"
|
|
417
417
|
dependencies = [
|
|
418
418
|
"async-trait",
|
|
419
419
|
"chrono",
|
|
@@ -433,7 +433,7 @@ dependencies = [
|
|
|
433
433
|
|
|
434
434
|
[[package]]
|
|
435
435
|
name = "git-bot-feedback-py"
|
|
436
|
-
version = "0.6.
|
|
436
|
+
version = "0.6.1"
|
|
437
437
|
dependencies = [
|
|
438
438
|
"git-bot-feedback",
|
|
439
439
|
"pyo3",
|
|
@@ -21,7 +21,7 @@ features = ["http2", "charset", "system-proxy"]
|
|
|
21
21
|
[package]
|
|
22
22
|
name = "git-bot-feedback"
|
|
23
23
|
description = "A library designed for CI tools that posts comments on a Pull Request."
|
|
24
|
-
version = "0.12.
|
|
24
|
+
version = "0.12.1"
|
|
25
25
|
edition.workspace = true
|
|
26
26
|
license.workspace = true
|
|
27
27
|
repository.workspace = true
|
|
@@ -6,6 +6,20 @@ 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-py/v0.6.1] - 2026-11-06
|
|
10
|
+
|
|
11
|
+
### <!-- 4 --> 🛠️ Fixed
|
|
12
|
+
|
|
13
|
+
- Use same-origin redirect policy by @2bndy5 in [#165](https://github.com/2bndy5/git-bot-feedback/pull/165)
|
|
14
|
+
|
|
15
|
+
### <!-- 6 --> 📦 Dependency updates
|
|
16
|
+
|
|
17
|
+
- Bump version to git-bot-feedback/v0.12.1 by @2bndy5 in [`1eb37b3`](https://github.com/2bndy5/git-bot-feedback/commit/1eb37b3dc60bac0465f8f7e03ca3572671b4a48b)
|
|
18
|
+
|
|
19
|
+
[git-bot-feedback-py/v0.6.1]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback-py/v0.6.0...git-bot-feedback-py/v0.6.1
|
|
20
|
+
|
|
21
|
+
Full commit diff: [`git-bot-feedback-py/v0.6.0...git-bot-feedback-py/v0.6.1`][git-bot-feedback-py/v0.6.1]
|
|
22
|
+
|
|
9
23
|
## [git-bot-feedback-py/v0.6.0] - 2026-11-06
|
|
10
24
|
|
|
11
25
|
### <!-- 1 --> 🚀 Added
|
|
@@ -20,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
34
|
### <!-- 6 --> 📦 Dependency updates
|
|
21
35
|
|
|
22
36
|
- Bump version to git-bot-feedback/v0.12.0 by @2bndy5 in [`eae30be`](https://github.com/2bndy5/git-bot-feedback/commit/eae30be526aa3ee97954ab314a45b1569f2e3c7d)
|
|
37
|
+
- Bump version to git-bot-feedback-py/v0.6.0 by @2bndy5 in [`7b03713`](https://github.com/2bndy5/git-bot-feedback/commit/7b037137a2143f092c516d6e5d15d6eb2e90e507)
|
|
23
38
|
|
|
24
39
|
### <!-- 9 --> 🗨️ Changed
|
|
25
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "git-bot-feedback-py"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.1"
|
|
4
4
|
edition.workspace = true
|
|
5
5
|
license.workspace = true
|
|
6
6
|
repository.workspace = true
|
|
@@ -14,7 +14,7 @@ crate-type = ["cdylib"] # spell-checker: disable-line
|
|
|
14
14
|
path = "src/lib.rs"
|
|
15
15
|
|
|
16
16
|
[dependencies]
|
|
17
|
-
git-bot-feedback = { path = "../..", version = "0.12.
|
|
17
|
+
git-bot-feedback = { path = "../..", version = "0.12.1", features = ["file-changes", "pyo3"] }
|
|
18
18
|
pyo3 = { workspace = true }
|
|
19
19
|
pyo3-async-runtimes = { version = "0.30.0", features = ["tokio-runtime"] }
|
|
20
20
|
pyo3-log = "0.13.5"
|
|
@@ -3,7 +3,7 @@ use tokio::sync::Mutex;
|
|
|
3
3
|
|
|
4
4
|
use ::git_bot_feedback::{
|
|
5
5
|
RestClientError,
|
|
6
|
-
client::{RestApiClient, USER_AGENT, init_client},
|
|
6
|
+
client::{RestApiClient, USER_AGENT, init_client, same_origin_redirect_policy},
|
|
7
7
|
};
|
|
8
8
|
use pyo3::prelude::*;
|
|
9
9
|
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
|
|
@@ -32,6 +32,7 @@ fn build_http(
|
|
|
32
32
|
reqwest::Client::builder()
|
|
33
33
|
.default_headers(headers)
|
|
34
34
|
.user_agent(user_agent)
|
|
35
|
+
.redirect(same_origin_redirect_policy())
|
|
35
36
|
.build()
|
|
36
37
|
.map_err(|e| to_py_err(RestClientError::Request(e)))
|
|
37
38
|
}
|
|
@@ -299,6 +300,12 @@ impl GitClient {
|
|
|
299
300
|
/// Send an HTTP request, respecting the REST API's rate limits.
|
|
300
301
|
///
|
|
301
302
|
/// The request's headers override the client's default headers.
|
|
303
|
+
///
|
|
304
|
+
/// Only same-origin redirects are followed (up to 10), so credential headers
|
|
305
|
+
/// like GitLab's ``PRIVATE-TOKEN`` are never forwarded to another origin.
|
|
306
|
+
/// A redirect to a different origin is not followed; the ``3xx``
|
|
307
|
+
/// response is returned as is (see its ``Location`` header).
|
|
308
|
+
///
|
|
302
309
|
/// In the event where a secondary rate limit is reached, this will wait for the
|
|
303
310
|
/// time interval (if specified by the server) and retry afterward.
|
|
304
311
|
/// Raises ``RateLimitError`` or ``RequestError`` on failure.
|
|
@@ -9,7 +9,7 @@ use async_trait::async_trait;
|
|
|
9
9
|
use chrono::Utc;
|
|
10
10
|
use reqwest::{Client, Url};
|
|
11
11
|
|
|
12
|
-
use super::{ClientError, RestApiClient, RestApiRateLimitHeaders};
|
|
12
|
+
use super::{ClientError, RestApiClient, RestApiRateLimitHeaders, same_origin_redirect_policy};
|
|
13
13
|
use crate::{OutputVariable, ReviewOptions, ThreadCommentOptions};
|
|
14
14
|
mod diff_positions;
|
|
15
15
|
mod reviews;
|
|
@@ -157,6 +157,7 @@ impl RestApiClient for GitlabApiClient {
|
|
|
157
157
|
self.client = Client::builder()
|
|
158
158
|
.default_headers(Self::make_headers(true)?)
|
|
159
159
|
.user_agent(user_agent)
|
|
160
|
+
.redirect(same_origin_redirect_policy())
|
|
160
161
|
.build()?;
|
|
161
162
|
Ok(())
|
|
162
163
|
}
|
|
@@ -6,7 +6,7 @@ use super::{
|
|
|
6
6
|
};
|
|
7
7
|
use crate::{
|
|
8
8
|
CommentKind, CommentPolicy, RestApiClient, RestApiRateLimitHeaders, ThreadCommentOptions,
|
|
9
|
-
client::{ClientError, USER_AGENT},
|
|
9
|
+
client::{ClientError, USER_AGENT, same_origin_redirect_policy},
|
|
10
10
|
};
|
|
11
11
|
use reqwest::{
|
|
12
12
|
Client, Method, Url,
|
|
@@ -52,6 +52,7 @@ impl GitlabApiClient {
|
|
|
52
52
|
client: Client::builder()
|
|
53
53
|
.default_headers(Self::make_headers(true)?)
|
|
54
54
|
.user_agent(USER_AGENT)
|
|
55
|
+
.redirect(same_origin_redirect_policy())
|
|
55
56
|
.build()?,
|
|
56
57
|
merge_request_iid,
|
|
57
58
|
event_name: env::var("CI_PIPELINE_SOURCE").ok(),
|
|
@@ -62,6 +62,34 @@ pub struct RestApiRateLimitHeaders {
|
|
|
62
62
|
pub retry: String,
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/// The maximum number of redirects followed by [`same_origin_redirect_policy()`].
|
|
66
|
+
const MAX_REDIRECTS: usize = 10;
|
|
67
|
+
|
|
68
|
+
/// A redirect policy that only follows redirects to the same origin
|
|
69
|
+
/// (scheme, host, and port) as the previous URL.
|
|
70
|
+
///
|
|
71
|
+
/// A redirect to a different origin is not followed.
|
|
72
|
+
/// Instead, the `3xx` response is returned to the caller.
|
|
73
|
+
/// This prevents custom credential headers (like GitLab's `PRIVATE-TOKEN`)
|
|
74
|
+
/// from being forwarded to another origin;
|
|
75
|
+
/// `reqwest` only strips the `Authorization` header on cross-origin redirects.
|
|
76
|
+
/// The number of followed redirects is limited to 10 (like `reqwest`'s default).
|
|
77
|
+
pub fn same_origin_redirect_policy() -> reqwest::redirect::Policy {
|
|
78
|
+
reqwest::redirect::Policy::custom(|attempt| {
|
|
79
|
+
let same_origin = attempt
|
|
80
|
+
.previous()
|
|
81
|
+
.last()
|
|
82
|
+
.is_some_and(|previous| previous.origin() == attempt.url().origin());
|
|
83
|
+
if !same_origin {
|
|
84
|
+
attempt.stop()
|
|
85
|
+
} else if attempt.previous().len() > MAX_REDIRECTS {
|
|
86
|
+
attempt.error("too many redirects")
|
|
87
|
+
} else {
|
|
88
|
+
attempt.follow()
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
65
93
|
/// Find the closest folder, starting with `path` itself, that has a `.git` folder or file.
|
|
66
94
|
///
|
|
67
95
|
/// A git submodule has a `.git` file instead of a folder.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|