modulesync 4.6.0 → 4.6.1
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/.github/workflows/ci.yml +2 -2
- data/.github/workflows/release.yml +2 -2
- data/CHANGELOG.md +10 -2
- data/lib/modulesync/repository.rb +3 -2
- data/lib/modulesync/version.rb +1 -1
- data/spec/unit/module_sync/repository_spec.rb +44 -0
- 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: b2b460c8084356169de564afc59efed808706c5a08aa3501f8fe1f6f3930fbd3
|
|
4
|
+
data.tar.gz: 637c12c11b80a3545949cb8e28e3c941e522d9b41fb2a7ba180a9a51e832b223
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 431a276bdaa1fef73a7cc9d670d5c7ee398c7eb82a84e32dd9ce14959d7f001656f7b8bada9d906f76d42ae51affa9298e9b03d629c54ae497b03485d63cc4c1
|
|
7
|
+
data.tar.gz: e9a0a7842ff1f908a7ffc81f99045186068919b052c5ffd0f4ed886d50ae1e6fd4338726db141333e0326221b79077b837e7e65da0f93bd032677f20c218e8ee
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -18,7 +18,7 @@ jobs:
|
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
20
|
- name: Setup ruby
|
|
21
|
-
uses: ruby/setup-ruby@
|
|
21
|
+
uses: ruby/setup-ruby@e8944e80fb94b20106697132f8c20c665fab29e9 # v1.325.0
|
|
22
22
|
with:
|
|
23
23
|
ruby-version: "3.4"
|
|
24
24
|
bundler-cache: true
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
steps:
|
|
39
39
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
40
40
|
- name: Install Ruby ${{ matrix.ruby }}
|
|
41
|
-
uses: ruby/setup-ruby@
|
|
41
|
+
uses: ruby/setup-ruby@e8944e80fb94b20106697132f8c20c665fab29e9 # v1.325.0
|
|
42
42
|
with:
|
|
43
43
|
ruby-version: ${{ matrix.ruby }}
|
|
44
44
|
bundler-cache: true
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
19
|
- name: Install Ruby
|
|
20
|
-
uses: ruby/setup-ruby@
|
|
20
|
+
uses: ruby/setup-ruby@e8944e80fb94b20106697132f8c20c665fab29e9 # v1.325.0
|
|
21
21
|
with:
|
|
22
22
|
ruby-version: 'ruby'
|
|
23
23
|
- name: Build gem
|
|
@@ -96,7 +96,7 @@ jobs:
|
|
|
96
96
|
with:
|
|
97
97
|
name: gem-artifact
|
|
98
98
|
- name: Install Ruby
|
|
99
|
-
uses: ruby/setup-ruby@
|
|
99
|
+
uses: ruby/setup-ruby@e8944e80fb94b20106697132f8c20c665fab29e9 # v1.325.0
|
|
100
100
|
with:
|
|
101
101
|
ruby-version: 'ruby'
|
|
102
102
|
- name: Wait for release to propagate
|
data/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [4.6.
|
|
5
|
+
## [4.6.1](https://github.com/voxpupuli/modulesync/tree/4.6.1) (2026-09-25)
|
|
6
6
|
|
|
7
|
-
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/v4.
|
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/v4.6.0...4.6.1)
|
|
8
|
+
|
|
9
|
+
**Fixed bugs:**
|
|
10
|
+
|
|
11
|
+
- fix: rebase existing remote branches after a fresh clone [\#376](https://github.com/voxpupuli/modulesync/pull/376) ([rwaffen](https://github.com/rwaffen))
|
|
12
|
+
|
|
13
|
+
## [v4.6.0](https://github.com/voxpupuli/modulesync/tree/v4.6.0) (2026-07-31)
|
|
14
|
+
|
|
15
|
+
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/v4.5.0...v4.6.0)
|
|
8
16
|
|
|
9
17
|
**Implemented enhancements:**
|
|
10
18
|
|
|
@@ -105,16 +105,17 @@ module ModuleSync
|
|
|
105
105
|
puts "Overriding any local changes to repository in '#{@directory}'"
|
|
106
106
|
git.fetch 'origin', prune: true unless operate_offline
|
|
107
107
|
git.reset_hard
|
|
108
|
-
rebase_target = remote_default_branch if rebase && !operate_offline
|
|
109
108
|
switch(branch: branch)
|
|
110
109
|
git.pull('origin', branch) if !operate_offline && remote_branch_exists?(branch)
|
|
111
|
-
rebase_onto(rebase_target) if rebase_target
|
|
112
110
|
else
|
|
113
111
|
raise ModuleSync::Error, 'Unable to clone in offline mode.' if operate_offline
|
|
114
112
|
|
|
115
113
|
clone
|
|
116
114
|
switch(branch: branch)
|
|
117
115
|
end
|
|
116
|
+
|
|
117
|
+
rebase_target = remote_default_branch if rebase && !operate_offline
|
|
118
|
+
rebase_onto(rebase_target) if rebase_target
|
|
118
119
|
end
|
|
119
120
|
|
|
120
121
|
def rebase_onto(branch)
|
data/lib/modulesync/version.rb
CHANGED
|
@@ -73,6 +73,50 @@ describe ModuleSync::Repository do
|
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
describe '#prepare_workspace' do
|
|
76
|
+
context 'with a fresh clone and an existing remote modulesync branch' do
|
|
77
|
+
before do
|
|
78
|
+
allow(Dir).to receive(:exist?).with('/tmp/example/.git').and_return(false)
|
|
79
|
+
allow(Git).to receive(:clone).with('https://github.com/example/repository.git', '/tmp/example').and_return(git)
|
|
80
|
+
allow(Git).to receive(:default_branch).with('https://github.com/example/repository.git').and_return('main')
|
|
81
|
+
allow(git).to receive(:current_branch).and_return('main', 'modulesync')
|
|
82
|
+
allow(branches).to receive(:local).and_return([])
|
|
83
|
+
allow(git).to receive(:checkout).with('origin/modulesync')
|
|
84
|
+
allow(git).to receive(:branch).with('modulesync').and_return(instance_double(Git::Branch, checkout: true))
|
|
85
|
+
allow(log).to receive(:between).with('modulesync', 'origin/main').and_return(log)
|
|
86
|
+
allow(log).to receive(:execute).and_return([instance_double(Git::Object::Commit)])
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it 'rebases and pushes the existing branch even when rendering makes no file changes' do
|
|
90
|
+
allow(git).to receive(:status).and_return(instance_double(Git::Status, added: {}, changed: {}, deleted: {}))
|
|
91
|
+
expect(git).to receive(:checkout).with('origin/modulesync').ordered
|
|
92
|
+
expect(git_lib).to receive(:send).with(:command, 'rebase', 'origin/main').ordered
|
|
93
|
+
expect(git_lib).to receive(:send).with(:command, 'push', '--force-with-lease', 'origin', 'modulesync').ordered
|
|
94
|
+
|
|
95
|
+
repository.prepare_workspace(branch: 'modulesync', operate_offline: false, rebase: true)
|
|
96
|
+
|
|
97
|
+
expect(repository.submit_changes([], branch: 'modulesync', message: 'Update', force: false)).to be true
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it 'does not rebase unless requested' do
|
|
101
|
+
expect(Git).not_to receive(:default_branch)
|
|
102
|
+
expect(git_lib).not_to receive(:send)
|
|
103
|
+
|
|
104
|
+
repository.prepare_workspace(branch: 'modulesync', operate_offline: false)
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
it 'does not rebase an existing workspace in offline mode' do
|
|
109
|
+
allow(Dir).to receive(:exist?).with('/tmp/example/.git').and_return(true)
|
|
110
|
+
allow(git).to receive(:current_branch).and_return('modulesync')
|
|
111
|
+
expect(git).to receive(:reset_hard)
|
|
112
|
+
expect(git).not_to receive(:fetch)
|
|
113
|
+
expect(git).not_to receive(:pull)
|
|
114
|
+
expect(Git).not_to receive(:default_branch)
|
|
115
|
+
expect(git_lib).not_to receive(:send)
|
|
116
|
+
|
|
117
|
+
repository.prepare_workspace(branch: 'modulesync', operate_offline: true, rebase: true)
|
|
118
|
+
end
|
|
119
|
+
|
|
76
120
|
it 'fetches and rebases the selected branch onto the remote default branch when requested' do
|
|
77
121
|
allow(Dir).to receive(:exist?).with('/tmp/example/.git').and_return(true)
|
|
78
122
|
allow(Git).to receive(:default_branch).with('https://github.com/example/repository.git').and_return('main')
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: modulesync
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.6.
|
|
4
|
+
version: 4.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vox Pupuli
|
|
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
266
266
|
- !ruby/object:Gem::Version
|
|
267
267
|
version: '0'
|
|
268
268
|
requirements: []
|
|
269
|
-
rubygems_version: 4.0.
|
|
269
|
+
rubygems_version: 4.0.20
|
|
270
270
|
specification_version: 4
|
|
271
271
|
summary: Puppet Module Synchronizer
|
|
272
272
|
test_files: []
|