Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate opensuse and sle12 in directories rather than branches #920

Merged
merged 1 commit into from Mar 1, 2016

Conversation

okurz
Copy link
Member

@okurz okurz commented Jan 8, 2016

Depends on os-autoinst/os-autoinst#376 in
"os-autoinst".

Fixes https://progress.opensuse.org/issues/10162

  • Put opensuse "main.pm" into "products/opensuse/main.pm"
  • Merge sle12 content into master branch and put sle12 "main.pm" into
    "products/sle/main.pm"
  • Relies on DISTRI variable set to "opensuse" and "sle" accordingly used in
    "isotovideo"
  • Correct perl style according to "tidy" in "products/sle/main.pm".

The changes have been generated like this:

git co origin/master -- main.pm templates templates-aarch64
git mv -f main.pm products/opensuse/
git mv -f templates products/opensuse/
git mv -f templates-aarch64 products/opensuse/
git co origin/sle12 -- main.pm templates
git mv -f main.pm products/sle/main.pm
git mv -f templates products/sle/templates

Reasoning:

Branches should not be used to track different products (or flavors) with a
common subset. Branches in VCS should only be (and commonly are) used for two
different purposes:

  • short-lived local branches for developers, "feature branches"
  • different versions of the same product for maintenance purposes: Only
    selected bugfixes are back-ported

As the differences between opensuse and sle12 are only the files "main.pm"
and "templates" (and outdated "variables" and "Makefile" file in sle12
branch), every product should rather be in its own subfolder, e.g.
"products/opensuse/main.pm", "products/sle/main.pm", etc.

Benefits:

  • Easier to do the same changes for opensuse and sle
  • It is possible to share code in opensuse/main.pm and sle/main.pm, the
    content does not need to be duplicated
  • No more manual approach trying to keep changes in sync by making two
    pull requests for separate branches. It is possible to do everything in one
    commit at the same time as the tests are shared anyway
  • No need for manual setup of sle repo with symlinks to be usable for testing

@okurz okurz changed the title Separate opensuse and sle12 in directories rather than branches [DEPENDS ON OTHER PR] Separate opensuse and sle12 in directories rather than branches Jan 8, 2016
@coolo
Copy link
Contributor

coolo commented Jan 11, 2016

why only sle12 and not sle11? how long do you think will it take before we require different main.pm for sp0?

I like the idea of having all main.pms in one branch, but opensuse-latest and sle12-latest are not the only products we maintain

@okurz
Copy link
Member Author

okurz commented Jan 11, 2016

why only sle12 and not sle11?
Because I did not know sle11 is used in current tests anymore. I does not seem to get triggered. I would merge in sle11 in another branch if you agree.

how long do you think will it take before we require different main.pm for sp0?
I like the idea of having all main.pms in one branch, but opensuse-latest and sle12-latest are not the only products we maintain

I don't know and I don't understand how this is related. As soon as or if we need a different main.pm for different products we can use the same approach or do you see problems with that?

@aaannz
Copy link
Contributor

aaannz commented Jan 11, 2016

I think the problem @coolo is pointing at is that you named product sub-dirs opensuse and sle instead of i.e. opensuse-tw, sle12.

@coolo
Copy link
Contributor

coolo commented Jan 11, 2016

damn! I wrote a long comment and used an emacs shortcut to copy&paste (^W - which closed the tab :)

Anyway: openQA calculates CASEDIR using DISTRI and VERSION, so I wonder if we would symlink all these CASEDIRS to one and have the needles where main.pm is or keep it as is - just without the symlinks to /master

@okurz
Copy link
Member Author

okurz commented Jan 11, 2016

openQA calculates CASEDIR using DISTRI and VERSION

Make sure you have seen the prerequisite to the current change in the backend os-autoinst/os-autoinst#376 as well as the description in #920 (comment)

I might have done it not as you would have expected it and maybe I got it wrong.

so I wonder if we would symlink all these CASEDIRS to one and have the needles where main.pm is or keep it as is - just without the symlinks to /master

Hm, what I tested is that tests can be found according to the DISTRI variable and I think I might have missed the needles directory. So probably needles should also be discovered similar to the main.pm, e.g. in here https://github.com/os-autoinst/os-autoinst/blob/master/needle.pm#L198
At best would structure the tests distribution independently of the backend change with just symlinks and a good directory structure but I don't think this is possible.

@coolo
Copy link
Contributor

coolo commented Jan 11, 2016

so to organize this all I want to have (all under /var/lib/openqa/share/tests):

opensuse/products/opensusemain.pm
opensuse/products/opensuse/needles
opensuse/products/sle-12/main.pm
opensuse/products/sle-12/needles
opensuse/products/sle-12-SP1 -> sle-12
opensuse/products/sle-11/main.pm
opensuse/products/sle-11/needles
sle -> opensuse

@aaannz
Copy link
Contributor

aaannz commented Jan 11, 2016

opensuse/products/opensuse/? What is wrong with using just products/opensuse?

@coolo
Copy link
Contributor

coolo commented Jan 11, 2016

what's the point of /var/lib/openqa/share/tests/products ?

@coolo
Copy link
Contributor

coolo commented Jan 11, 2016

actually 'products' is possibly misnamed - what it actually is: a directory for alternative main.pm files.

@aaannz
Copy link
Contributor

aaannz commented Jan 11, 2016

Right, wrong working dir. Nevermind then.

@okurz
Copy link
Member Author

okurz commented Jan 11, 2016

> opensuse/products/opensuse/? […]
  ^                 ^--------- "product name"
   \--------- "name of the test distribution", whole name would be "os-autoinst-distri-opensuse"

So to make it more correct and less ambiguous we should probably rename it in openqa.suse.de to resolve to "os-autoinst-distri-opensuse" as a CASEDIR, not "opensuse". Can we do this? Can be done later, of course, or as a workaround with symlinks for now.

actually 'products' is possibly misnamed - what it actually is: a directory for alternative main.pm files.

should we say "distri" then? This is also the name of the variable that is evaluated inside this dir

@coolo
Copy link
Contributor

coolo commented Jan 11, 2016

Both are combination of distri and version. But what we basically have is a product defined by distri and version and a "test family", which is opensuse.

@okurz
Copy link
Member Author

okurz commented Jan 11, 2016

I will try to accomodate the "version" as well as the needles directory and check this locally.

@okurz okurz force-pushed the feature/os_sle_merge branch 2 times, most recently from 9dd7d61 to 3276a15 Compare February 26, 2016 07:46
@okurz okurz changed the title [DEPENDS ON OTHER PR] Separate opensuse and sle12 in directories rather than branches Separate opensuse and sle12 in directories rather than branches Feb 26, 2016
@okurz
Copy link
Member Author

okurz commented Feb 26, 2016

Regarding the version it was decided among @coolo @sysrich and me that it makes more sense to keep old or released versions in branches as they should not change but "opensuse" and "sle" as in "Factory" is constantly moving therefore the updates of tests.

Can we merge this?

okurz added a commit to okurz/openQA that referenced this pull request Feb 26, 2016
Depending on the location of main.pm in the cloned test distribution
fetchneedles selects the corresponding needles directory.

See
os-autoinst/os-autoinst-distri-opensuse#920
for the corresponding os-autoinst-distri-opensuse change.
okurz added a commit to okurz/openQA that referenced this pull request Feb 26, 2016
Depending on the location of main.pm in the cloned test distribution
fetchneedles selects the corresponding needles directory.

See
os-autoinst/os-autoinst-distri-opensuse#920
for the corresponding os-autoinst-distri-opensuse change.
Depends on os-autoinst/os-autoinst#376 in
"os-autoinst".

Fixes https://progress.opensuse.org/issues/10162

 - Put *opensuse* "main.pm" into "products/opensuse/main.pm"
 - Merge *sle12* content into **master** branch and put *sle12* "main.pm" into
   "products/sle/main.pm"
 - Relies on DISTRI variable set to "opensuse" and "sle" accordingly used in
   "isotovideo"
 - Correct perl style according to "tidy" in "products/sle/main.pm".

The changes have been generated like this:

    git co origin/master -- main.pm templates templates-aarch64
    git mv -f main.pm products/opensuse/
    git mv -f templates products/opensuse/
    git mv -f templates-aarch64 products/opensuse/
    git co origin/sle12 -- main.pm templates
    git mv -f main.pm products/sle/main.pm
    git mv -f templates products/sle/templates

Reasoning:

Branches should not be used to track different products (or flavors) with a
common subset. Branches in VCS should only be (and commonly are) used for two
different purposes:
 - short-lived local branches for developers, "feature branches"
 - different versions of the same product for maintenance purposes: Only
   selected bugfixes are back-ported

As the differences between *opensuse* and *sle12* are only the files "main.pm"
and "templates" (and outdated "variables" and "Makefile" file in *sle12*
branch), every product should rather be in its own subfolder, e.g.
"products/opensuse/main.pm", "products/sle/main.pm", etc.

Benefits:

 - Easier to do the same changes for opensuse and sle
 - It is possible to share code in opensuse/main.pm and sle/main.pm, the
   content does not need to be duplicated
 - No more manual approach trying to keep changes in sync by making two
   pull requests for separate branches. It is possible to do everything in one
   commit at the same time as the tests are shared anyway
 - No need for manual setup of sle repo with symlinks to be usable for testing
okurz added a commit that referenced this pull request Mar 1, 2016
Separate opensuse and sle12 in directories rather than branches
@okurz okurz merged commit d361210 into os-autoinst:master Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants