ome / scc

OME tools for managing the Git(Hub) workflow
https://pypi.org/project/scc/
GNU General Public License v2.0
0 stars 15 forks source link

Push command #248

Closed sbesson closed 5 years ago

sbesson commented 5 years ago

The introduction of logic to couple components within super-builds (see https://github.com/ome/build-infra) has challenged the initial logic introduced in this repository where a single command was merging PRs, updating submodules and pushing to integration branches.

This PR introduces a standalone command allowing to push the state of a repository recursively to a remote branch. With it included, https://github.com/ome/build-infra/blob/1fff0fb33b55c69411e5fcaec472d4f0b635d122/recursive-merge#L43 and beyond could be more simply rewritten as:

scc merge $REPO_CONFIG $MERGE_OPTIONS -S $STATUS --update-gitmodules $BASE_BRANCH

echo "Update component versions"
foreach-set-dependencies

echo "Commit all component version changes"
git submodule foreach "git add -u"
git submodule foreach "git commit -m 'Update component versions' || true"
git add -u
git commit -m 'Update component versions' || true

echo "Push all branches"
scc push $PUSH_BRANCH

With the scc push command handling all the URL and recursive logic

joshmoore commented 5 years ago

The change looks quite straight-forward and sensible. Would you consider deprecating the old merge-based usage?

sbesson commented 5 years ago

Interesting thought, I think the trade-offs are:

Overall, I see us moving towards a recommendation of the first workflow, maybe a deprecation but I haven't assessed the impact e.g. internally.

joshmoore commented 5 years ago

Understood. We can re-evaluate that once we've gained more experience.