kettle-gha-pins 0.3.8 → 0.3.9

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: 0a1c43269ba88dfec876d3107fb7883511cbcec7456353a8e239d74071d0d94e
4
- data.tar.gz: 7499e3b722b86736e91a8a1dfde9ea53ab4f261428e5ec6816a83db73f428ece
3
+ metadata.gz: 40a359f61e73b1b17ee62829c001c9690844f8ccfb944b776ecb21cbd402b382
4
+ data.tar.gz: c5f15b58492474aefb12423903e34e3b4107f8e01dc92d964a0f0ad9c8320408
5
5
  SHA512:
6
- metadata.gz: d05a9abcb27812e5db10f60e44e3eb9b2e40cd9747476078a22008dab208a578ed816a93255093255ee86f24ccb5856f2ae1fda212659cd97f005d12a5b6bbfb
7
- data.tar.gz: 06bf550cb1113a1acb1363307d6dc4faa902c8d283aae15ecdfffaba658b9391d09606cb8005bb6071a30031bcd72b3046aae3674f2b359789793b78c2e82f59
6
+ metadata.gz: 786283e4de7a16524b78e7c30552a8622465d559df4edeb8cbfd1808dda7c3cd7c5ad730c19f5d3c35cc328c11cb9829f0fc056f531e787997961bb442ee97ca
7
+ data.tar.gz: c8d901235c8b8ebb5e9aae9fa0918a58965abdd1a61f612a76985df9068ddfa5aaac871e7ace466a2732a0a03821cb3352be232641e692283c4083287b8b4beb
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,17 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.3.9] - 2026-08-05
34
+
35
+ - TAG: [v0.3.9][0.3.9t]
36
+ - COVERAGE: 98.36% -- 961/977 lines in 8 files
37
+ - BRANCH COVERAGE: 89.95% -- 394/438 branches in 8 files
38
+ - 25.71% documented
39
+
40
+ ### Fixed
41
+
42
+ - Emit NDJSON progress events for family orchestration without replaying the full human report.
43
+
33
44
  ## [0.3.8] - 2026-08-05
34
45
 
35
46
  - TAG: [v0.3.8][0.3.8t]
@@ -271,7 +282,9 @@ Please file a bug if you notice a violation of semantic versioning.
271
282
  - kettle-jem-template-20260720-005 - Generated README Support & Community rows
272
283
  now include a RubyForum help badge.
273
284
 
274
- [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.8...HEAD
285
+ [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.9...HEAD
286
+ [0.3.9]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.8...v0.3.9
287
+ [0.3.9t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.9
275
288
  [0.3.8]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.7...v0.3.8
276
289
  [0.3.8t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.8
277
290
  [0.3.7]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.6...v0.3.7
data/README.md CHANGED
@@ -563,7 +563,7 @@ Thanks for RTFM. ☺️
563
563
  [📌gitmoji]: https://gitmoji.dev
564
564
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
565
565
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
566
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.961-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
566
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.977-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
567
567
  [🔐security]: https://github.com/kettle-dev/kettle-gha-pins/blob/main/SECURITY.md
568
568
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
569
569
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -59,6 +59,7 @@ module Kettle
59
59
  dry_run: true,
60
60
  token: ENV["GITHUB_TOKEN"] || ENV["GH_TOKEN"],
61
61
  json: false,
62
+ events: false,
62
63
  validate: true,
63
64
  write: false,
64
65
  check: false,
@@ -104,8 +105,10 @@ module Kettle
104
105
  }
105
106
 
106
107
  progress_message("Discovering workflow files under #{display_path(@options[:root])}...")
108
+ emit_event("start", root: @options[:root])
107
109
  workflow_files = discover_workflow_files(@options[:root], @options[:reject_patterns])
108
110
  progress_message("Discovered #{workflow_files.length} workflow file(s).")
111
+ emit_event("workflows", total: workflow_files.length)
109
112
 
110
113
  workflows = load_workflows(workflow_files, state)
111
114
  action_count = workflows.sum { |workflow| workflow[:uses_nodes].count { |node| classify_action_ref(node[:value].to_s) } }
@@ -119,6 +122,7 @@ module Kettle
119
122
  )
120
123
  action_plan_cache = {}
121
124
 
125
+ completed_actions = 0
122
126
  workflows.each do |workflow|
123
127
  path = workflow.fetch(:path)
124
128
  text = workflow.fetch(:text)
@@ -134,6 +138,7 @@ module Kettle
134
138
  action = parsed_ref[:action]
135
139
  repo_ref = "#{action[:owner]}/#{action[:repo]}"
136
140
  old_ref = action[:ref]
141
+ cached_before = action_plan_cache.key?(repo_ref)
137
142
  upgrade_plan = resolve_action_plan(
138
143
  cache: action_plan_cache,
139
144
  client: client,
@@ -141,6 +146,16 @@ module Kettle
141
146
  repo_ref: repo_ref,
142
147
  old_ref: old_ref
143
148
  )
149
+ completed_actions += 1
150
+ emit_event(
151
+ "action",
152
+ action_ref: repo_ref,
153
+ path: path,
154
+ line: node[:line] + 1,
155
+ completed: completed_actions,
156
+ total: action_count,
157
+ cache: (cached_before || (client.respond_to?(:last_versions_cache_hit) && client.last_versions_cache_hit)) ? "hit" : "miss"
158
+ )
144
159
 
145
160
  updates = nil
146
161
  if upgrade_plan[:updates]
@@ -261,6 +276,15 @@ module Kettle
261
276
  end
262
277
  action_progress.stop
263
278
  progress_message("Action resolution checks: #{action_progress.cached_count} cached, #{action_progress.live_count} live.") if action_count.positive?
279
+ emit_event(
280
+ "summary",
281
+ files_scanned: state[:files_scanned],
282
+ changed_files: state[:changed_files].length,
283
+ updates: state[:updates],
284
+ failures: state[:failures],
285
+ cached: action_progress.cached_count,
286
+ live: action_progress.live_count
287
+ )
264
288
 
265
289
  print_report(state)
266
290
  return 2 unless state[:failures].zero?
@@ -310,6 +334,9 @@ module Kettle
310
334
  opt.on("--json", "Emit JSON report") do
311
335
  @options[:json] = true
312
336
  end
337
+ opt.on("--events", "Emit line-delimited JSON events") do
338
+ @options[:events] = true
339
+ end
313
340
  opt.on("--[no-]progress", "Show progress feedback on STDERR (default: on unless --json)") do |bool|
314
341
  @options[:progress] = bool
315
342
  end
@@ -384,7 +411,13 @@ module Kettle
384
411
  def progress_enabled?
385
412
  return @options[:progress] unless @options[:progress].nil?
386
413
 
387
- !@options[:json]
414
+ !@options[:json] && !@options[:events]
415
+ end
416
+
417
+ def emit_event(action, payload = {})
418
+ return unless @options[:events]
419
+
420
+ puts JSON.generate({"event_version" => 1, "type" => "gha_sha_pins_#{action}", "action" => action}.merge(payload))
388
421
  end
389
422
 
390
423
  def progress_message(message)
@@ -858,8 +891,12 @@ module Kettle
858
891
  lines << "Recommended fix: kettle-gha-pins --write --upgrade #{@options[:upgrade]}"
859
892
  end
860
893
 
861
- puts lines.join("
862
- ")
894
+ output = lines.join("\n")
895
+ if @options[:events]
896
+ @err.puts output
897
+ else
898
+ puts output
899
+ end
863
900
  end
864
901
  end
865
902
  end
@@ -6,7 +6,7 @@ module Kettle
6
6
  # Version namespace for this gem.
7
7
  module Version
8
8
  # Current gem version.
9
- VERSION = "0.3.8"
9
+ VERSION = "0.3.9"
10
10
  end
11
11
  # Current gem version exposed at the traditional constant location.
12
12
  VERSION = Version::VERSION # Traditional Constant Location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-gha-pins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -301,10 +301,10 @@ licenses:
301
301
  - MIT
302
302
  metadata:
303
303
  homepage_uri: https://github.com/kettle-dev/kettle-gha-pins
304
- source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.8
305
- changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.8/CHANGELOG.md
304
+ source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.9
305
+ changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.9/CHANGELOG.md
306
306
  bug_tracker_uri: https://github.com/kettle-dev/kettle-gha-pins/issues
307
- documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.8
307
+ documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.9
308
308
  funding_uri: https://github.com/sponsors/pboling
309
309
  wiki_uri: https://github.com/kettle-dev/kettle-gha-pins/wiki
310
310
  news_uri: https://www.railsbling.com/tags/kettle-gha-pins
metadata.gz.sig CHANGED
Binary file