geet 0.32.0 → 0.32.1
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/geet.gemspec +1 -1
- data/lib/geet/github/api_interface.rb +3 -0
- data/lib/geet/version.rb +1 -1
- data/spec/unit/github/api_interface_spec.rb +20 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2903cf0f0d89e0f84d45e434545cf6958adcad59ec3ccbe7bad825bb987834a4
|
|
4
|
+
data.tar.gz: 255f580c0f8f555f6fb3e69ded39a785d062907db5da4d0d909cf03b12a85bf9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 195be7f2ca33e9fadcada902dcacff479d3dfa17ca4424fc876bfeea53e69cc56e2044f36f3e52cc4d73053f8015ce944bc047a60f7c9645759c95126644ce0f
|
|
7
|
+
data.tar.gz: d1b5c383990d18d0340e6d0b52ff60212f0d5788fd9c35c5598af125e6df20b72c5ad375817531345222c16676b96ae1dd7e9d69e6a85d7e81f3db002c9de9c7
|
data/geet.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
|
9
9
|
s.required_ruby_version = ">= 3.3.0"
|
|
10
10
|
s.authors = ["Saverio Miroddi"]
|
|
11
|
-
s.date = "2026-
|
|
11
|
+
s.date = "2026-10-14"
|
|
12
12
|
s.email = ["saverio.pub2@gmail.com"]
|
|
13
13
|
s.homepage = "https://github.com/saveriomiroddi/geet"
|
|
14
14
|
s.summary = "Commandline interface for performing SCM host operations, eg. create a PR on GitHub"
|
|
@@ -13,6 +13,7 @@ module Geet
|
|
|
13
13
|
API_AUTH_USER = T.let("", String) # We don't need the login, as the API key uniquely identifies the user
|
|
14
14
|
API_BASE_URL = T.let("https://api.github.com", String)
|
|
15
15
|
GRAPHQL_API_URL = T.let("https://api.github.com/graphql", String)
|
|
16
|
+
UNAUTHENTICATED_NOT_FOUND_HINT = T.let("GH_TOKEN is not set; private repositories require it", String)
|
|
16
17
|
|
|
17
18
|
sig { returns(T.nilable(String)) }
|
|
18
19
|
attr_reader :repository_path
|
|
@@ -78,6 +79,8 @@ module Geet
|
|
|
78
79
|
|
|
79
80
|
if error?(response)
|
|
80
81
|
error_message = decode_and_format_error(T.cast(parsed_response, T::Hash[String, T.untyped]))
|
|
82
|
+
# GitHub hides private repositories from unauthenticated requests behind a 404.
|
|
83
|
+
error_message += " (#{UNAUTHENTICATED_NOT_FOUND_HINT})" if response.code == "404" && @api_token.nil?
|
|
81
84
|
raise Geet::Shared::HttpError.new(error_message, response.code)
|
|
82
85
|
end
|
|
83
86
|
|
data/lib/geet/version.rb
CHANGED
|
@@ -27,5 +27,25 @@ describe Geet::Github::ApiInterface do
|
|
|
27
27
|
|
|
28
28
|
expect(request).to have_been_requested.once
|
|
29
29
|
end
|
|
30
|
+
|
|
31
|
+
context "when the response is Not Found" do
|
|
32
|
+
before do
|
|
33
|
+
stub_request(:get, request_url).to_return(status: 404, body: {message: "Not Found"}.to_json)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it "hints at the missing token when no token is available" do
|
|
37
|
+
expect {
|
|
38
|
+
described_class.new(nil, repo_path: "owner/repository").send_request("issues")
|
|
39
|
+
}.to raise_error(Geet::Shared::HttpError, "Not Found (GH_TOKEN is not set; private repositories require it)") { |error|
|
|
40
|
+
expect(error.code).to eq(404)
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "doesn't hint at the token when one is available" do
|
|
45
|
+
expect {
|
|
46
|
+
described_class.new("token", repo_path: "owner/repository").send_request("issues")
|
|
47
|
+
}.to raise_error(Geet::Shared::HttpError, "Not Found")
|
|
48
|
+
end
|
|
49
|
+
end
|
|
30
50
|
end
|
|
31
51
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.32.
|
|
4
|
+
version: 0.32.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Saverio Miroddi
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-10-14 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: base64
|
|
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
312
312
|
- !ruby/object:Gem::Version
|
|
313
313
|
version: '0'
|
|
314
314
|
requirements: []
|
|
315
|
-
rubygems_version: 4.0.
|
|
315
|
+
rubygems_version: 4.0.20
|
|
316
316
|
specification_version: 4
|
|
317
317
|
summary: Commandline interface for performing SCM host operations, eg. create a PR
|
|
318
318
|
on GitHub
|