DLRN icon indicating copy to clipboard operation
DLRN copied to clipboard

[RFE] Allow to force checkout when --local and --dev options are used

Open karelyatin opened this issue 4 years ago • 8 comments

Currently when --local is used whatever checked out branch is there that's used[1] to get the package build. In TripleO CI there is a request[2] to get package build twice for upgrade jobs(once for deploy release and then for the upgrade release). In zuul jobs source repos are already cloned and the branch is checked out based on zuul job config: override-checkout or zuul branch. For distgit repos those are cloned[3] if not already cloned with --dev mode, would need to allow force checkout for this case too.

It would be good to get this supported in DLRN.

[1] https://github.com/softwarefactory-project/DLRN/blob/92c9bda3edb8e2f38f1084dc9a0a92dfadfa14c6/dlrn/repositories.py#L25 [2] https://bugs.launchpad.net/tripleo/+bug/1958995 [3] https://github.com/softwarefactory-project/DLRN/blob/92c9bda3edb8e2f38f1084dc9a0a92dfadfa14c6/dlrn/drivers/rdoinfo.py#L146-L150

karelyatin avatar Jan 25 '22 14:01 karelyatin

So, IIUC, each dlrn run will require diferent projects.ini config to point to different branches, releases, right?, in that case i'd say it's like running two different instances of dlrn. BTW, how will tripleo manage the two depends-on on different branches? i need more details...

amoralej avatar Jan 25 '22 14:01 amoralej

Yes projects.ini is created on the fly based on release getting deployed, so it will be seperate for both initial deploy and upgrade deploy. For different depends-on just have an example like https://review.rdoproject.org/r/c/testproject/+/38542 and also some more info on use case in the linked bug https://bugs.launchpad.net/tripleo/+bug/1958995

karelyatin avatar Jan 25 '22 15:01 karelyatin

So, IIUC what we want is:

  1. The build-test-package role takes care of checking out the commit for branch stable/A.

  2. The build-test-package role creates a projects.ini config for release A

  3. dlrn is executed with --local to build the patch. If we not use --dev, we'd get the distgit from RDO to the required branch. Isn't that what we want?

  4. The build-test-package checks out the second commit for branch stable/B

  5. The build-test-package role creates a new nrojects.ini config for release B.

  6. Remove the database

  7. dlrn is executed with --local but without --dev to force checkout of the distgit in the new branch.

What's missing from dlrn features PoV?.

amoralej avatar Jan 25 '22 15:01 amoralej

I think i got it now. We need to use --dev to get delorean repos added from trunk.r.o to the mock config. So i think the best solution here is to simply remove data/*_distgit when removing the database in step 6 ?

amoralej avatar Jan 25 '22 15:01 amoralej

Yes right for distgit, just removing will work and dlrn will auto clone required branch as per projects.ini. What about source repos? To support that changes needed in DLRN side, right?

karelyatin avatar Jan 25 '22 16:01 karelyatin

But, we'd we want to clone the repos upstream?, my understanding is that the whole point of building packages in the job is to build patches wich are still unmerged, in depends-on or in the project gate. In which case we may need to build temporarily from upstream last commit? we already have that in rdo trunk current repo

amoralej avatar Jan 25 '22 16:01 amoralej

No we don't want to rebuild already built patches. So in upgrade jobs(Like VIctoria to Wallaby) we want to build packages for depends-on from both stable/victoria and stable/wallaby.

karelyatin avatar Jan 28 '22 16:01 karelyatin

Handling it like https://review.opendev.org/c/openstack/tripleo-quickstart-extras/+/826284 in tripleo side to support this use case.

karelyatin avatar Feb 02 '22 10:02 karelyatin

use-case solved in tripleo-quickstart https://review.opendev.org/c/openstack/tripleo-quickstart-extras/+/826284

apevec avatar Oct 24 '23 17:10 apevec