issue-db 1.3.2 → 1.4.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/lib/issue_db/cache.rb +19 -13
- data/lib/issue_db/utils/github.rb +6 -0
- data/lib/issue_db/utils/init.rb +4 -2
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3baac4ee11892479812c2b918286ae999bad7a3ffa5b186d5f6a9efc21c69361
|
4
|
+
data.tar.gz: f6ea018925f8ccd59da37c0d1fc8b72731b65fa4af8707f2975298c81cca8ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5787a854bb97a3cba2e0f1bd854949c025a7df996995413834310de40b93add64d4c40967efe58950cfcfc9a5b8fbda715afc7ba1d1fd928f36bf2525dba9cc
|
7
|
+
data.tar.gz: d9a645abf9ce42d7857b700fc7cdc9c65a40890f6ab6771a2a56a044db128db528df0aa1a0b5ee8ab97a638ef6212ed99298b9d225843e3ba2f0ab0a37e037a7
|
data/lib/issue_db/cache.rb
CHANGED
@@ -7,27 +7,33 @@ module IssueDB
|
|
7
7
|
def update_issue_cache!
|
8
8
|
@log.debug("updating issue cache")
|
9
9
|
|
10
|
-
|
11
|
-
query = "repo:#{@repo.full_name} label:#{@label}"
|
12
|
-
|
13
|
-
search_response = nil
|
10
|
+
issues_response = nil
|
14
11
|
begin
|
15
|
-
# issues
|
16
|
-
|
12
|
+
# This fetches all issues with the specified label from the repository. This label identifies all issues...
|
13
|
+
# ... that are managed via this library.
|
14
|
+
# The client.auto_paginate setting will handle pagination automatically
|
15
|
+
issues_response = @client.issues(@repo.full_name, labels: @label, state: "all")
|
16
|
+
rescue Octokit::Unauthorized => e
|
17
|
+
# Re-throw authentication errors unchanged for clear user feedback
|
18
|
+
raise e
|
17
19
|
rescue StandardError => e
|
18
|
-
|
20
|
+
# For other errors, wrap with context
|
21
|
+
retry_err_msg = "error issues() call: #{e.message}"
|
19
22
|
@log.error(retry_err_msg)
|
20
23
|
raise StandardError, retry_err_msg
|
21
24
|
end
|
22
25
|
|
23
|
-
# Safety check to ensure
|
24
|
-
if
|
25
|
-
@log.error("
|
26
|
-
raise StandardError, "
|
26
|
+
# Safety check to ensure issues_response is not nil
|
27
|
+
if issues_response.nil?
|
28
|
+
@log.error("issues API returned nil response")
|
29
|
+
raise StandardError, "issues API returned invalid response"
|
27
30
|
end
|
28
31
|
|
29
|
-
|
30
|
-
|
32
|
+
# Convert to array if it's a single issue (shouldn't happen with auto_paginate, but safety first)
|
33
|
+
issues_response = [issues_response] unless issues_response.is_a?(Array)
|
34
|
+
|
35
|
+
@log.debug("issue cache updated - cached #{issues_response.length} issues")
|
36
|
+
@issues = issues_response
|
31
37
|
@issues_last_updated = Time.now
|
32
38
|
return @issues
|
33
39
|
end
|
@@ -280,6 +280,12 @@ module IssueDB
|
|
280
280
|
# Check if retry is explicitly disabled for this call
|
281
281
|
disable_retry = kwargs.delete(:disable_retry) || false
|
282
282
|
|
283
|
+
# For add_label method, also check if disable_retry is in the options hash (last positional arg)
|
284
|
+
if method.to_s == "add_label" && args.length >= 4 && args.last.is_a?(Hash)
|
285
|
+
options_hash = args.last
|
286
|
+
disable_retry = options_hash.delete(:disable_retry) || disable_retry
|
287
|
+
end
|
288
|
+
|
283
289
|
# Determine the rate limit type based on the method name and arguments
|
284
290
|
rate_limit_type = case method.to_s
|
285
291
|
when /search_/
|
data/lib/issue_db/utils/init.rb
CHANGED
@@ -10,8 +10,10 @@ module IssueDB
|
|
10
10
|
@repo.full_name,
|
11
11
|
@label,
|
12
12
|
"000000",
|
13
|
-
{
|
14
|
-
|
13
|
+
{
|
14
|
+
description: "This issue is managed by the issue-db Ruby library. Please do not remove this label.",
|
15
|
+
disable_retry: true
|
16
|
+
}
|
15
17
|
)
|
16
18
|
rescue StandardError => e
|
17
19
|
if e.message.include?("already_exists")
|
data/lib/version.rb
CHANGED