neetodeploy 1.4.3 → 1.4.4

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: b449b4f69647cfff5f812dfa30c273b1add6b8dfdeb60ca419d96be75a768d37
4
- data.tar.gz: dcebc5fdb56c81f76973f502a0491ddd640b4813a8c969f5fbb07db3df596264
3
+ metadata.gz: 56b531cfa4655cdd685d298c4e26a83594b12ce21b0cb11ea6586f72e6f86e00
4
+ data.tar.gz: 1350e1efc7f35ec1589c4b3c4a899d6fbf0e7ca5fe0df1c9aed5dcb086b61f08
5
5
  SHA512:
6
- metadata.gz: 90f7a087123601f9dabffb8c3113e04049d9fe15e60d0439979bc66aea8481397c8e0d0e59bcd79089d300d98e5f5d99204ea600137431ffcfce4a4fb6b23d5c
7
- data.tar.gz: 8f765320a00cbc9b3e264e1d903a5b6b4a2c2849197a1965deba8fc60df1972ca0674a7519d05a4104aad283d73373e2c70ee1ae30c1c0576212edab71077633
6
+ metadata.gz: 304a6b67c67c2e982dc98752f5810a05025df9ce02d359c88d17f43d89d8c509bf9570564bbc1403cf22f55f62286a071440a22466512281f17f719290612214
7
+ data.tar.gz: 67de2e22263af2af6f9d10e85ba8281c00cdb08f3b675efacaa374f9e9fd1f081f20bf0962f288ac93cc491bb10dd42a715771765c87a8017d48f299867151c5
@@ -63,12 +63,13 @@ module NeetoDeploy
63
63
  start_spinner("Fetching historic logs")
64
64
  print_github_repo_name
65
65
 
66
- total_count = 0
66
+ all_logs = []
67
67
  limit = options[:limit] || HISTORIC_DEFAULT_LIMIT
68
68
  before_timestamp = nil
69
69
 
70
70
  loop do
71
- params = build_historic_params(from_time, to_time, before_timestamp, limit)
71
+ remaining = limit - all_logs.size
72
+ params = build_historic_params(from_time, to_time, before_timestamp, remaining)
72
73
  response = send_get_request(logs_v2_url, params)
73
74
  @spinner.stop if @spinner
74
75
 
@@ -85,22 +86,24 @@ module NeetoDeploy
85
86
  end
86
87
 
87
88
  logs = data["logs"]
88
- if logs.empty?
89
- ui.info("No logs found for the given time range.") if total_count == 0
90
- break
91
- end
89
+ break if logs.empty?
92
90
 
93
- # Backward pagination returns DESC — reverse for chronological display
94
- logs.reverse.each { |log| print_log(log) }
95
- total_count += logs.size
91
+ all_logs.concat(logs)
96
92
 
97
- break if total_count >= limit
93
+ break if all_logs.size >= limit
98
94
  break unless data["has_more"]
99
95
 
100
96
  before_timestamp = ms_to_iso8601(logs.last["timestamp"])
101
97
  end
102
98
 
103
- ui.info("Fetched #{total_count} log entries.") if total_count > 0
99
+ if all_logs.empty?
100
+ ui.info("No logs found for the given time range.")
101
+ return
102
+ end
103
+
104
+ # Backward pagination fetches newer-to-older — reverse for chronological display
105
+ all_logs.reverse.each { |log| print_log(log) }
106
+ ui.info("Fetched #{all_logs.size} log entries.")
104
107
  end
105
108
 
106
109
  def build_historic_params(from_time, to_time, before_timestamp, limit)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NeetoDeploy
4
- VERSION = "1.4.3"
4
+ VERSION = "1.4.4"
5
5
  CLI_API_VERSION = "v1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetodeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin Siby