Development process once v4 is released (git-flow, branch, tag)

Hello everyone!

We were discussing this with @AlexTrovato and @VonOx, given that the release is soon we will need to change our development flow to introduce more testing before each release.

Before debating this topic, just one constraint we have:

The release builds of Docker images for ARM platforms are extremely slow (about 1 hour), and we can’t necessarily do them unlimitedly. I don’t know the limits of CircleCI, but a few builds per week/month are okay, several builds per day is not. We can’t therefore say that we systematically build a branch (master? dev?), it must be a manual action to say « we want to build a DEV build so that everyone can test this pre-release ».

@AlexTrovato I’ll let you speak if you have any suggestions :slight_smile:

Oh hello, let me introduce myself, my name is… no we’ve already done the introductions :stuck_out_tongue:

I do indeed think it would be interesting to have a « testing » or « pre-release » branch that in some ways continues the current mode, a candidate version that must be tested as much as possible (we know it’s difficult to test everything, especially when connecting to hardware…).

In short, we should stay in a mode of generating an image per new service, with as much testing as possible, to correct feedback without getting confused.

I say « per new service » but if we find enough testers, we could go up to 3 services; but I also think it’s important to limit the scope.

This means we would be at a maximum of one image per day (because time is also needed to process feedback).

So:

  • wait for the integration of N new features (services or core)
  • generate an image with a scope limited to these N features (+ other bugs if bugs)

We can get closer to an Agile + Git Flow process:

  • provide an amount of work for a limited « duration/scope » (with a task list)
  • integrate these new features into a dev branch from the PRs
  • validate (depending on availability) the new features (listed) one by one
  • when everything is okay, we merge everything into master
  • a new version has just been born

Success comes with good organization.

I’m talking, talking, but your opinions interest me.

Hello to you both,

I don’t fully understand what you’re saying, and that’s normal, I don’t have the knowledge in software development.

However, could you clarify what you mean by:

Do you need testers for certain functions, certain hardware before incorporating them definitively into Gladys?

If so, it might be interesting to make a list of available users and the hardware they own to be able to test.

This list won’t make people available, but it’s a rather good idea to know who you can turn to.

Yes, I like the idea of the equipment list.
I start with the idea that if you enter your equipment, it means you want it to be integrated into Gladys and for that it needs to be tested.

I’m for it.

For the dialogue between Alex and Pierre-Gilles, I don’t understand everything either. But it’s interesting to read this topic because most of the time these conversations are private and non-developers cannot participate by giving their point of view.

This also involves project supervision, so project managers or other team leaders can contribute at the organizational level.

It would indeed be great to have a test branch to validate new features/evolutions before integrating them into the main branch.
But should we detail them by service? I don’t think so, otherwise, we won’t test the potential side effects on other services under development.

It would also be great to have a branch to fix bugs detected on the Release → Git flow :+1:

I am also in favor of defining task lists linked to PRs, to be integrated by milestone, but I realize it is difficult to be agile when working on it only in the evening…
If we had a way to flexibly adjust which PRs will be integrated into the next Release, depending on the evolution of our schedule, that would be great.

With this RC, @pierre-gilles will find GAFAM investors and hire us!

Cool! :+1:

By the way, I found a nice bug collection tool that handles node. There is a great article about it in the Linux Magazine special issue that just came out:

Do you know it?

In my opinion, I’m rather in favor. After what scares me with this approach is that this branch becomes an « everything » branch, and we reach a stage where, for example, we have 2 features that are ready to be merged, and they are blocked by a « rotten » feature that prevents the merge.

For example: imagine you’re working on the Sonoff HTTP PR, and someone is working on the Zigbee2mqtt PR.

If we put both in « pre-release », but one of them introduces a critical bug that takes time to fix, then the Sonoff PR is blocked (and the entire development flow with it). Whereas in our current approach, we work « per individual branch per feature ».

I would be interested in seeing how large open-source projects close to our use case do it (I think of Home Assistant for example, they have a lot of contributors).

Yes, I use it on many projects. However, it’s adapted for cloud projects, not for self-hosted open-source projects.
1/ It sends all your data to Sentry, which is the opposite of the project’s philosophy
2/ Not to mention the pricing/limitations. It’s not at all made for our use case :slight_smile:

If you can, we can talk about the error tracking/telemetry part in another topic. It’s a subject I’m not opposed to, but it must be done well and with great precautions to respect the privacy of Gladys Assistant users.

@pierre-gilles I admit that the multi-features branch is risky. We can then do:

  • a feature / service is ready
  • we reassure being aligned on the « pre-release » branch
  • we generate an image
  • we « guarantee » that everything works
  • we merge on the « pre-release » branch

2nd feature we start over

This will be a bit longer, but a bit more secure.
The most annoying point I see (at first glance) is the parallel development:

  • feature 1 and 2 are ready at the same time
  • we test them
  • both are OK
  • but merging one can affect the operation of the other
  • so we need to reproduce the test phase of « 2 » after « 1 » has been merged
    (small loss of time, but gain in quality)

That said, since the developers are not full-time, we can consider that this is a marginal case.

To bounce back on the processes of large open-source projects equivalent, here’s how Home Assistant proceeds:

  1. A « dev » branch which is the equivalent of our master branch. All PRs are merged into this branch, and once a week, a « beta » image is built. I imagine some power users run Home-Assistant beta instead of the « prod » version.

  2. A master branch, which is the production version. Every two weeks, they rebase the « master » branch on the dev branch. (master becomes the dev content which is normally in the testing phase for 1 week via the beta tag)

I find that pretty good, but my question is: what happens when there is a major issue on their dev branch?

Also, in the end, I see little difference with our current flow.

We merge PRs into master (which is the equivalent of their dev). Then, we just need a manual CI task to build master when needed (to a Docker dev tag), and when we are ready, we make a versioned tag for it to go to production!

Yes, it’s basically the same, it’s mainly the testing and approval phase that must be « rigorous ».

Exactly, a PR should only be merged if it really works perfectly.

By the way, that reminds me it would be great if each PR at least did an amd64 build in the automated tests, to ensure that the Docker image always works perfectly. (I say amd64 because these are fast builds, if we have to test ARM builds it takes a lot). Currently, we are a bit in the dark when we merge on the Docker side. @VonOx what do you think?

I agree, but the big blocking point on PRs is the management of secrets.

To work around this, we could build a dedicated CI (Travis for example), this would allow us to be more precise about who sees the build logs.

This is just a quick idea.

For the amd64 build in PRs, I was just talking about a build without push! So no secret problems :slight_smile:

You are almost forced to log in before building, there is even a rate limit on the pull now

Not at the end on CircleCI for now!

They have communicated on the subject:

CircleCI has partnered with Docker to ensure that our users can continue to access Docker Hub without rate limits. On November 1st, with few exceptions, you should not be impacted by any rate limits when pulling images from Docker Hub through CircleCI.

However, these rate limits may go into effect for CircleCI users in the future. That’s why we’re encouraging you and your team to add Docker Hub authentication to your CircleCI configuration and consider upgrading your Docker Hub plan, as appropriate, to prevent any impact from rate limits in the future.

It’s sure it’s not a long-term solution but for now it does the job :slight_smile:

After that, for me it’s obvious that they will implement a solution for open-source projects for this rate-limit issue because for this we will really not be the only ones to have this problem.

For the story of builds + push in the PR I am 100% agree that we still have the problem of secrets, but build amd64 only I think it’s okay!

Oh, I hadn’t seen that! In that case, no problem. We can even use GitHub Actions on PRs.

I summarize before starting the PR:

  • @pierre-gilles you create a dev branch
  • we build a beta docker image on this branch (we can use Github Actions to preserve the quota)
  • We add an amd64 build on the PRs without push and without secrets.

PS: If we need to build images on PRs, I can (with a Travis for example)