Keeping local development up to date with upstream repo

Hi,
I am not an expert with git collaboration workflows.
I am developing a Fronius Inverter component.
I made my first commit about that and now I wanted to fetch the upstream dev branch and integrate it with my work.

I have got this git local repos structure:

branch dev (the dev branch of my origin repo forked out of Home Assistant upstream central repo)
branch master_base (checked out from dev)
branch dev_base (checked out from master_base)

I do all my development in dev_base.
When a feature is ready, I commit it and then merge dev_base onto master_base and master_base onto dev.

So, after committing my fronius-commit and merging everything down until both master_base and dev brnaches contain my fronius-commit, I did the following to get the upstream/dev integrated into my work:

git fetch upstream dev          -> fetch upstream/dev branch
git checkout dev                   -> checkout to local dev branch
git rebase upstream/dev       -> rebase local dev branch on top of upstream/dev branch
git checkout master_base    -> checkout to local master_base branch
git rebase dev                       -> rebase local master_base branch on top of local dev branch
git checkout dev_base         -> checkout to local dev_base branch
git rebase master_base        -> rebase local dev_base branch on top of local master_base branch

After that I checkout out to my dev_base branch again to test if everything was working, but launching hass resulted in the following error:

Traceback (most recent call last):
  File "/Users/andyk/Documents/develop/python/virtualenvs/asbox/bin/hass", line 9, in <module>
    load_entry_point('homeassistant', 'console_scripts', 'hass')()
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/__main__.py", line 358, in main
    args = get_arguments()
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/__main__.py", line 116, in get_arguments
    import homeassistant.config as config_util
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/config.py", line 17, in <module>
    from homeassistant.core import valid_entity_id
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/core.py", line 24, in <module>
    from voluptuous.humanize import humanize_error
ImportError: No module named 'voluptuous.humanize'; 'voluptuous' is not a package

Is it the case that the updated upstream/dev branch needs a voluptuous more recent version?
What does my upstream integration process is missing then?
Am I supposed to rerun any setup procedure after integrating my work with git? If yes, how should it be done?
Or am I missing something else?

Thank you very much,
Andrea

I’m trying to keep things simple. After cloning and changing to the directory of the clone. I do

$ git remote add upstream https://github.com/home-assistant/home-assistant.git
$ script/setup
$ git checkout -b new-feature
...
$ git pull --rebase upstream dev

I don’t use intermediate branches.

It can happen that dev already contains a new release of a dependency but if you change back to master the downgrade should be done automatically.

1 Like

Thank you for your answer:slight_smile:

So, beside the different branching strategy (which I will try to simplify a bit as far as our project specs will allow it) I get this two points:

  1. No need for script/setup rerun after rebasing on upstream

The script/setup have to be run just one time, at the beginning of the project, which I already did of course.

  1. Rebase onto master to avoid new dependencies releases problems

Would I better do

git pull --rebase upstream master

to be sure dependencies go on working?

[EDIT]

Nope: I tried that (git pull --rebase upstream master*) and still got a dependency not found related error:

Traceback (most recent call last):
  File "/Users/andyk/Documents/develop/python/virtualenvs/asbox/bin/hass", line 9, in <module>
    load_entry_point('homeassistant', 'console_scripts', 'hass')()
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/__main__.py", line 363, in main
    args = get_arguments()
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/__main__.py", line 121, in get_arguments
    import homeassistant.config as config_util
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/config.py", line 18, in <module>
    from homeassistant.core import valid_entity_id
  File "/Users/andyk/Documents/develop/home-assistant/homeassistant/core.py", line 22, in <module>
    import aiohttp
ImportError: No module named 'aiohttp'

There is still something I am missing:unamused:

Thank you again,
Andrea