git-bot-feedback 0.3.0__tar.gz → 0.4.0__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.
Files changed (62) hide show
  1. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/CHANGELOG.md +14 -0
  2. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/Cargo.lock +14 -14
  3. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/Cargo.toml +5 -2
  4. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/PKG-INFO +13 -2
  5. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/README.md +12 -1
  6. {git_bot_feedback-0.3.0/bindings/python → git_bot_feedback-0.4.0}/README.rst +12 -1
  7. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/bindings/python/CHANGELOG.md +15 -0
  8. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/bindings/python/Cargo.toml +2 -2
  9. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0/bindings/python}/README.rst +12 -1
  10. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/cspell.config.yml +3 -0
  11. git_bot_feedback-0.4.0/docs/permissions/gitlab.md +132 -0
  12. git_bot_feedback-0.4.0/src/client/gitlab/diff_positions.rs +297 -0
  13. git_bot_feedback-0.4.0/src/client/gitlab/mod.rs +268 -0
  14. git_bot_feedback-0.4.0/src/client/gitlab/reviews.rs +445 -0
  15. git_bot_feedback-0.4.0/src/client/gitlab/serde_structs.rs +157 -0
  16. git_bot_feedback-0.4.0/src/client/gitlab/specific_api.rs +306 -0
  17. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/mod.rs +20 -10
  18. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/error.rs +5 -5
  19. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/git_diff.rs +113 -51
  20. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/lib.rs +1 -1
  21. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/.gitattributes +0 -0
  22. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/.gitignore +0 -0
  23. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/.pre-commit-config.yaml +0 -0
  24. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/CONTRIBUTING.md +0 -0
  25. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/LICENSE +0 -0
  26. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/bindings/python/git_bot_feedback.pyi +0 -0
  27. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/bindings/python/src/lib.rs +0 -0
  28. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/bindings/python/src/wrapper.rs +0 -0
  29. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/build.rs +0 -0
  30. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/codecov.yml +0 -0
  31. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/client.rst +0 -0
  32. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/file-annotations.rst +0 -0
  33. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/file-changes.rst +0 -0
  34. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/index.rst +0 -0
  35. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/output-variables.rst +0 -0
  36. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/pr-reviews.rst +0 -0
  37. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/API/thread-comments.rst +0 -0
  38. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/_static/favicon.ico +0 -0
  39. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/_static/logo.png +0 -0
  40. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/conf.py +0 -0
  41. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/index.rst +0 -0
  42. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/docs/logo.xcf +0 -0
  43. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/git_bot_feedback.pyi +0 -0
  44. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/nurfile +0 -0
  45. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/pyproject.toml +0 -0
  46. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/common.rs +0 -0
  47. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/gitea/mod.rs +0 -0
  48. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/gitea/serde_structs.rs +0 -0
  49. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/gitea/specific_api.rs +0 -0
  50. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/github/graphql.rs +0 -0
  51. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/github/mod.rs +0 -0
  52. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/github/serde_structs.rs +0 -0
  53. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/github/specific_api.rs +0 -0
  54. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/client/local.rs +0 -0
  55. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/comments/mod.rs +0 -0
  56. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/comments/review_comments.rs +0 -0
  57. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/comments/thread_comments.rs +0 -0
  58. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/file_annotations.rs +0 -0
  59. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/file_utils/file_filter.rs +0 -0
  60. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/file_utils/mod.rs +0 -0
  61. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/src/output_variable.rs +0 -0
  62. {git_bot_feedback-0.3.0 → git_bot_feedback-0.4.0}/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.10.0] - 2026-10-27
10
+
11
+ ### <!-- 1 --> 🚀 Added
12
+
13
+ - Add GitLab support by @shenxianpeng in [#146](https://github.com/2bndy5/git-bot-feedback/pull/146)
14
+
15
+ [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
+
17
+ Full commit diff: [`git-bot-feedback/v0.9.0...git-bot-feedback/v0.10.0`][git-bot-feedback/v0.10.0]
18
+
9
19
  ## [git-bot-feedback/v0.9.0] - 2026-10-22
10
20
 
11
21
  ### <!-- 1 --> 🚀 Added
@@ -16,6 +26,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
26
 
17
27
  - Match a plain path pattern without checking the file system by @shenxianpeng in [#147](https://github.com/2bndy5/git-bot-feedback/pull/147)
18
28
 
29
+ ### <!-- 6 --> 📦 Dependency updates
30
+
31
+ - Bump version to git-bot-feedback/v0.9.0 by @2bndy5 in [`57686f2`](https://github.com/2bndy5/git-bot-feedback/commit/57686f22f7f8ee3e5f8a1df53974af78d82c5d08)
32
+
19
33
  [git-bot-feedback/v0.9.0]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback/v0.8.8...git-bot-feedback/v0.9.0
20
34
 
21
35
  Full commit diff: [`git-bot-feedback/v0.8.8...git-bot-feedback/v0.9.0`][git-bot-feedback/v0.9.0]
@@ -178,7 +178,7 @@ version = "3.1.1"
178
178
  source = "registry+https://github.com/rust-lang/crates.io-index"
179
179
  checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
180
180
  dependencies = [
181
- "windows-sys 0.52.0",
181
+ "windows-sys 0.61.2",
182
182
  ]
183
183
 
184
184
  [[package]]
@@ -276,7 +276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
276
276
  checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
277
277
  dependencies = [
278
278
  "libc",
279
- "windows-sys 0.52.0",
279
+ "windows-sys 0.61.2",
280
280
  ]
281
281
 
282
282
  [[package]]
@@ -413,7 +413,7 @@ dependencies = [
413
413
 
414
414
  [[package]]
415
415
  name = "git-bot-feedback"
416
- version = "0.9.0"
416
+ version = "0.10.0"
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.3.0"
436
+ version = "0.4.0"
437
437
  dependencies = [
438
438
  "git-bot-feedback",
439
439
  "pyo3",
@@ -1126,7 +1126,7 @@ dependencies = [
1126
1126
  "once_cell",
1127
1127
  "socket2",
1128
1128
  "tracing",
1129
- "windows-sys 0.52.0",
1129
+ "windows-sys 0.61.2",
1130
1130
  ]
1131
1131
 
1132
1132
  [[package]]
@@ -1320,14 +1320,14 @@ dependencies = [
1320
1320
  "errno",
1321
1321
  "libc",
1322
1322
  "linux-raw-sys",
1323
- "windows-sys 0.52.0",
1323
+ "windows-sys 0.61.2",
1324
1324
  ]
1325
1325
 
1326
1326
  [[package]]
1327
1327
  name = "rustls"
1328
- version = "0.23.45"
1328
+ version = "0.23.46"
1329
1329
  source = "registry+https://github.com/rust-lang/crates.io-index"
1330
- checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
1330
+ checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
1331
1331
  dependencies = [
1332
1332
  "aws-lc-rs",
1333
1333
  "once_cell",
@@ -1377,7 +1377,7 @@ dependencies = [
1377
1377
  "security-framework",
1378
1378
  "security-framework-sys",
1379
1379
  "webpki-root-certs",
1380
- "windows-sys 0.52.0",
1380
+ "windows-sys 0.61.2",
1381
1381
  ]
1382
1382
 
1383
1383
  [[package]]
@@ -1495,9 +1495,9 @@ dependencies = [
1495
1495
 
1496
1496
  [[package]]
1497
1497
  name = "serde_json"
1498
- version = "1.0.151"
1498
+ version = "1.0.154"
1499
1499
  source = "registry+https://github.com/rust-lang/crates.io-index"
1500
- checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
1500
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
1501
1501
  dependencies = [
1502
1502
  "itoa",
1503
1503
  "memchr",
@@ -1656,10 +1656,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1656
1656
  checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
1657
1657
  dependencies = [
1658
1658
  "fastrand",
1659
- "getrandom 0.4.3",
1659
+ "getrandom 0.3.4",
1660
1660
  "once_cell",
1661
1661
  "rustix",
1662
- "windows-sys 0.52.0",
1662
+ "windows-sys 0.61.2",
1663
1663
  ]
1664
1664
 
1665
1665
  [[package]]
@@ -1974,7 +1974,7 @@ version = "0.1.11"
1974
1974
  source = "registry+https://github.com/rust-lang/crates.io-index"
1975
1975
  checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
1976
1976
  dependencies = [
1977
- "windows-sys 0.52.0",
1977
+ "windows-sys 0.61.2",
1978
1978
  ]
1979
1979
 
1980
1980
  [[package]]
@@ -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.9.0"
24
+ version = "0.10.0"
25
25
  edition.workspace = true
26
26
  license.workspace = true
27
27
  repository.workspace = true
@@ -61,8 +61,11 @@ github = []
61
61
  # Gitea implementation/support
62
62
  gitea = []
63
63
 
64
+ # GitLab implementation/support
65
+ gitlab = ["dep:regex"]
66
+
64
67
  # features enabled by default
65
- default = ["github", "gitea"]
68
+ default = ["github", "gitea", "gitlab"]
66
69
 
67
70
  # optional feature to silence a compiler error if/when
68
71
  # no features enable any git server implementations
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-bot-feedback
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Intended Audience :: System Administrators
@@ -56,6 +56,15 @@ The following is just a list of git servers that are planned (in order or priori
56
56
 
57
57
  - GitHub
58
58
  - GitLab
59
+
60
+ GitLab support requires GitLab v17.9 or newer and
61
+ a ``GITLAB_TOKEN`` environment variable (an access token).
62
+ See `GitLab token permissions`_ for the permissions each feature needs.
63
+ GitLab does not support
64
+
65
+ - posting thread comments for commits (push events)
66
+ - output variables and step summaries (output variables are only logged)
67
+ - hiding outdated PR review summary comments
59
68
  - Gitea
60
69
 
61
70
  Gitea does not support
@@ -65,7 +74,9 @@ The following is just a list of git servers that are planned (in order or priori
65
74
  only resolve them (currently). However, deleting an entire PR review is supported.
66
75
  - BitBucket
67
76
 
68
- Currently, only Github and Gitea are supported.
77
+ Currently, only GitHub, GitLab, and Gitea are supported.
78
+
79
+ .. _GitLab token permissions: https://github.com/2bndy5/git-bot-feedback/blob/main/docs/permissions/gitlab.md
69
80
 
70
81
  LGPL license
71
82
  ------------
@@ -36,7 +36,16 @@ This project is designed to easily add support for various git servers.
36
36
  The following is just a list of git servers that are planned (in order or priority).
37
37
 
38
38
  - [x] GitHub
39
- - [ ] GitLab
39
+ - [x] GitLab
40
+
41
+ GitLab support requires GitLab v17.9 or newer and
42
+ a `GITLAB_TOKEN` environment variable (an access token).
43
+ See [GitLab token permissions][gitlab-permissions] for the permissions each feature needs.
44
+ GitLab does not support
45
+
46
+ - posting thread comments for commits (push events)
47
+ - output variables and step summaries (output variables are only logged)
48
+ - hiding outdated PR review summary comments
40
49
  - [x] Gitea
41
50
 
42
51
  Gitea does not support
@@ -54,6 +63,7 @@ Each supported implementation of the above git servers can be controlled via
54
63
 
55
64
  - `github` enables support of GitHub implementation
56
65
  - `gitea` enables support of Gitea implementation
66
+ - `gitlab` enables support of GitLab implementation
57
67
 
58
68
  ## LGPL license
59
69
 
@@ -80,6 +90,7 @@ because the following conditions must be met:
80
90
  [docs-rs-link]: https://docs.rs/git-bot-feedback
81
91
  [dep-features]: https://doc.rust-lang.org/cargo/reference/features.html#dependency-features
82
92
  [reqwest-docs]: https://docs.rs/reqwest/latest/reqwest/#optional-features
93
+ [gitlab-permissions]: https://github.com/2bndy5/git-bot-feedback/blob/main/docs/permissions/gitlab.md
83
94
  [LGPL-3.0-or-later]: https://github.com/2bndy5/git-bot-feedback/blob/main/LICENSE
84
95
  [license-badge]: https://img.shields.io/github/license/2bndy5/git-bot-feedback
85
96
  [license-link]: https://github.com/2bndy5/git-bot-feedback/blob/main/LICENSE
@@ -31,6 +31,15 @@ The following is just a list of git servers that are planned (in order or priori
31
31
 
32
32
  - GitHub
33
33
  - GitLab
34
+
35
+ GitLab support requires GitLab v17.9 or newer and
36
+ a ``GITLAB_TOKEN`` environment variable (an access token).
37
+ See `GitLab token permissions`_ for the permissions each feature needs.
38
+ GitLab does not support
39
+
40
+ - posting thread comments for commits (push events)
41
+ - output variables and step summaries (output variables are only logged)
42
+ - hiding outdated PR review summary comments
34
43
  - Gitea
35
44
 
36
45
  Gitea does not support
@@ -40,7 +49,9 @@ The following is just a list of git servers that are planned (in order or priori
40
49
  only resolve them (currently). However, deleting an entire PR review is supported.
41
50
  - BitBucket
42
51
 
43
- Currently, only Github and Gitea are supported.
52
+ Currently, only GitHub, GitLab, and Gitea are supported.
53
+
54
+ .. _GitLab token permissions: https://github.com/2bndy5/git-bot-feedback/blob/main/docs/permissions/gitlab.md
44
55
 
45
56
  LGPL license
46
57
  ------------
@@ -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.4.0] - 2026-10-27
10
+
11
+ ### <!-- 1 --> 🚀 Added
12
+
13
+ - Add GitLab support by @shenxianpeng in [#146](https://github.com/2bndy5/git-bot-feedback/pull/146)
14
+
15
+ ### <!-- 6 --> 📦 Dependency updates
16
+
17
+ - Bump version to git-bot-feedback/v0.10.0 by @2bndy5 in [`cb5351a`](https://github.com/2bndy5/git-bot-feedback/commit/cb5351aa30c18e2d3c94235d0c932a7e93b8f254)
18
+
19
+ [git-bot-feedback-py/v0.4.0]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback-py/v0.3.0...git-bot-feedback-py/v0.4.0
20
+
21
+ Full commit diff: [`git-bot-feedback-py/v0.3.0...git-bot-feedback-py/v0.4.0`][git-bot-feedback-py/v0.4.0]
22
+
9
23
  ## [git-bot-feedback-py/v0.3.0] - 2026-10-22
10
24
 
11
25
  ### <!-- 1 --> 🚀 Added
@@ -19,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
33
  ### <!-- 6 --> 📦 Dependency updates
20
34
 
21
35
  - Bump version to git-bot-feedback/v0.9.0 by @2bndy5 in [`57686f2`](https://github.com/2bndy5/git-bot-feedback/commit/57686f22f7f8ee3e5f8a1df53974af78d82c5d08)
36
+ - Bump version to git-bot-feedback-py/v0.3.0 by @2bndy5 in [`8086fac`](https://github.com/2bndy5/git-bot-feedback/commit/8086fac1dd0cd31d2c1b1c30388d2c211b823d8e)
22
37
 
23
38
  [git-bot-feedback-py/v0.3.0]: https://github.com/2bndy5/git-bot-feedback/compare/git-bot-feedback-py/v0.2.9...git-bot-feedback-py/v0.3.0
24
39
 
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "git-bot-feedback-py"
3
- version = "0.3.0"
3
+ version = "0.4.0"
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.9.0", features = ["file-changes", "pyo3"] }
17
+ git-bot-feedback = { path = "../..", version = "0.10.0", features = ["file-changes", "pyo3"] }
18
18
  pyo3 = { workspace = true }
19
19
  pyo3-async-runtimes = { version = "0.29.0", features = ["tokio-runtime"] }
20
20
  pyo3-log = "0.13.4"
@@ -31,6 +31,15 @@ The following is just a list of git servers that are planned (in order or priori
31
31
 
32
32
  - GitHub
33
33
  - GitLab
34
+
35
+ GitLab support requires GitLab v17.9 or newer and
36
+ a ``GITLAB_TOKEN`` environment variable (an access token).
37
+ See `GitLab token permissions`_ for the permissions each feature needs.
38
+ GitLab does not support
39
+
40
+ - posting thread comments for commits (push events)
41
+ - output variables and step summaries (output variables are only logged)
42
+ - hiding outdated PR review summary comments
34
43
  - Gitea
35
44
 
36
45
  Gitea does not support
@@ -40,7 +49,9 @@ The following is just a list of git servers that are planned (in order or priori
40
49
  only resolve them (currently). However, deleting an entire PR review is supported.
41
50
  - BitBucket
42
51
 
43
- Currently, only Github and Gitea are supported.
52
+ Currently, only GitHub, GitLab, and Gitea are supported.
53
+
54
+ .. _GitLab token permissions: https://github.com/2bndy5/git-bot-feedback/blob/main/docs/permissions/gitlab.md
44
55
 
45
56
  LGPL license
46
57
  ------------
@@ -24,9 +24,11 @@ words:
24
24
  - musllinux
25
25
  - mypy
26
26
  - nextest
27
+ - noteable
27
28
  - nurfile
28
29
  - nushell
29
30
  - orhun
31
+ - peekable
30
32
  - pipx
31
33
  - pkgs
32
34
  - pybind
@@ -51,6 +53,7 @@ words:
51
53
  - timeit
52
54
  - toctree
53
55
  - topo
56
+ - unapprove
54
57
  - zizmor
55
58
  ignorePaths:
56
59
  - .gitignore
@@ -0,0 +1,132 @@
1
+ # GitLab Token Permissions
2
+
3
+ This is an exhaustive list of the permissions needed by the GitLab client, organized by feature.
4
+ Each REST API endpoint that the client uses is listed with the permission it needs.
5
+
6
+ The client reads the token from the `GITLAB_TOKEN` environment variable.
7
+ Store the token as a [masked CI/CD variable][masked-vars] in the project's settings.
8
+ The CI/CD job token (`CI_JOB_TOKEN`) is not used.
9
+
10
+ Every request must pass two checks:
11
+
12
+ 1. The token has permission to call the endpoint.
13
+ 2. The token's user has a [role][roles] that allows the action.
14
+ For example, resolving a thread needs the Developer role
15
+ even if the token has permission to call the endpoint.
16
+
17
+ The `:id` in each path is the project of the merge request.
18
+ For a merge request from a fork, the pipeline runs in the fork, but `:id` is the
19
+ target project (`CI_MERGE_REQUEST_PROJECT_ID`). So the token needs access to the target project.
20
+
21
+ [masked-vars]: https://docs.gitlab.com/ci/variables/#mask-a-cicd-variable
22
+ [roles]: https://docs.gitlab.com/user/permissions/
23
+
24
+ ## Token types
25
+
26
+ | Token | How to grant access |
27
+ | ----- | ------------------- |
28
+ | [Fine-grained personal access token][fine-grained] (recommended, GitLab v19.2 or newer[^beta]) | Under **Group and project access**, include the project. Then add the resource permissions listed below. |
29
+ | Legacy personal, [project][project-tokens], or [group][group-tokens] access token | The `api` scope. The `read_api` scope is enough if only [file changes](#file-changes) are needed. |
30
+
31
+ Fine-grained permissions are only available for personal access tokens.
32
+ Project and group access tokens still use scopes.
33
+ For a project or group access token, also select a role for its bot user;
34
+ see [user roles](#user-roles).
35
+
36
+ [^beta]: Fine-grained personal access tokens were available as a beta in GitLab v18.10 and v19.1.
37
+
38
+ [fine-grained]: https://docs.gitlab.com/auth/tokens/fine_grained_access_tokens/
39
+ [project-tokens]: https://docs.gitlab.com/user/project/settings/project_access_tokens/
40
+ [group-tokens]: https://docs.gitlab.com/user/group/settings/group_access_tokens/
41
+
42
+ ## Summary
43
+
44
+ All features together need these fine-grained permissions:
45
+
46
+ | Resource | Permissions | Used by |
47
+ | -------- | ----------- | ------- |
48
+ | Merge Request | Read, Update, Approve; Delete (optional) | [file changes](#file-changes), [thread comments](#thread-comments), [merge request reviews](#merge-request-reviews) |
49
+ | Work Item | Read, Create, Update, Delete | [thread comments](#thread-comments), [merge request reviews](#merge-request-reviews) |
50
+ | Commit | Read | [file changes](#file-changes) in push pipelines |
51
+
52
+ > [!NOTE]
53
+ > GitLab lists a merge request's comments (notes) under the **Work Item** resource,
54
+ > not the **Merge Request** resource.
55
+ > But a merge request's threads (discussions) and draft notes are under the **Merge Request** resource.
56
+
57
+ ## File changes
58
+
59
+ To list the files changed in a pipeline:
60
+
61
+ | Pipeline | Endpoint | Permission |
62
+ | -------- | -------- | ---------- |
63
+ | Merge request | `GET /projects/:id/merge_requests/:merge_request_iid/raw_diffs` | Merge Request: Read |
64
+ | Push (or other) | `GET /projects/:id/repository/commits/:sha/diff` | Commit: Read |
65
+
66
+ If the project is public, these endpoints can be read without the token having these permissions.
67
+ See GitLab's [publicly accessible endpoints][public-endpoints].
68
+
69
+ [public-endpoints]: https://docs.gitlab.com/auth/tokens/fine_grained_access_tokens_rest/#publicly-accessible-endpoints
70
+
71
+ ## Thread comments
72
+
73
+ Thread comments are only posted in merge request pipelines.
74
+ In push pipelines, no request is made.
75
+
76
+ | Endpoint | Permission | Why |
77
+ | -------- | ---------- | --- |
78
+ | `GET /projects/:id/merge_requests/:merge_request_iid` | Merge Request: Read | Check if the merge request is locked |
79
+ | `GET /projects/:id/merge_requests/:noteable_id/notes` | Work Item: Read | Find comments previously posted |
80
+ | `POST /projects/:id/merge_requests/:noteable_id/notes` | Work Item: Create | Post a new comment |
81
+ | `PUT /projects/:id/merge_requests/:noteable_id/notes/:note_id` | Work Item: Update | Update the previous comment ([`CommentPolicy::Update`]) |
82
+ | `DELETE /projects/:id/merge_requests/:noteable_id/notes/:note_id` | Work Item: Delete | Delete outdated comments |
83
+
84
+ [`CommentPolicy::Update`]: https://docs.rs/git-bot-feedback/latest/git_bot_feedback/enum.CommentPolicy.html
85
+
86
+ ## Merge request reviews
87
+
88
+ A review is posted like GitLab's web UI submits one:
89
+ each comment is created as a draft note, then the draft notes are published.
90
+
91
+ | Endpoint | Permission | Why |
92
+ | -------- | ---------- | --- |
93
+ | `GET /projects/:id/merge_requests/:merge_request_iid` | Merge Request: Read | Check if the merge request is a draft, closed, or locked |
94
+ | `GET /projects/:id/merge_requests/:noteable_id/discussions` | Merge Request: Read | Find review comments previously posted |
95
+ | `PUT /projects/:id/merge_requests/:noteable_id/discussions/:discussion_id` | Merge Request: Update | Resolve outdated review comments |
96
+ | `DELETE /projects/:id/merge_requests/:noteable_id/discussions/:discussion_id/notes/:note_id` | Merge Request: Delete | Delete outdated review comments (only if [`ReviewOptions::delete_review_comments`] is `true`) |
97
+ | `GET /projects/:id/merge_requests/:merge_request_iid/draft_notes` | Merge Request: Read | Find pending draft notes |
98
+ | `DELETE /projects/:id/merge_requests/:merge_request_iid/draft_notes/:draft_note_id` | Merge Request: Update | Delete draft notes left by a review that failed to be published |
99
+ | `GET /projects/:id/merge_requests/:merge_request_iid/raw_diffs` | Merge Request: Read | Map each comment to a line in the diff |
100
+ | `POST /projects/:id/merge_requests/:merge_request_iid/draft_notes` | Merge Request: Update | Create review comments as draft notes |
101
+ | `POST /projects/:id/merge_requests/:merge_request_iid/draft_notes/bulk_publish` | Merge Request: Update | Publish the review |
102
+ | `PUT /projects/:id/merge_requests/:merge_request_iid/draft_notes/:draft_note_id/publish` | Merge Request: Update | Publish each review comment (only if the token's user has other pending draft notes) |
103
+ | `POST /projects/:id/merge_requests/:noteable_id/notes` | Work Item: Create | Post the review summary |
104
+ | `POST /projects/:id/merge_requests/:merge_request_iid/approve` | Merge Request: Approve | Approve the merge request ([`ReviewAction::Approve`]) |
105
+ | `POST /projects/:id/merge_requests/:merge_request_iid/unapprove` | Merge Request: Approve | Withdraw a previous approval ([`ReviewAction::RequestChanges`]) |
106
+
107
+ Deleting a draft note needs the **Update** permission, not **Delete**.
108
+ The **Delete** permission is only needed if [`ReviewOptions::delete_review_comments`] is `true`.
109
+
110
+ [`ReviewOptions::delete_review_comments`]: https://docs.rs/git-bot-feedback/latest/git_bot_feedback/struct.ReviewOptions.html#structfield.delete_review_comments
111
+ [`ReviewAction::Approve`]: https://docs.rs/git-bot-feedback/latest/git_bot_feedback/enum.ReviewAction.html#variant.Approve
112
+ [`ReviewAction::RequestChanges`]: https://docs.rs/git-bot-feedback/latest/git_bot_feedback/enum.ReviewAction.html#variant.RequestChanges
113
+
114
+ ## User roles
115
+
116
+ The token's user also needs a role in the project:
117
+
118
+ | Feature | Minimum role |
119
+ | ------- | ------------ |
120
+ | [File changes](#file-changes) | Reporter (Guest is enough for a public project) |
121
+ | [Thread comments](#thread-comments) | Reporter ([comment on merge requests][mr-permissions]) |
122
+ | [Merge request reviews](#merge-request-reviews) | Developer ([resolve threads][resolve-threads]) |
123
+ | Approving a merge request | An [eligible approver][eligible-approvers] (Developer by default) |
124
+
125
+ [mr-permissions]: https://docs.gitlab.com/user/permissions/#merge-request-permissions
126
+ [resolve-threads]: https://docs.gitlab.com/api/discussions/#resolve-a-merge-request-thread
127
+ [eligible-approvers]: https://docs.gitlab.com/user/project/merge_requests/approvals/rules/#eligible-approvers
128
+
129
+ ## References
130
+
131
+ - [Fine-grained permissions for REST API](https://docs.gitlab.com/auth/tokens/fine_grained_access_tokens_rest/)
132
+ - [GitLab REST API reference](https://api.gitlab.com/rest/#gitlab)