SPM referenced branch and merging branches

I wish to develop several packages in tandem and will push the changes to remote git repos, there will probably a dev branch alongside the master branch.
If I want the CI tests on the dev branches to pass, the packages must refer to their dependencies dev branches too, but what I don't understand is what I should do when I want to merge back to master ?
If I merge back the branch without any modification to Package.swift, there will be commits in master referencing the dev branch, which doesn't seem to be correct. On the other hand, I cannot change the dependencies back to master before merging with master as the tests wouldn't pass (SPM will fetch a graph that doesn't contain the expected changes yet).

What is the usual strategy to solve this issue ?

Thank you

Merge from the bottom up. The bottom package doesn’t depend on anything so its tests just pass. Once its new functionality is available from its master, the next level can change and point at that new master and still pass tests. Now the following level can do the same. Continue level by level until the top level package is pointing at only master branches and passing tests, then merge.

Actually, it is common to even prohibit pointing at anything but semantic versions when merging to master. That way master cannot break just because dependencies undergo further, breaking changes on their own master branches.

1 Like

I see, first merging the libraries that have no dependency and then merging their dependent libraries/executables and so on... did I get this correctly?

Thank you for your reply! :slight_smile:

Oui. Il semble que vous l’avez compris correctement.

Je vous en pris.

Terms of Service

Privacy Policy

Cookie Policy