ruby_workspace_manager 0.6.5 → 0.6.6
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/rwm/affected_detector.rb +17 -4
- data/lib/rwm/errors.rb +2 -2
- data/lib/rwm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37763589fe851ae20d97ffdb9f44a5d4a67ffd90d9629f474eaa44a9840d3b50
|
|
4
|
+
data.tar.gz: 82f8a67c8bc0b27b9543dff8dd83957c02b8c91e071d9b14c8f5d286007a3398
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f93674a08b41f77222a254d557ae4186a51b9ede26026fe6e6e967277a161ecdcd99c4f61bab9d03ec5597f9d66707e93efb319dab5b6c90bc3ebb24f4dd73ed
|
|
7
|
+
data.tar.gz: a275f438dd04b589f763ee122bce26a5be3035e0c1c64a1099863c8b9dcb3184337f0e9195b889d46df11a328b30de3de621b45243f142e1ab6d552b00d812f8
|
|
@@ -24,7 +24,9 @@ module Rwm
|
|
|
24
24
|
@graph = graph
|
|
25
25
|
@committed_only = committed_only
|
|
26
26
|
@base_branch = base_branch || detect_base_branch
|
|
27
|
-
|
|
27
|
+
# Validate the *resolved* base, auto-detected or explicit. An unreachable base
|
|
28
|
+
# must fail loudly rather than silently report "nothing affected" (false-green CI).
|
|
29
|
+
validate_base_branch!
|
|
28
30
|
end
|
|
29
31
|
|
|
30
32
|
# Returns packages directly changed + their transitive dependents
|
|
@@ -91,10 +93,21 @@ module Rwm
|
|
|
91
93
|
def detect_changed_files
|
|
92
94
|
files = Set.new
|
|
93
95
|
|
|
94
|
-
# 1. Committed changes: base branch vs HEAD
|
|
96
|
+
# 1. Committed changes: base branch vs HEAD. A failure here means we cannot
|
|
97
|
+
# compare against the base (e.g. a shallow clone whose merge-base is below the
|
|
98
|
+
# fetched boundary). That must be loud — a silent empty result false-greens CI.
|
|
95
99
|
Rwm.debug("affected: git diff --name-only #{base_branch}...HEAD")
|
|
96
|
-
committed,
|
|
97
|
-
|
|
100
|
+
committed, committed_err, status = Open3.capture3("git", "-C", workspace.root, "diff", "--name-only", "#{base_branch}...HEAD")
|
|
101
|
+
unless status.success?
|
|
102
|
+
raise Rwm::InvalidBaseRefError.new(
|
|
103
|
+
base_branch,
|
|
104
|
+
reason: "Could not compute changes against base '#{base_branch}': " \
|
|
105
|
+
"git diff #{base_branch}...HEAD failed (#{committed_err.strip}). " \
|
|
106
|
+
"If this is a shallow clone, fetch more history " \
|
|
107
|
+
"(e.g. `git fetch origin #{base_branch} --unshallow`) or pass a valid --base."
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
committed.lines.each { |l| files << l.chomp }
|
|
98
111
|
|
|
99
112
|
unless @committed_only
|
|
100
113
|
# 2. Staged changes (not yet committed)
|
data/lib/rwm/errors.rb
CHANGED
|
@@ -42,8 +42,8 @@ module Rwm
|
|
|
42
42
|
class BootstrapError < Error; end
|
|
43
43
|
|
|
44
44
|
class InvalidBaseRefError < Error
|
|
45
|
-
def initialize(ref)
|
|
46
|
-
super("Base ref '#{ref}' does not exist. Check the branch name or pass a valid --base ref.")
|
|
45
|
+
def initialize(ref, reason: nil)
|
|
46
|
+
super(reason || "Base ref '#{ref}' does not exist. Check the branch name or pass a valid --base ref.")
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
data/lib/rwm/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.6.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Siddharth Bhatt
|
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
85
85
|
- !ruby/object:Gem::Version
|
|
86
86
|
version: '0'
|
|
87
87
|
requirements: []
|
|
88
|
-
rubygems_version: 4.0.
|
|
88
|
+
rubygems_version: 4.0.12
|
|
89
89
|
specification_version: 4
|
|
90
90
|
summary: Ruby Workspace Manager — an Nx-like monorepo tool for Ruby
|
|
91
91
|
test_files: []
|