-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target branch .sync.yml
not taken into account on branch update (--force)
#192
Comments
I had similar troubles using
IMHO, in More precisely, I dont catch the usecase when you want to amend an existing commit then push if we had an hard-reset feature. |
In order to illustrate your issue (and test the new framework available in #202), I wrote what I understand of your issue as a behavior test: Feature: Update module with a .sync.yml file
@wip
@announce-output
Scenario: Updating a module with a .sync.yml file, then update it upstream
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
And a file named "config_defaults.yml" with:
"""
---
a-managed-file:
a-key: a-global-value
"""
And a file named "moduleroot/a-managed-file.erb" with:
"""
<%= @configs['a-key'] %>
"""
And the puppet module "puppet-test" from "fakenamespace" has a file named ".sync.yml" with:
"""
---
a-managed-file:
a-key: an-old-local-value
"""
When I run `msync update --branch modulesync --message "Update a-managed-file"`
Then the exit status should be 0
And the file named "modules/fakenamespace/puppet-test/a-managed-file" should contain:
"""
an-old-local-value
"""
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba" in branch "modulesync"
Given the puppet module "puppet-test" from "fakenamespace" has a file named ".sync.yml" with:
"""
---
a-managed-file:
a-key: a-new-local-value
"""
When I run `msync update --branch modulesync --message "Update a-managed-file" --force`
Then the exit status should be 0
And the file named "modules/fakenamespace/puppet-test/a-managed-file" should contain:
"""
a-new-local-value
"""
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba" in branch "modulesync" Does it match with your scenario? |
I'm not sure that it covers the same topic. This here is really about a design issue: That the |
This commit implements the scenario described at voxpupuli#192.
@bittner OK, I implemented what I understand from your description and it seems that now works perfectly on top of my refactoring branch. |
This commit implements the scenario described at voxpupuli#192.
This commit implements the scenario described at voxpupuli#192.
This commit implements the scenario described at voxpupuli#192.
This commit implements the scenario described at voxpupuli#192.
Now fixed as tested in #242 |
When updating an existing branch,
msync update --force
seems to consider the values in the.sync.yml
file of the existing branch (meant to be updated), instead of the.sync.yml
file of the target branch. This might be a design fault.Side note: I did this on a GitLab merge request, but the behavior is likely the same even w/o
--pr
Example update flow
msync update --pr
, which creates an update (new branch, optional merge request).sync.yml
; hence, I update.sync.yml
(in target module, in target branch, e.g.master
).msync update --pr --force
to update the already existing branch (created earlier)Now, I would expect the updated branch to consider the values in
.sync.yml
of the target branch (i.e.master
in our example). But the changes are based on the values of.sync.yml
from the existing, earlier created branch.I need to delete the branch created by
msync update
and run ModuleSync afresh. 😟Recreate target branch? (instead of "update")
The above behavior is probably not intended. The branch was originally created off the target branch, which then naturally has a
.sync.yml
file that matches across both branches.When a branch is updated, especially with
--force
, then the branch should really, technically, be created off that target branch again and force-pushed over the branch created by ModuleSync earlier. That way we would guarantee the same behavior at all times. Correct?The text was updated successfully, but these errors were encountered: