Ideas for handling multiple changes in monorepo

,

Let’s say I have a monorepo with 2 folders:

  • back
  • front

The CI configuration is made to only build and deploy the back and/or the front depending on the changes in the commit.

Now the use case I’m facing:
The developer has made some changes on the “front” folder and commit/push.

Unfortunately, the pipeline triggers only the ‘front’ jobs but fails because of, let say, unit tests or whatever.
Those unit tests failed because he forgot the do some changes on the back folder.

Ok, so he commit/push a second time with only changes on the “back” folder.

The pipeline triggers only the “back” jobs this time, the back unit tests are ok and the “back” deploy job is performed.

You see the problem here: only the back is deployed.

What should I do beside telling the developer to do a “run pipeline” to trigger a “full” pipeline manually?

Hi @DoubleJo

The way I would do this would be to have a CI variable that tells the CI to run both pipelines, so something like:

front-job:
    rules:
         - if: "BOTH_PIPELINES == 'true'"
           when: on_success
         - if:
           changes: ...
           when: on_success
         - when: on_success
...

and then have developers push with the CI variable:

git push -o ci.variable="BOTH_PIPELINES=true"

Thank you for your response but it means that the developer will have to remember to set this variable.
The goal is to have an full optimal and automated pipeline.

Maybe there is no way to do it, and the developers will have to be careful.

I’m not sure there’s a fully automated way to do this. In the past I’ve sometimes used a script that looks through commit messages for a string (as an alternative to pushing a variable), but the developer still needs to remember something.