Standard Git structure and update workflow for simple unregistered packages

I have a package hosted on Github that I work on in VSCode (both of which I am new to). It currently has master, feature-x, and bugfix-x branches that I created as well as some branches from CompatHelper. All branches get merged into master once they are finished.

However, I noticed a workflow issue when trying to update my package dependencies. How can I test new versions of my package dependencies with my package before adding them to the compat list in the master Project.toml? The Project.toml has to be updated before ] update will work, but then my package says it is compatible with dependent packages before I know if that is true.

I imagine I need to add a new intermediate dev branch to my Git structure, but I don’t know how to change CompatHelper so it points to a different branch. Also, complicating my Git tree sounds like a bad idea. I already almost always screw up my merges and end up manually copy and pasting into a new commit for master instead. :weary:

1 Like

You probably don’t need a dev branch. What you need is:

  1. Github actions to automatically run tests (including downloading the relevant package versions as specified in your Project.toml) on every PR you make
  2. Some magic to make sure those tests are also run on every PR that CompatHelper makes

This thread: Easy workflow file for setting up GitHub Actions CI for your Julia package has info for step (1), and these docs: Home · CompatHelper.jl have info for step (2).

Once you do this, you’ll get a nice green checkmark on your PRs that verifies that they install and test correctly before merging into master.

I’d definitely recommend asking for help when you get into this state. Git can be confusing, but this isn’t the way :slight_smile:

1 Like

That makes sense. Unfortunately, my package is not open source at the moment, so Github actions is out.

I suppose the manual alternative is to

  1. git checkout CompatHelper branch
  2. ] update on that branch
  3. run tests on that branch
  4. merge PR
  5. repeat

or maybe

  1. create a new bugfix-compat branch with all the dependency updates added together manually
  2. update packages and test on that branch
  3. merge into master
  4. delete CompatHelper PRs.

I find it hard to ask for help when I’m in that state, because I don’t know how to describe what is wrong. I usually think I know what to do, but then get an error that says I need to resolve some conflict before continuing and can’t figure out how. One example is here. The answer got me halfway fixed, but I still had to undo a previous PR and make some empty commits to master before everything started working again.

That will mostly work, but by testing the CompatHelper branch, you’ll miss out on any potential interactions between more recent changes on master and that branch. To be safe, I’d suggest:

  1. Checkout compathelper branch
  2. Merge master into that branch: git merge origin/master
  • This doesn’t change master (yet). Instead, it brings in any new changes from master and unifies them with whatever changes are on the compathelper branch.
  1. Resolve any conflicts during this merge. It looks like you’re using VSCode for this–I don’t know how to use that particular tool, but I strongly recommend checking out https://meldmerge.org/ if you want to try something else (I use it constantly and have found it to work well even for extremely thorny merge conflicts in my daily work)
  2. At this point, you now have a branch which (a) includes the CompatHelper changes, (b) also includes any new changes from master and (c) will definitely merge cleanly into master when you’re ready.
  3. pkg> update and test as you said
  4. merge the PR, which should have no conflicts with master
1 Like