#184 Add some overrides
Merged 4 years ago by sgallagh. Opened 4 years ago by sgallagh.
releng/ sgallagh/fedora-module-defaults overrides  into  master

file modified
-1
@@ -7,6 +7,5 @@ 

          make \

          python3-six \

          python3-libmodulemd \

-         python3-libmodulemd1 \

          python3-GitPython \

      && dnf -y clean all

file added
+6
@@ -0,0 +1,6 @@ 

+ document: modulemd-defaults

+ version: 1

+ data:

+     module: ant

+     profiles:

+         1.10: [default]

file added
+6
@@ -0,0 +1,6 @@ 

+ document: modulemd-defaults

+ version: 1

+ data:

+     module: gimp

+     profiles:

+         2.10: [default]

@@ -0,0 +1,8 @@ 

+ document: modulemd-defaults

+ version: 1

+ data:

+     module: maven

+     profiles:

+         3.5: [default]

+         3.6: [default]

+     modified: 201910251749

@@ -0,0 +1,6 @@ 

+ document: modulemd-defaults

+ version: 1

+ data:

+     module: scala

+     profiles:

+         2.10: [default]

file modified
+28 -13
@@ -102,9 +102,11 @@ 

          script_dir = os.path.abspath(sys.argv[1])

      else:

          script_dir = os.path.dirname(os.path.realpath(__file__))

+     defaults_dir = os.path.abspath(os.path.join(script_dir, '..'))

+     overrides_dir = os.path.join(defaults_dir, 'overrides')

  

      # Get the repo we're running in

-     repo = git.Repo(script_dir, search_parent_directories=True)

+     repo = git.Repo(defaults_dir, search_parent_directories=True)

  

      # Get the list of files in this repository

      files = [x for (x, y) in repo.index.entries.keys()]
@@ -120,7 +122,6 @@ 

              exclusions.append(line.strip())

  

      # Validate all of the files

-     merger = Modulemd.ModuleIndexMerger()

      for file in files:

          excluded = False

          for excl in exclusions:
@@ -132,16 +133,6 @@ 

              if not valid:

                  error("{} failed to validate".format(file))

                  result = os.EX_DATAERR

-             else:

-                 try:

-                     merger.associate_index(idx, 0)

-                 except GLib.Error as e:

-                     error(

-                         "Could not merge {} with other defaults: {}".format(

-                             file, e.message

-                         )

-                     )

-                     result = os.EX_DATAERR

  

      if result == os.EX_DATAERR:

          return result
@@ -150,7 +141,9 @@ 

      # conflicts arise that weren't detected by the above tests. This should be

      # impossible.

      try:

-         idx = merger.resolve_ext(strict_default_streams=True)

+         idx = Modulemd.ModuleIndex()

+         idx.update_from_defaults_directory(path=defaults_dir,

+                                            strict=True)

      except GLib.Error as e:

          error("Could not merge all defaults: {}".format(e.message))

          result = os.EX_DATAERR
@@ -158,6 +151,28 @@ 

      if result == os.EX_OK:

          info("Merging all of the documents encountered no errors.")

  

+     print("\nDefault streams (Runtime):")

+     print("================")

+     for m, s in idx.get_default_streams().items():

+         print("{}:{}".format(m, s))

+ 

+     try:

+         idx = Modulemd.ModuleIndex()

+         idx.update_from_defaults_directory(path=defaults_dir,

+                                            overrides_path=overrides_dir,

+                                            strict=True)

+     except GLib.Error as e:

+         error("Could not merge all defaults: {}".format(e.message))

+         result = os.EX_DATAERR

+ 

+     if result == os.EX_OK:

+         info("Merging all of the documents encountered no errors.")

+ 

+     print("\nDefault streams (Buildroot):")

+     print("================")

+     for m, s in idx.get_default_streams().items():

+         print("{}:{}".format(m, s))

+ 

      return result

  

  

At today's FESCo meeting, we agreed to test out Ursa Prime using only the avocado and dwm modules in the buildroot. These patches update the tests to properly handle the overrides directory and adds override defaults for ant, gimp, maven and scala to drop their default stream.

1 new commit added

  • Test and display both runtime and buildroot defaults
4 years ago

To see what module streams end up being default for the runtime or the buildroot, look at the end of https://jenkins-fedora-infra.apps.ci.centos.org/job/fedora-module-defaults/836/console

Pull-Request has been merged by sgallagh

4 years ago