Commit graph

73 commits

Author SHA1 Message Date
Nils Philippsen
78ac940933 use plural for certain variables and functions
Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-21 18:47:17 +01:00
Nils Philippsen
be18b8f87a pep8: consistently use lower case variable names
Previously, we had a mixture of lower_case_name and mixedCaseName. Use
lower case names except where external APIs force us to do otherwise.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-21 18:47:17 +01:00
Nils Philippsen
26c3288951 use more descriptive print_fas_names argument
This is because both users and groups can (co-)maintain components.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-21 18:47:17 +01:00
Nils Philippsen
06b0f23201 use more descriptive variable names in add_edit_component()
Also, don't use `owner`, 'qacontact' for two purposes: first for the FAS
username, then for the email address of the same person.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-21 18:47:17 +01:00
Pierre-Yves Chibon
fd66fa51c5 Start working on generating a public diff of the changes
This means replacing the emails in the output with their FAS username.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 18:47:17 +01:00
Pierre-Yves Chibon
3c504653a7 Move retrieving the POC for each product to the data gathering part
This makes sense and allows the output of the script to be easier to
share.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 16:46:46 +01:00
Pierre-Yves Chibon
4a44a51ba5 Make the code style consistent in the get_cli_arguments method
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 12:09:18 +01:00
Pierre-Yves Chibon
4833e4a566 Time the time it takes to build the bugzilla cache
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 12:09:18 +01:00
Pierre-Yves Chibon
4c697a63ce Allow specifying which projects to update
This allows to specify which projects to update instead of running on
all of them.
The project should be provided in form of namespace/name, for example:
``-p rpms/koji rpms/guake``.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 12:09:18 +01:00
Pierre-Yves Chibon
d3b7be42b4 Fix how the CC list is being generated
The data structure having changed, the code needed to be adjusted as
well.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 12:09:17 +01:00
Nils Philippsen
4ccfc9b5e6 expose additional configuration files to CLI
This adds the --add-config-file, --add-email-overrides-file options and
as a side effect allows to specify any number of either which will be
applied in order to the respective configuration objects.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-21 11:15:48 +01:00
Nils Philippsen
8cfa616073 fix console script entry point
In the course, clean up how execution errors are processed, i.e. use
exceptions rather than integer return codes to indicate errors.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-21 10:55:28 +01:00
Pierre-Yves Chibon
bce634b199 Bring back the possibility to override the default assignee
This is doable for packages that are retired (and thus where the
assignee is orphan) as well as per product: Fedora vs Fedora EPEL being
the most common.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 10:22:59 +01:00
Pierre-Yves Chibon
69edb448be Drop the filtering out of modules
Staging supports them now and if they don't we can now configure this
in the configuration file for staging anyway.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 09:58:33 +01:00
Pierre-Yves Chibon
94d17b2c05 Restructure the code
- Add an --env variable to change the environment used via the CLI
- Drop the ProductCache object
- Introduce the DistgitBugzillaSync object which allows dropping global
  variables to rely on attributes instead.
- Drop the pkgdb compatibility layer that was once introduced, pkgdb is
  no longer a thing and it's time to move on

This changes a little bit the order in which projects are updated, it
used to be by products first (Fedora, Fedora EPEL...) then package,
now it's the opposite: by package first then product.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-21 09:58:17 +01:00
Pierre-Yves Chibon
011774ef46 When an invalid account is found, inform about the package concerned
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-20 14:20:03 +01:00
Pierre-Yves Chibon
d61e83a157 Deal with users or groups not having the expected email address
An user could have no "bugzilla_email" set and a group no "mailing_list"
address set, both of which are expected to sync the ACLs to bugzilla.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-20 14:20:03 +01:00
Pierre-Yves Chibon
1f75496059 Update the dry-run and verbose outputs
The dry-run now returns a much more comprehensible output of what is
being changed.
This commit also adds some timing information at the end of the script
for the time the different steps took, this is helping profiling what
is taking the most time and thus what should be worked on.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-20 14:20:03 +01:00
Pierre-Yves Chibon
76e74fb6a4 Simplify the logic used when updating the qacontact
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-20 10:57:53 +01:00
Pierre-Yves Chibon
b002898f2b Simplify how the initialCClist is being built
This makes the code for people using the same logic as the code for
groups thus making it easier to read and review.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2019-11-20 10:57:53 +01:00
Nils Philippsen
59ded2d591 use str.format-style placeholder in mail template
Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-19 17:26:54 +01:00
Nils Philippsen
cdb0b03ea4 use configuration from files
Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-19 17:26:54 +01:00
Nils Philippsen
e59e1d510f move code to distgit_bugzilla_sync package
This allows as to have different functionality, e.g. handling
configuration, in their own separate modules.

Use relative imports for project-internal modules and remove shebangs
from them as they're not marked executable anyway. Instead, add
run-distgit-bugzilla-sync for testing from the repo worktree.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2019-11-19 17:25:35 +01:00
Renamed from pagure_sync_bugzilla.py (Browse further)