#486 Clone config customization for namespaces
Merged by onosek. Opened by onosek.
onosek/rpkg clone_config  into  master

Download 486.patch

Clone config customization for namespaces

After the 'clone' operation, a git config is updated with 'git-bz'
config values. Now, these values can be customized based on the
namespace of the cloned repository. Each namespace has its own
key 'clone_config_' in config section. For namespaces,
that missing this config ('tests' namespace is a good example),
any of these values aren't updated.
A repository has to be namespaced ('distgit_namespaced = True')
for the config to be applied.
Config file of x-pkg has to be modified.

JIRA: COMPOSE-2638
Fixes: https://pagure.io/fedpkg/issue/231

Signed-off-by: Ondrej Nosek onosek@redhat.com

example of the config file '/etc/rpkg/fedpkg.conf'

[fedpkg]
...
clone_config =
  bz.default-tracker bugzilla.redhat.com
  bz.default-product Fedora
  bz.default-version rawhide
  bz.default-component %(repo)s
  sendemail.to %(repo)s-owner@fedoraproject.org
+ clone_config_modules =
+   bz.default-tracker bugzilla.redhat.com
+   bz.default-product Fedora Modules
+   bz.default-version rawhide
+   bz.default-component %(repo)s
+   sendemail.to module-%(repo)s-owner@fedoraproject.org
+ clone_config_container =
+   bz.default-tracker bugzilla.redhat.com
+   bz.default-product Fedora Container Images
+   bz.default-version rawhide
+   bz.default-component %(repo)s
+   sendemail.to container-%(repo)s-owner@fedoraproject.org
...

How about moving configuration for rpms into clone_config_rpms and then simply get clone_config_{namespace}? It seems to me like using the rpms config for other namespaces is not really correct.

Just to verify if I understand well. I will add new config record "clone_config_rpms" and remove old "clone_config" record. Or does it make a sense to keep it as a default for namespaces which are not specified in the config?
I like the clone_config_{namespace} approach, but first didn't want to change the config too much.
There is also different approach: use hierarchy system; define just values that are specific for a namespace, in this case, "bz.default-product", "sendemail.to", and others would be used from default namespace config. But it is more complicated.

Your suggestion:

[fedpkg]
...
- clone_config =
-   bz.default-tracker bugzilla.redhat.com
-   bz.default-product Fedora
-   bz.default-version rawhide
-   bz.default-component %(repo)s
-   sendemail.to %(repo)s-owner@fedoraproject.org
+ clone_config_rpms =
+   bz.default-tracker bugzilla.redhat.com
+   bz.default-product Fedora
+   bz.default-version rawhide
+   bz.default-component %(repo)s
+   sendemail.to %(repo)s-owner@fedoraproject.org
+ clone_config_modules =
+   bz.default-tracker bugzilla.redhat.com
+   bz.default-product Fedora Modules
+   bz.default-version rawhide
+   bz.default-component %(repo)s
+   sendemail.to module-%(repo)s-owner@fedoraproject.org
+ clone_config_container =
+   bz.default-tracker bugzilla.redhat.com
+   bz.default-product Fedora Container Images
+   bz.default-version rawhide
+   bz.default-component %(repo)s
+   sendemail.to container-%(repo)s-owner@fedoraproject.org
...

Yes, that is what I meant. It should work for all namespaces that currently exist, and if a new namespace is added, I think the chances are it would not match the the rpms namespace.

The hierarchy sees too complicated to me too.

rebased onto bc82b14041ec3b1472de7ec5f02a224ee8e13994

This variant:

  • will not do any steps for not-namespaced ('distgit_namespaced = False') repositories
  • will require cautious releasing dependent packages (fedpkg). In the short meantime, it won't do the clone config steps because of missing configuration.

Looks good to me.

rebased onto 6ee8b537c26336c6f67219a8b1ec529dd6daf846

Pull-Request has been merged by onosek

Metadata