ruby_workspace_manager 0.6.2 → 0.6.3

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: 659d59c0a587e4479114fd819337775db56f4c4ae634757d0c6d6206e46addb1
4
- data.tar.gz: '07599b434c9f0f4d2aead2160cdf32029e24cf38701e1e66f1bacc9375c9fb2f'
3
+ metadata.gz: abb2b2c2c95382842ff412711726e5180b6b044b09278f74fd41bce2d29ae7e0
4
+ data.tar.gz: 2370c792ceb61d94619822c8b7a6f63277284f178e72d6a3539f782496d64ba1
5
5
  SHA512:
6
- metadata.gz: 8ee35a4451cabe1c66eaae86b1ceee7f64d9009a74e79bb744e27b21208fc7897b31f20df90e80a2546d760ae7e122a9f314455c3354d36fbd3cb426e508f62a
7
- data.tar.gz: 1acd2eadb3a504f83cdae5990f02b69bb38304e8e2def62b494099131982e93e7569b7be41198065d1fd132cc012585ecdc033044bd1ffb38d94df4f9d29675b
6
+ metadata.gz: a6746e8ced0a14de677e83de564c7477e89b0f2519a37447dc1a94dbe28acc3cef2b848c1b3bb2604afe24cd399050d677eceb2dbea194a87163c564df1cada4
7
+ data.tar.gz: 076e897c277f1074f5c4eef7ee834e5c1920050569783e2a84bac836aa9bb4c82aef182390294663068a24fd6690c172e6946b38ea2e29f0bc9289803ac47283
data/README.md CHANGED
@@ -211,6 +211,13 @@ rwm_lib "auth", require: false
211
211
 
212
212
  There is no `rwm_app` helper. Applications are leaf nodes — nothing should depend on them.
213
213
 
214
+ `rwm_lib` validates that the library directory exists. If you reference a library that hasn't been created yet, you'll get a clear error:
215
+
216
+ ```
217
+ rwm_lib 'payments': no library found at libs/payments.
218
+ Libraries must live in libs/. Create one with: rwm new lib payments
219
+ ```
220
+
214
221
  You can also use raw `gem ... path:` syntax directly. Both work identically for dependency detection.
215
222
 
216
223
  ### Transitive resolution
@@ -303,6 +310,15 @@ rwm run spec --buffered
303
310
 
304
311
  When a package fails, its transitive dependents are immediately skipped. Unrelated packages continue running. The exit code is 0 if all packages pass, 1 if any fail.
305
312
 
313
+ The summary distinguishes between skip reasons:
314
+
315
+ ```
316
+ 5 package(s): 2 passed, 1 failed, 1 skipped (dep failed), 1 skipped (no task).
317
+ ```
318
+
319
+ - **skipped (dep failed)** — a dependency failed, so this package was not attempted
320
+ - **skipped (no task)** — the package's Rakefile doesn't define the requested task
321
+
306
322
  ## Task caching
307
323
 
308
324
  ### Why caching matters
@@ -528,6 +544,8 @@ rwm affected --base develop
528
544
  rwm run spec --affected --base develop
529
545
  ```
530
546
 
547
+ If the provided `--base` ref doesn't exist, RWM errors immediately instead of silently returning no affected packages.
548
+
531
549
  ## Bootstrap and daily workflow
532
550
 
533
551
  ### What bootstrap does
@@ -544,6 +562,8 @@ rwm run spec --affected --base develop
544
562
 
545
563
  Both `rwm init` and `rwm bootstrap` are idempotent.
546
564
 
565
+ **Note on parallel installs:** Step 4 runs `bundle install` concurrently across packages. If your packages share a gem installation directory (the default), you may see Bundler log `Waiting for another process to let go of lock`. This is normal — Bundler serializes writes to the shared directory automatically. On large monorepos with many packages, this can slow down bootstrap. If this becomes a bottleneck, consider using `BUNDLE_PATH` per-package or running bootstrap sequentially.
566
+
547
567
  ### The bootstrap rake task
548
568
 
549
569
  Every scaffolded package includes an empty `bootstrap` task. This is where package-specific setup belongs:
data/bin/rwm CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  require "rwm"
5
5
 
6
- Rwm::CLI.run(ARGV)
6
+ exit(Rwm::CLI.run(ARGV))
@@ -24,6 +24,7 @@ module Rwm
24
24
  @graph = graph
25
25
  @committed_only = committed_only
26
26
  @base_branch = base_branch || detect_base_branch
27
+ validate_base_branch! if base_branch
27
28
  end
28
29
 
29
30
  # Returns packages directly changed + their transitive dependents
@@ -57,6 +58,13 @@ module Rwm
57
58
 
58
59
  private
59
60
 
61
+ def validate_base_branch!
62
+ _, _, status = Open3.capture3("git", "-C", workspace.root, "rev-parse", "--verify", "#{@base_branch}^{commit}")
63
+ return if status.success?
64
+
65
+ raise Rwm::Error, "Base ref '#{@base_branch}' does not exist. Check the branch name or pass a valid --base ref."
66
+ end
67
+
60
68
  def detect_base_branch
61
69
  # Try to read the remote's default branch
62
70
  ref, _, status = Open3.capture3("git", "-C", workspace.root, "symbolic-ref", "refs/remotes/origin/HEAD")
@@ -23,6 +23,15 @@ module Rwm
23
23
  puts graph.to_dot
24
24
  when :mermaid
25
25
  puts graph.to_mermaid
26
+ else
27
+ # Show a brief package listing when no format is requested
28
+ unless graph.packages.empty?
29
+ graph.packages.each_value do |pkg|
30
+ deps = graph.edges[pkg.name] || []
31
+ dep_str = deps.empty? ? "" : " → #{deps.join(", ")}"
32
+ puts " #{pkg.type == "lib" ? "lib" : "app"}/#{pkg.name}#{dep_str}"
33
+ end
34
+ end
26
35
  end
27
36
 
28
37
  0
@@ -100,21 +100,25 @@ module Rwm
100
100
 
101
101
  passed = runner.results.count(&:passed?)
102
102
  failed_results = runner.results.select { |r| r.failed? || r.errored? }
103
- skipped = runner.results.count { |r| r.skipped? || r.dep_skipped? }
103
+ no_task = runner.results.count(&:skipped?)
104
+ dep_failed = runner.results.count(&:dep_skipped?)
104
105
 
105
106
  total = runner.results.size
106
107
  parts = []
107
108
  parts << "#{passed} passed" unless passed.zero?
108
109
  parts << "#{failed_results.size} failed" unless failed_results.empty?
109
- parts << "#{skipped} skipped" unless skipped.zero?
110
+ parts << "#{dep_failed} skipped (dep failed)" unless dep_failed.zero?
111
+ parts << "#{no_task} skipped (no task)" unless no_task.zero?
110
112
 
111
113
  puts
112
114
  puts "#{total} package(s): #{parts.join(", ")}."
113
115
 
114
116
  passed_results = runner.results.select(&:passed?)
115
- skipped_results = runner.results.select { |r| r.skipped? || r.dep_skipped? }
117
+ no_task_results = runner.results.select(&:skipped?)
118
+ dep_skipped_results = runner.results.select(&:dep_skipped?)
116
119
  Rwm.debug("passed: #{passed_results.map(&:package_name).join(", ")}") unless passed_results.empty?
117
- Rwm.debug("skipped (no matching task): #{skipped_results.map(&:package_name).join(", ")}") unless skipped_results.empty?
120
+ Rwm.debug("skipped (no matching task): #{no_task_results.map(&:package_name).join(", ")}") unless no_task_results.empty?
121
+ Rwm.debug("skipped (dep failed): #{dep_skipped_results.map(&:package_name).join(", ")}") unless dep_skipped_results.empty?
118
122
 
119
123
  if failed_results.empty?
120
124
  0
data/lib/rwm/gemfile.rb CHANGED
@@ -53,10 +53,16 @@ module Rwm
53
53
  @rwm_resolved ||= Set.new
54
54
  return if @rwm_resolved.include?(name)
55
55
 
56
+ path = File.join(rwm_workspace_root, "libs", name)
57
+
58
+ unless File.directory?(path)
59
+ raise "rwm_lib '#{name}': no library found at libs/#{name}. " \
60
+ "Libraries must live in libs/. Create one with: rwm new lib #{name}"
61
+ end
62
+
56
63
  @rwm_resolved.add(name)
57
64
  Rwm.resolved_libs.add(name) unless @rwm_scanning
58
65
 
59
- path = File.join(rwm_workspace_root, "libs", name)
60
66
  gem(name, **opts, path: path)
61
67
 
62
68
  # Resolve transitive workspace deps from the target lib's Gemfile
data/lib/rwm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rwm
4
- VERSION = "0.6.2"
4
+ VERSION = "0.6.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_workspace_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siddharth Bhatt