cpflow 6.0.0 → 6.1.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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.agents/bin/README.md +3 -2
  3. data/.agents/bin/docs +2 -1
  4. data/.agents/bin/lint +2 -1
  5. data/.agents/shaka/bin/setup +6 -0
  6. data/.agents/shaka/bin/test +6 -0
  7. data/.agents/shaka/bin/validate +7 -0
  8. data/.agents/{agent-workflow.yml → shaka/config.yml} +1 -1
  9. data/.agents/shaka.md +3 -2
  10. data/.github/actions/cpflow-setup-environment/action.yml +1 -1
  11. data/.github/dependabot.yml +10 -5
  12. data/.github/scripts/deployment_lock.py +141 -0
  13. data/.github/workflows/claude-code-review.yml +1 -1
  14. data/.github/workflows/claude.yml +1 -1
  15. data/.github/workflows/command_docs.yml +1 -1
  16. data/.github/workflows/cpflow-cleanup-stale-review-apps.yml +4 -11
  17. data/.github/workflows/cpflow-delete-review-app.yml +6 -13
  18. data/.github/workflows/cpflow-deploy-review-app.yml +225 -108
  19. data/.github/workflows/cpflow-deploy-staging.yml +5 -11
  20. data/.github/workflows/cpflow-promote-staging-to-production.yml +7 -7
  21. data/.github/workflows/rspec-shared.yml +3 -3
  22. data/.github/workflows/rspec.yml +2 -2
  23. data/.github/workflows/rubocop.yml +1 -1
  24. data/.github/workflows/trigger-docs-site.yml +1 -1
  25. data/AGENTS.md +4 -4
  26. data/CHANGELOG.md +26 -1
  27. data/CONTRIBUTING.md +9 -5
  28. data/Gemfile.lock +15 -10
  29. data/README.md +1 -1
  30. data/cpflow.gemspec +1 -1
  31. data/docs/ai-github-flow-prompt.md +104 -8
  32. data/docs/ci-automation.md +174 -59
  33. data/docs/commands.md +11 -6
  34. data/lib/command/ai_github_flow_prompt.rb +10 -13
  35. data/lib/command/ai_github_flow_prompt.txt +103 -0
  36. data/lib/command/apply_template.rb +12 -1
  37. data/lib/command/base.rb +10 -0
  38. data/lib/command/generate_github_actions.rb +8 -16
  39. data/lib/command/run.rb +7 -7
  40. data/lib/command/setup_app.rb +6 -1
  41. data/lib/command/update_github_actions.rb +28 -2
  42. data/lib/core/bootstrap_image.rb +21 -0
  43. data/lib/core/controlplane.rb +7 -6
  44. data/lib/cpflow/version.rb +1 -1
  45. data/lib/github_flow_templates/.github/cpflow-help.md +2 -2
  46. data/lib/github_flow_templates/.github/workflows/cpflow-promote-staging-to-production.yml +7 -7
  47. data/lib/github_flow_templates/bin/test-cpflow-github-flow +26 -4
  48. data/script/check_shell_scripts +3 -3
  49. metadata +12 -9
  50. data/.agents/bin/setup +0 -5
  51. data/.agents/bin/test +0 -5
  52. data/.agents/bin/validate +0 -6
  53. /data/.agents/{trusted-github-actors.yml → shaka/trusted-github-actors.yml} +0 -0
@@ -13,6 +13,7 @@ module Command
13
13
  skip_confirm_option,
14
14
  add_app_identity_option,
15
15
  preserve_existing_runtime_option,
16
+ bootstrap_image_option,
16
17
  exclude_secret_template_option,
17
18
  exclude_policy_template_option
18
19
  ].freeze
@@ -25,6 +26,7 @@ module Command
25
26
  - Use `--preserve-existing-runtime` to retain each workload container's configured app image, even when the workload is unready, and skip existing secret resources entirely while applying other template changes
26
27
  - Use `--exclude-secret-template NAME` and `--exclude-policy-template NAME` to exclude exact named templates without changing workload image handling
27
28
  - Missing or invalid workload images use only an unambiguous app image from ready workloads; refresh fails before applying templates when no safe fallback exists
29
+ - With `--preserve-existing-runtime`, use `--bootstrap-image APP:NUMBER_FULL_COMMIT_SHA` to initialize missing or own-app placeholder images from an explicitly verified registry image; valid configured images remain unchanged and foreign images are rejected
28
30
 
29
31
  **Preprocessed template variables:**
30
32
 
@@ -54,6 +56,7 @@ module Command
54
56
  VALIDATIONS = %w[config templates].freeze
55
57
 
56
58
  def call # rubocop:disable Metrics/MethodLength
59
+ @bootstrap_image = BootstrapImage.resolve(config, cp, preserving: config.options[:preserve_existing_runtime])
57
60
  @template_parser = TemplateParser.new(self)
58
61
  @names_to_filenames = config.args.to_h do |name|
59
62
  [name, @template_parser.template_filename(name)]
@@ -179,7 +182,7 @@ module Command
179
182
 
180
183
  def preserve_existing_runtime(templates)
181
184
  cache_existing_workloads(templates)
182
- ready_fallback_image = unambiguous_ready_app_image
185
+ ready_fallback_image = @bootstrap_image || unambiguous_ready_app_image
183
186
 
184
187
  skip_existing_secret_resources(templates).each do |template|
185
188
  preserve_workload_images(template, ready_fallback_image) if template["kind"] == "workload"
@@ -257,9 +260,17 @@ module Command
257
260
  def preserved_image(existing_image, ready_fallback_image)
258
261
  return existing_image if deployable_app_image?(existing_image)
259
262
 
263
+ raise "Cannot bootstrap a foreign workload image." if @bootstrap_image && !bootstrap_placeholder?(existing_image)
264
+
260
265
  ready_fallback_image
261
266
  end
262
267
 
268
+ def bootstrap_placeholder?(image)
269
+ return true if image.to_s.empty?
270
+
271
+ image.delete_prefix("/org/#{config.org}/image/") == "#{config.app}:#{Controlplane::NO_IMAGE_AVAILABLE}"
272
+ end
273
+
263
274
  def workload_ready?(workload)
264
275
  workload&.dig("status", "readyLatest") == true
265
276
  end
data/lib/command/base.rb CHANGED
@@ -483,6 +483,16 @@ module Command
483
483
  }
484
484
  end
485
485
 
486
+ def self.bootstrap_image_option
487
+ {
488
+ name: :bootstrap_image,
489
+ params: {
490
+ desc: "Verified own-app image with a full commit SHA, used only for missing images during refresh",
491
+ type: :string
492
+ }
493
+ }
494
+ end
495
+
486
496
  def self.exclude_secret_template_option(required: false)
487
497
  {
488
498
  name: :exclude_secret_template,
@@ -105,8 +105,8 @@ module Command
105
105
  - manual promotion from staging to production
106
106
  - nightly cleanup and PR help workflows
107
107
 
108
- It also copies cpflow's composite actions into `.github/actions/cpflow-*`
109
- so every local `uses:` target is checked in and can be audited directly.
108
+ The workflows load cpflow's composite actions from this gem's repository at
109
+ the ref each workflow pins, so no `.github/actions/cpflow-*` copies are generated.
110
110
 
111
111
  Pass `--staging-branch BRANCH` when staging should auto-deploy from a branch
112
112
  other than `main` or `master`; the generator will bake that branch into the
@@ -117,7 +117,7 @@ module Command
117
117
  DESC
118
118
  EXAMPLES = <<~EX
119
119
  ```sh
120
- # Creates workflow wrappers, local composite actions, and validation helpers
120
+ # Creates workflow wrappers and validation helpers
121
121
  cpflow generate-github-actions
122
122
 
123
123
  # Creates the flow with staging deploys triggered from develop
@@ -131,23 +131,16 @@ module Command
131
131
  VALIDATIONS = [].freeze
132
132
  REQUIRES_STARTUP_CHECKS = false
133
133
 
134
- # Resolve source roots from __dir__ rather than Cpflow.root_path because this file is
134
+ # Resolve the source root from __dir__ rather than Cpflow.root_path because this file is
135
135
  # loaded before `module Cpflow` finishes defining its class methods.
136
- REPOSITORY_ROOT = Pathname.new(File.expand_path("../..", __dir__))
137
136
  TEMPLATE_ROOT = Pathname.new(File.expand_path("../github_flow_templates", __dir__))
138
- ACTIONS_ROOT = REPOSITORY_ROOT.join(".github/actions")
139
137
 
140
138
  def self.generated_file_sources
141
139
  ensure_template_root!
142
140
 
143
- template_sources = files_beneath(TEMPLATE_ROOT).to_h do |source|
141
+ files_beneath(TEMPLATE_ROOT).to_h do |source|
144
142
  [source.relative_path_from(TEMPLATE_ROOT).to_s, source]
145
- end
146
- action_sources = files_beneath(ACTIONS_ROOT, "cpflow-*/**/*").to_h do |source|
147
- [source.relative_path_from(REPOSITORY_ROOT).to_s, source]
148
- end
149
-
150
- template_sources.merge(action_sources).sort.to_h.freeze
143
+ end.sort.to_h.freeze
151
144
  end
152
145
 
153
146
  def self.generated_files
@@ -160,11 +153,10 @@ module Command
160
153
 
161
154
  def self.ensure_template_root!
162
155
  raise "cpflow template directory not found: #{TEMPLATE_ROOT}" unless TEMPLATE_ROOT.directory?
163
- raise "cpflow action directory not found: #{ACTIONS_ROOT}" unless ACTIONS_ROOT.directory?
164
156
  end
165
157
 
166
- def self.files_beneath(root, pattern = "**/*")
167
- Dir.glob(root.join(pattern).to_s, File::FNM_DOTMATCH)
158
+ def self.files_beneath(root)
159
+ Dir.glob(root.join("**/*").to_s, File::FNM_DOTMATCH)
168
160
  .select { |path| File.file?(path) }
169
161
  .map { |path| Pathname.new(path) }
170
162
  .sort
data/lib/command/run.rb CHANGED
@@ -736,13 +736,13 @@ module Command
736
736
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
737
737
 
738
738
  def current_job_status(timeout_seconds: nil)
739
- result = if timeout_seconds
740
- cp.fetch_cron_workload(runner_workload, location: location, timeout_seconds: timeout_seconds)
741
- else
742
- cp.fetch_cron_workload(runner_workload, location: location)
743
- end
744
- job_details = result&.dig("items")&.find { |item| item["id"] == job }
745
- job_details&.dig("status")
739
+ command = cp.fetch_workload_command(runner_workload, job, timeout_seconds: timeout_seconds)
740
+ stage = command&.dig("lifecycleStage")
741
+ case stage
742
+ when "running" then "active"
743
+ when "completed" then "successful"
744
+ else stage
745
+ end
746
746
  end
747
747
 
748
748
  def job_status_reconciliation_deadline
@@ -8,7 +8,8 @@ module Command
8
8
  skip_secret_access_binding_option,
9
9
  skip_secrets_setup_option,
10
10
  skip_post_creation_hook_option,
11
- refresh_templates_option
11
+ refresh_templates_option,
12
+ bootstrap_image_option
12
13
  ].freeze
13
14
  DESCRIPTION = "Creates an app and all its workloads"
14
15
  LONG_DESCRIPTION = <<~DESC
@@ -26,6 +27,7 @@ module Command
26
27
  - If the hook exits with a non-zero code, the command will stop executing and also exit with a non-zero code
27
28
  - Use `--skip-post-creation-hook` to skip the hook if specified in `controlplane.yml`
28
29
  - Use `--refresh-templates` to apply configured templates noninteractively to an existing app while preserving each workload's configured app image even when workloads are unready or use mixed image versions, skipping existing secret templates (but filling missing opt-in generated review keys), repairing secrets access bindings, and skipping the post-creation hook
30
+ - With `--refresh-templates`, use `--bootstrap-image APP:NUMBER_FULL_COMMIT_SHA` to repair a partial bootstrap from a freshly built own-app registry image; valid workload images are preserved
29
31
  DESC
30
32
  VALIDATIONS = %w[config templates].freeze
31
33
 
@@ -41,6 +43,8 @@ module Command
41
43
  end
42
44
  raise "App '#{config.app}' does not exist, so its templates cannot be refreshed." if !app && refresh_templates
43
45
 
46
+ bootstrap_image = BootstrapImage.resolve(config, cp, preserving: refresh_templates)
47
+
44
48
  skip_secrets_setup = skip_secrets_setup?
45
49
 
46
50
  # Validate shared grants before app resource creation so config/policy
@@ -52,6 +56,7 @@ module Command
52
56
  args.push("--add-app-identity") unless skip_secrets_setup
53
57
  args.push("--yes") if refresh_templates
54
58
  args.push("--preserve-existing-runtime") if refresh_templates
59
+ args.push("--bootstrap-image", bootstrap_image) if bootstrap_image
55
60
  if !skip_secrets_setup && config.generated_review_secret_keys.any?
56
61
  args.push("--exclude-policy-template", config.secrets_policy)
57
62
  args.push("--exclude-secret-template", config.secrets) unless refresh_templates
@@ -18,7 +18,10 @@ module Command
18
18
  }].freeze
19
19
  DESCRIPTION = "Regenerates GitHub Actions files for the installed cpflow version"
20
20
  LONG_DESCRIPTION = <<~DESC.freeze
21
- Refreshes local composite actions and helper files from the installed gem.
21
+ Refreshes helper files from the installed gem. Workflows load cpflow's
22
+ composite actions from the pinned cpflow ref, so the command reports any
23
+ `.github/actions/cpflow-*` copies left by cpflow 6.0.0 for you to delete
24
+ once no workflow is pinned to 6.0.0. It never deletes them itself.
22
25
  All top-level workflows are preserved by default, including their refs,
23
26
  triggers, permissions, and deployment ownership. Use --workflows FILE...
24
27
  to explicitly add or replace named generated workflows. Replacement resets
@@ -37,7 +40,7 @@ module Command
37
40
  DESC
38
41
  EXAMPLES = <<~EX
39
42
  ```sh
40
- # Refresh actions/helpers while preserving downstream workflows
43
+ # Refresh helpers while preserving downstream workflows
41
44
  cpflow update-github-actions
42
45
 
43
46
  # When running cpflow through Bundler
@@ -64,6 +67,7 @@ module Command
64
67
  branch = selected_staging_branch(workflows)
65
68
  abort_if_custom_validator!
66
69
  GithubActionsGenerator.new([branch].compact, workflows: workflows).invoke_all
70
+ report_vendored_actions
67
71
 
68
72
  print_post_update_message
69
73
  end
@@ -102,6 +106,7 @@ module Command
102
106
 
103
107
  def abort_if_no_generated_files!
104
108
  return if GenerateGithubActions.generated_files.any? { |path| File.exist?(path) }
109
+ return if vendored_action_directories.any?
105
110
 
106
111
  Shell.abort(<<~MESSAGE)
107
112
  No generated cpflow GitHub Actions files found in this repository.
@@ -110,6 +115,27 @@ module Command
110
115
  MESSAGE
111
116
  end
112
117
 
118
+ # cpflow 6.0.0 copied its composite actions here. Scan the caller's tree rather than this
119
+ # gem's action names, so a copy is still found after an action is renamed or removed.
120
+ def vendored_action_directories
121
+ Dir.glob(".github/actions/cpflow-*").select { |path| File.directory?(path) }.sort
122
+ end
123
+
124
+ # Whether a copy is still needed depends on the cpflow release each wrapper pins, which a
125
+ # full-SHA pin does not reveal, so deletion stays a reviewed human step.
126
+ def report_vendored_actions
127
+ directories = vendored_action_directories
128
+ return if directories.empty?
129
+
130
+ Shell.warn(<<~MESSAGE)
131
+ cpflow no longer generates or updates these local action copies:
132
+ #{directories.map { |path| "- #{path}" }.join("\n")}
133
+ A workflow pinned to cpflow 6.0.0 still runs them. Delete them once every cpflow workflow
134
+ in this repository is pinned to a later release and none has a
135
+ `uses: ./.github/actions/cpflow-*` line. See docs/ci-automation.md.
136
+ MESSAGE
137
+ end
138
+
113
139
  def print_post_update_message
114
140
  Shell.info("")
115
141
  Shell.info("Updated cpflow GitHub Actions files for cpflow #{Cpflow::VERSION}.")
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # An explicit build result may initialize placeholders, never replace a deployed image.
4
+ class BootstrapImage
5
+ def self.resolve(config, controlplane, preserving:)
6
+ image = config.options[:bootstrap_image]
7
+ return unless image
8
+
9
+ raise "--bootstrap-image requires runtime preservation or --refresh-templates." unless preserving
10
+
11
+ name = image.delete_prefix("/org/#{config.org}/image/")
12
+ unless name.match?(/\A#{Regexp.escape(config.app)}:[0-9]+_[a-f0-9]{40}\z/)
13
+ raise "Bootstrap image must belong to this app and carry a full commit SHA."
14
+ end
15
+
16
+ details = controlplane.fetch_image_details(name)
17
+ raise "Bootstrap image does not exist in this org's registry." unless details && details["name"] == name
18
+
19
+ image
20
+ end
21
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "cgi"
3
4
  require "shellwords"
4
5
 
5
6
  class Controlplane # rubocop:disable Metrics/ClassLength
@@ -340,12 +341,12 @@ class Controlplane # rubocop:disable Metrics/ClassLength
340
341
  end
341
342
  end
342
343
 
343
- def fetch_cron_workload(workload, location:, timeout_seconds: nil)
344
- cmd = [
345
- "cpln", "workload", "cron", "get", workload,
346
- *gvc_org_args, "--location", location, "-o", "yaml"
347
- ]
348
- perform_yaml(cmd, timeout_seconds: timeout_seconds)
344
+ def fetch_workload_command(workload, job_id, timeout_seconds: nil)
345
+ org_name, gvc_name, workload_name, command_id = [org, gvc, workload, job_id].map do |segment|
346
+ CGI.escapeURIComponent(segment)
347
+ end
348
+ path = "/org/#{org_name}/gvc/#{gvc_name}/workload/#{workload_name}/-command/#{command_id}"
349
+ perform_yaml(["cpln", "rest", "get", path, "-o", "yaml"], timeout_seconds: timeout_seconds)
349
350
  end
350
351
 
351
352
  def cron_workload_deployed_version(workload)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cpflow
4
- VERSION = "6.0.0"
4
+ VERSION = "6.1.0"
5
5
  MIN_CPLN_VERSION = "3.1.0"
6
6
  end
@@ -152,8 +152,8 @@ validator, first preserve its downstream checks in executable
152
152
  `bin/test-cpflow-github-flow-custom`, then remove or rename the old generated
153
153
  validator before retrying the update.
154
154
 
155
- After updating the `cpflow` gem in this repo, refresh the generated local
156
- actions and validation helpers in the same PR. The default command
155
+ After updating the `cpflow` gem in this repo, refresh the generated
156
+ validation helpers in the same PR. The default command
157
157
  preserves every top-level workflow, including its refs, triggers, permissions, and
158
158
  downstream customizations:
159
159
 
@@ -85,7 +85,7 @@ jobs:
85
85
  echo "org=$org" >> "$GITHUB_OUTPUT"
86
86
 
87
87
  - name: Setup staging environment
88
- uses: ./.github/actions/cpflow-setup-environment
88
+ uses: ./.cpflow/.github/actions/cpflow-setup-environment
89
89
  with:
90
90
  token: ${{ secrets.CPLN_TOKEN_STAGING }}
91
91
  org: ${{ steps.staging-org.outputs.org }}
@@ -97,7 +97,7 @@ jobs:
97
97
 
98
98
  - name: Preview commits before production approval
99
99
  id: preview
100
- uses: ./.github/actions/cpflow-preview-promotion
100
+ uses: ./.cpflow/.github/actions/cpflow-preview-promotion
101
101
  env:
102
102
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103
103
  GH_REPO: ${{ github.repository }}
@@ -156,7 +156,7 @@ jobs:
156
156
  fi
157
157
 
158
158
  - name: Validate required secrets and variables
159
- uses: ./.github/actions/cpflow-validate-config
159
+ uses: ./.cpflow/.github/actions/cpflow-validate-config
160
160
  # Pass secrets via env so the composite action checks indirect shell
161
161
  # variables instead of interpolating secret values into a run script.
162
162
  env:
@@ -237,7 +237,7 @@ jobs:
237
237
  } >> "$GITHUB_OUTPUT"
238
238
 
239
239
  - name: Setup production environment
240
- uses: ./.github/actions/cpflow-setup-environment
240
+ uses: ./.cpflow/.github/actions/cpflow-setup-environment
241
241
  with:
242
242
  token: ${{ secrets.CPLN_TOKEN_PRODUCTION }}
243
243
  org: ${{ steps.cpln-orgs.outputs.production }}
@@ -303,7 +303,7 @@ jobs:
303
303
 
304
304
  - name: Detect release phase support
305
305
  id: release-phase
306
- uses: ./.github/actions/cpflow-detect-release-phase
306
+ uses: ./.cpflow/.github/actions/cpflow-detect-release-phase
307
307
  with:
308
308
  app_name: ${{ vars.PRODUCTION_APP_NAME }}
309
309
 
@@ -534,7 +534,7 @@ jobs:
534
534
  fi
535
535
 
536
536
  - name: Set up Docker Buildx
537
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
537
+ uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
538
538
 
539
539
  - name: Copy image from staging
540
540
  id: copy-image
@@ -698,7 +698,7 @@ jobs:
698
698
 
699
699
  - name: Wait for deployment health
700
700
  id: health-check
701
- uses: ./.github/actions/cpflow-wait-for-health
701
+ uses: ./.cpflow/.github/actions/cpflow-wait-for-health
702
702
  with:
703
703
  workload_name: ${{ steps.workloads.outputs.primary }}
704
704
  app_name: ${{ vars.PRODUCTION_APP_NAME }}
@@ -29,7 +29,11 @@ documents.each_key do |path|
29
29
  puts "parsed #{path}"
30
30
  end
31
31
 
32
- generated_local_action_pattern = %r{\A\./(?<directory>\.github/actions/cpflow-[a-z0-9]+(?:-[a-z0-9]+)*)\z}
32
+ # Current workflows load cpflow actions from the pinned `.cpflow` checkout, which exists
33
+ # only at run time. Caller-owned `.github/actions/cpflow-*` copies are the cpflow 6.0.0
34
+ # layout; a workflow that still references one needs that copy checked in.
35
+ generated_local_action_pattern =
36
+ %r{\A\./(?<checkout>\.cpflow/)?(?<directory>\.github/actions/cpflow-[a-z0-9]+(?:-[a-z0-9]+)*)\z}
33
37
  local_action_references = []
34
38
  invalid_local_action_references = []
35
39
  visited_container_ids = {}
@@ -43,10 +47,10 @@ walk = lambda do |node, source_path|
43
47
  case node
44
48
  when Hash
45
49
  uses = node["uses"]
46
- if uses.is_a?(String) && uses.start_with?("./.github/actions/cpflow-")
50
+ if uses.is_a?(String) && uses.start_with?("./.github/actions/cpflow-", "./.cpflow/")
47
51
  match = uses.match(generated_local_action_pattern)
48
52
  if match
49
- local_action_references << [source_path, match[:directory]]
53
+ local_action_references << [source_path, match[:directory]] unless match[:checkout]
50
54
  else
51
55
  invalid_local_action_references <<
52
56
  "#{source_path} has invalid generated local action reference #{uses}"
@@ -61,6 +65,24 @@ documents.each { |path, document| walk.call(document, path) }
61
65
 
62
66
  abort invalid_local_action_references.uniq.join("\n") unless invalid_local_action_references.empty?
63
67
 
68
+ # `.cpflow` exists only after a job checks it out, so each job must do that before its first cpflow action.
69
+ missing_checkouts = documents.flat_map do |path, document|
70
+ jobs = document.is_a?(Hash) && document["jobs"].is_a?(Hash) ? document["jobs"] : {}
71
+ jobs.filter_map do |job_name, job|
72
+ steps = job.is_a?(Hash) && job["steps"].is_a?(Array) ? job["steps"].grep(Hash) : []
73
+ first_action = steps.index { |step| step["uses"].to_s.start_with?("./.cpflow/") }
74
+ next unless first_action
75
+
76
+ checked_out = steps.take(first_action).any? do |step|
77
+ step["uses"].to_s.start_with?("actions/checkout@") &&
78
+ step["with"].is_a?(Hash) && step["with"]["path"] == ".cpflow" && !step["with"]["ref"].to_s.strip.empty?
79
+ end
80
+ "#{path}:#{job_name} must check out a pinned ref into .cpflow before its first cpflow action" unless checked_out
81
+ end
82
+ end
83
+
84
+ abort missing_checkouts.join("\n") unless missing_checkouts.empty?
85
+
64
86
  missing_actions = local_action_references.uniq.filter_map do |source_path, action_directory|
65
87
  directory_is_local = begin
66
88
  File.lstat(action_directory).directory?
@@ -79,7 +101,7 @@ missing_actions = local_action_references.uniq.filter_map do |source_path, actio
79
101
  end
80
102
 
81
103
  abort missing_actions.join("\n") unless missing_actions.empty?
82
- puts "all referenced local actions have checked-in descriptors"
104
+ puts "all cpflow action references use the pinned checkout or a checked-in descriptor"
83
105
  RUBY
84
106
 
85
107
  echo "==> check composite action input descriptions"
@@ -13,9 +13,9 @@ fi
13
13
  extensionless_shell_files=(
14
14
  .agents/bin/docs
15
15
  .agents/bin/lint
16
- .agents/bin/setup
17
- .agents/bin/test
18
- .agents/bin/validate
16
+ .agents/shaka/bin/setup
17
+ .agents/shaka/bin/test
18
+ .agents/shaka/bin/validate
19
19
  lib/github_flow_templates/bin/test-cpflow-github-flow
20
20
  script/check_command_docs
21
21
  script/check_cpln_links
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.1'
33
+ version: '3.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.1'
40
+ version: '3.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: psych
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -75,17 +75,17 @@ executables:
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
- - ".agents/agent-workflow.yml"
79
78
  - ".agents/bin/README.md"
80
79
  - ".agents/bin/docs"
81
80
  - ".agents/bin/lint"
82
- - ".agents/bin/setup"
83
- - ".agents/bin/test"
84
- - ".agents/bin/validate"
85
81
  - ".agents/legacy-workflow-policy.yml"
86
82
  - ".agents/shaka.md"
83
+ - ".agents/shaka/bin/setup"
84
+ - ".agents/shaka/bin/test"
85
+ - ".agents/shaka/bin/validate"
86
+ - ".agents/shaka/config.yml"
87
+ - ".agents/shaka/trusted-github-actors.yml"
87
88
  - ".agents/trusted-actions.yml"
88
- - ".agents/trusted-github-actors.yml"
89
89
  - ".agents/workflows/address-review.md"
90
90
  - ".agents/workflows/ai-rollout-e2e-test.md"
91
91
  - ".claude/commands/address-review.md"
@@ -103,6 +103,7 @@ files:
103
103
  - ".github/actions/cpflow-wait-for-health/action.yml"
104
104
  - ".github/dependabot.yml"
105
105
  - ".github/pull_request_template.md"
106
+ - ".github/scripts/deployment_lock.py"
106
107
  - ".github/workflows/check_cpln_links.yml"
107
108
  - ".github/workflows/claude-code-review.yml"
108
109
  - ".github/workflows/claude.yml"
@@ -184,6 +185,7 @@ files:
184
185
  - examples/circleci.yml
185
186
  - examples/controlplane.yml
186
187
  - lib/command/ai_github_flow_prompt.rb
188
+ - lib/command/ai_github_flow_prompt.txt
187
189
  - lib/command/apply_template.rb
188
190
  - lib/command/base.rb
189
191
  - lib/command/base_sub_command.rb
@@ -227,6 +229,7 @@ files:
227
229
  - lib/command/update_github_actions.rb
228
230
  - lib/command/version.rb
229
231
  - lib/constants/exit_code.rb
232
+ - lib/core/bootstrap_image.rb
230
233
  - lib/core/config.rb
231
234
  - lib/core/controlplane.rb
232
235
  - lib/core/controlplane_api.rb
@@ -317,7 +320,7 @@ licenses:
317
320
  metadata:
318
321
  rubygems_mfa_required: 'true'
319
322
  post_install_message: |
320
- cpflow 6.0.0 installed.
323
+ cpflow 6.1.0 installed.
321
324
  Generated GitHub Actions users: run `cpflow update-github-actions` after upgrading.
322
325
  Docs: https://github.com/shakacode/control-plane-flow/blob/main/docs/ci-automation.md#updating-generated-github-actions-after-gem-updates
323
326
  rdoc_options: []
data/.agents/bin/setup DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Install dependencies.
3
- set -euo pipefail
4
- cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
- exec bundle install
data/.agents/bin/test DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Run the test suite. Extra args pass through to rspec.
3
- set -euo pipefail
4
- cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
- exec bundle exec rspec "$@"
data/.agents/bin/validate DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Pre-push gate: full local validation (run before pushing).
3
- set -euo pipefail
4
- cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
- ./script/check_shell_scripts
6
- exec bundle exec rake