#451 Add no_reuse flag to disable reuse
Merged 3 years ago by hlin. Opened 3 years ago by hlin.
hlin/odcs master  into  master

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

      - `no_deps` - For `tag` `source_type`, do not resolve dependencies between packages and include only packages listed in the `packages` in the compose. For `module` `source_type`, do not resolve dependencies between modules and include only the requested module in the compose.

      - `include_unpublished_pulp_repos` - For `pulp` `source_type`, include also unpublished repositories for input content-sets.

      - `check_deps` - When set, abort the compose when some package has broken dependencies.

+     - `no_reuse` - When set, do not try to reuse old compose.

  - `sigkeys` - List of signature keys IDs. Only packages signed by one of these keys will be included in a compose. If there is no signed version of a package, compose will fail. It is also possible to pass an empty-string in a list meaning unsigned packages are allowed. For example if you want to prefer packages signed by key with ID `123` and also allow unsigned packages to appear in a compose, you can do it by setting sigkeys to `["123", ""]`.

  - `results` - List of additional results which will be generated as part of a compose. Valid keys are:

      - `iso` - Generates non-installable ISO files with RPMs from a compose.

@@ -105,6 +105,8 @@ 

      # For "pulp" source_type, ignore any repos do not exist in the remote Pulp

      # instance.

      "ignore_absent_pulp_repos": 32,

+     # Do not reuse old composes.

+     "no_reuse": 64,

  }

  

  INVERSE_COMPOSE_FLAGS = {v: k for k, v in COMPOSE_FLAGS.items()}

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

      - *ignore_absent_pulp_repos* - Ignore non-existing content sets in the source of Pulp compose. The source field on the compose will be updated to match what was actually used in the compose.

      - *check_deps* - Compose will fail if the RPM-level dependencies between packages in the compose are not satisfied.

      - *include_done_modules* - Compose can include also modules which are in the ``done`` state. By default, only modules in ``ready`` state are allowed to be included in a composes.

+     - *no_reuse* - Compose will be generated directly instead of trying to reuse old one.

  

  .. _koji_event:

  

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

      ]

  {%- endif %}

  

+ pkgset_allow_reuse = config.pkgset_allow_reuse

  

  {%- if config.source_type_str in ["tag", "build"] and not config.packages %}

  # In case no package is requested, include all of them.

@@ -472,6 +472,9 @@ 

      :param models.Compose compose: Instance of models.Compose.

      """

  

+     if compose.flags & COMPOSE_FLAGS["no_reuse"]:

+         return None

+ 

      # RAW_CONFIG composes cannot reuse other composes, we cannot track input

      # for them.

      if compose.source_type == PungiSourceType.RAW_CONFIG:
@@ -972,13 +975,15 @@ 

                  pungi_cfg.gather_method = "nodeps"

              if compose.flags & COMPOSE_FLAGS["no_inheritance"]:

                  pungi_cfg.pkgset_koji_inherit = False

+             if compose.flags & COMPOSE_FLAGS["no_reuse"]:

+                 pungi_cfg.pkgset_allow_reuse = False

  

          koji_event = None

          if compose.source_type == PungiSourceType.KOJI_TAG:

              koji_event = compose.koji_event

  

          old_compose = None

-         if koji_tag_cache.is_cached(compose):

+         if pungi_cfg.pkgset_allow_reuse and koji_tag_cache.is_cached(compose):

              koji_tag_cache.reuse_cached(compose)

              old_compose = koji_tag_cache.cache_dir

  

@@ -251,6 +251,7 @@ 

          self.scratch_build_tasks = (

              scratch_build_tasks.split(" ") if scratch_build_tasks else []

          )

+         self.pkgset_allow_reuse = True

  

          # Store results as list of strings, so it can be used by jinja2

          # templates.