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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bb6a30bfcec73ad05020727ad03f85e828059db04e4691050d6a5d715c44640
4
- data.tar.gz: e4e1b9b5befce16e5d7bfdce45c7b135037b391f81b3d022baf095efc077a7ea
3
+ metadata.gz: 2903cf0f0d89e0f84d45e434545cf6958adcad59ec3ccbe7bad825bb987834a4
4
+ data.tar.gz: 255f580c0f8f555f6fb3e69ded39a785d062907db5da4d0d909cf03b12a85bf9
5
5
  SHA512:
6
- metadata.gz: 9c723d2004d953f770e7d784f211e48608778b5cf1581c73ee0413cbcdb0888291738da0c2dde348cf694791a4fae785b4c5a2aec2cbc290302064410b3677fd
7
- data.tar.gz: a57207c68b822d4d8ffc24aa0163b630af9600ce19645365b9c75457989785ccc774fa227ae51382120d378ada0b83be9d81cab0ae5a25d33549141cc2a18a6b
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-09-04"
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
@@ -2,5 +2,5 @@
2
2
  # typed: strict
3
3
 
4
4
  module Geet
5
- VERSION = "0.32.0"
5
+ VERSION = "0.32.1"
6
6
  end
@@ -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.0
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-09-04 00:00:00.000000000 Z
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.10
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