Open jessedyck opened 1 year ago
While at present the system works as designed, it should be possible to script this to push back to the source repo. That would look something like:
abcd
to your main branch in Githubabcd
and adds bcde
only to Pantheon repo (CI built assets)cdef
and defg
to Pantheoncdef
and defg
into efgh
and pushes that to a new branch in Githubefgh
into Github’s main branch (either with the same hash or a different one)efgh
back to Pantheon and add a new commit (e.g. fghi
) with CI assets to Pantheon. This is a force push so the repos here will be back to the state in #2
Summary
I’m using pushback, with a custom WP upstream and Build Tools, and want to ensure the downstream Pantheon sites and their respective Gitlab (canonical) repos are kept up to date, both with changes committed directly to Pantheon and the upstream changes applied from the upstream (via the dashboard - Apply Updates).
When I do an Apply Updates to bring upstream changes into the downstream, the changes are getting pushed to Gitlab, but as one big commit rather than all of the commits from the upstream repo (which I do see in the history on the Pantheon repo). Effectively pushing a squashed commit of all the upstream changes to the canonical downstream repo.
From what I can tell, Pushback is essentially checking out Gitlab’s commit from the metadata.json file, then overlaying all changes from the previous commit in Pantheon onto that. When there are multiple commits in between this has the effect of squashing them and would ultimately diverge the histories and create future issues trying to merge/apply updates again.
From tracing through the code it seems like this might either be expected/intended, or perhaps I’m looking at using it for something it’s not (yet?) intended to do.
High level repo steps:
I haven't yet gone through the process of recreating these steps outside of my use-case; these are just high level to illustrate what I have set up and get the conversation started.
Actual Behaviour
The changes are pushed to the canonical repo in a new branch, but they contain all the changes from step 3 squashed in one commit, rather multiple commits as were made in step 3.
Expected Behaviour
I was expecting that applying an upstream update on a downstream site would push the commits back to my canonical downstream repo such that both repos (Pantheon and Gitlab) would maintain the same history and continue to support this workflow.