ace-git-forgejo 0.6.2 → 0.7.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/ace/git/forgejo/http_client.rb +8 -1
- data/lib/ace/git/forgejo/pull_request_api.rb +15 -2
- data/lib/ace/git/forgejo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec7d89b79d4c95330a4610f04ce163e8dcd402f3ff72bb468b27dac082d086ea
|
|
4
|
+
data.tar.gz: b9a7a5d29fa5fbd4b559ef532018d18e07d9a3b8de20dbd5860938408158d6e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7a145c24c9720d4748f32cc921f42983f2dc20c56dc0c007de0536972b4b318bba6d35c52b2b360ece6846b24cf4cd6d5b819493a7471d14e13bd59e08dc060
|
|
7
|
+
data.tar.gz: e308d391be1d1057de4176e58a698cfef161ed9474e46bb29dd1ab0a5ef83efb13af1f51b8d4bccb53d8322c0ffce89db71438f777762f49a6cadb07bab9880a
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.7.0] - 2026-10-16
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Repository-bound API surface for scoped service identities: `HttpClient`/`PullRequestApi` accept an explicit `token:` (a host-installed merge receiver credential) with the `fj` keys-file lookup unchanged as the fallback, and `PullRequestApi#create_comment` attaches one PR-thread comment (the issue-served Forgejo endpoint) with the same `MutationOutcome` refusal classification as the other lifecycle mutations.
|
|
15
|
+
|
|
10
16
|
## [0.6.2] - 2026-10-08
|
|
11
17
|
|
|
12
18
|
### Fixed
|
|
@@ -20,10 +20,15 @@ module Ace
|
|
|
20
20
|
# limited to the safe GET verb — a mutation is sent at most once per
|
|
21
21
|
# call, so a lost response stays an unknown outcome.
|
|
22
22
|
class HttpClient
|
|
23
|
-
|
|
23
|
+
# `token:` injects an explicit credential for deployments whose scoped
|
|
24
|
+
# service identity is host-installed (e.g. a merge receiver reading its
|
|
25
|
+
# token from root-owned configuration) instead of the `fj` CLI keys
|
|
26
|
+
# file; when absent the fj credential governs as before.
|
|
27
|
+
def initialize(server:, timeout:, runner: nil, token: nil)
|
|
24
28
|
@target = RepositoryBinding::Target.resolve(server.url)
|
|
25
29
|
@timeout = timeout
|
|
26
30
|
@runner = runner
|
|
31
|
+
@token = token.is_a?(String) && !token.empty? ? token : nil
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
def paginate(suffix)
|
|
@@ -145,6 +150,8 @@ module Ace
|
|
|
145
150
|
end
|
|
146
151
|
|
|
147
152
|
def access_token!
|
|
153
|
+
return @token if @token
|
|
154
|
+
|
|
148
155
|
path = RepositoryBinding.default_keys_path
|
|
149
156
|
data = path && JSON.parse(File.read(path))
|
|
150
157
|
# fj stores credentials under the bare host (or host:port)
|
|
@@ -35,8 +35,8 @@ module Ace
|
|
|
35
35
|
# success), and the parsed payload when the server returned one.
|
|
36
36
|
MutationOutcome = Data.define(:status, :message, :payload)
|
|
37
37
|
|
|
38
|
-
def initialize(server:, timeout:, runner: nil)
|
|
39
|
-
@http = HttpClient.new(server: server, timeout: timeout, runner: runner)
|
|
38
|
+
def initialize(server:, timeout:, runner: nil, token: nil)
|
|
39
|
+
@http = HttpClient.new(server: server, timeout: timeout, runner: runner, token: token)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
# Probe and validate the selected server's API version once per
|
|
@@ -161,6 +161,19 @@ module Ace
|
|
|
161
161
|
MutationOutcome.new(status: status, message: message, payload: payload)
|
|
162
162
|
end
|
|
163
163
|
|
|
164
|
+
# Attach one comment to the pull request thread (Forgejo serves PR
|
|
165
|
+
# comments on the issue endpoints) — e.g. a reviewer-produced evidence
|
|
166
|
+
# body handed over by a caller before the merge invocation.
|
|
167
|
+
#
|
|
168
|
+
# @return [MutationOutcome] 201 with the created comment payload, or a
|
|
169
|
+
# refusal outcome (404 absent pull request, 422 rejected body)
|
|
170
|
+
def create_comment(number, body)
|
|
171
|
+
status, payload, message = @http.exchange(:post, "issues/#{number}/comments",
|
|
172
|
+
body: {"body" => body.to_s})
|
|
173
|
+
classify_send!(status, "create pull request #{number} comment")
|
|
174
|
+
MutationOutcome.new(status: status, message: message, payload: payload)
|
|
175
|
+
end
|
|
176
|
+
|
|
164
177
|
private
|
|
165
178
|
|
|
166
179
|
# Authentication, absence, and transport failures classify directly
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ace-git-forgejo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michal Czyz
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-10-
|
|
10
|
+
date: 2026-10-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ace-git
|