Basically, instead of reporting that the namespace did not exist for
every package/component in that namespace, we now only report it once
per namespace (but we still print the full info in the logs if verbose
is enabled).
Then, instead of always emailing the admins for mis-configurations, we'll
only email them if there are other errors then these which will happen
all the time due to the flatpaks and tests namespaces which do not exist
in PDC and bugzilla.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Instead of having a product name and an override via the bz_product_name
just use always the product name.
This fixes the issue around "Fedora Container Images" which were somehow
not cached from bugzilla. This led to the script trying to create them
instead of updating them, which of course failed since they did exist
in bugzilla.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
In the previous commit we changed the key from ``bugzilla_email``
to simply ``email`` to be consistent with the data we retrieve
from FAS, but it looks like we forgot to update this method which
thus results in the script failing with a KeyError on
``bugzilla_email``.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
The bugzilla_email relies on a user id -> email mapping that is kept
in python-fedora fedora/client/fas2.py.
That mapping is out-dated and, in fact, conflicts with the one used
in this project in email_overrides.toml.
So instead of retrieving the bugzilla_email, we retrieve the regular
email and use our, up to date and maintained mapping to do the
overrides.
Otherwise, we end up in the situation described at:
https://pagure.io/fesco/issue/2460#comment-669474
where user A was marked as having an invalid account because they had
a bugzilla_email entry that was returning an invalid bugzilla account.
Changing to use the email field led to more people having invalid
accounts because their mapping had not been updated.
So let's make sure that mapping remains up to date now and use only
one.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This was reported by a former maintainer of the freerdp rpm where the
Fedora EPEL CC list was not being updated because the only EPEL branch
still active in PDC was the el6 branch. Thus the script was never
matching Fedora EPEL as being still active and as a result it was not
updating it.
By adjusting the regex, we solve this issue.
Fixes https://pagure.io/fedora-infrastructure/issue/9122
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
These users, who should only ever be CC'ed to a project, will not
be synced to bugzilla.
In other words, they are allowed to not have a bugzilla account
and that should not impact the syncing of the default assignee and
CC list from dist-git to bugzilla.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
The patch contained a full-bloom syntax error.
It also did not record the POC for every product but Fedora EPEL.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Otherwise we end up trying to update a component just because the case
is different while the account on the bugzilla is the same.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
The error message for the error 504 reads:
<Fault 504: 'The name XXX is not a valid username. Either you misspelled
it, or the person has not registered for a ... Bugzilla ... account.'>
In other words, the request succeeded but the user does not exist. So
in those situation there are no reasons to keep on trying, it won't work
at the next attempt either.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
ie: retry a few time (up to 5 times) with a 20 seconds pause between
each attempt before raising an exception.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Sometime we fail to retrieve the list of bugs for a component because of
some hick ups with bugzilla.
With this commit, we'll try up to 5 times and wait 20 seconds before
each attempts.
If that still fails, then too bad.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Specify data files to ship explicitly and set include_package_data to
False so it doesn't pick up random cruft that happens to be in the work
tree.
Signed-off-by: Nils Philippsen <nils@redhat.com>
For public display we do not want to share our user's email address more
than that. So we have an --print-fas-names action mapping back the email
to an username.
This commit makes the logic that updates open bugs when the default
assignee changes honor this flag.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Initializing it to a (default)dict could cause problems if several
instances are used. We don't do that at the moment, but it's bad
practice to initialize class members to mutable data types which aren't
supposed to be shared between instances.
Signed-off-by: Nils Philippsen <nils@redhat.com>
Setting data['is_active'] before checking if it's empty makes subsequent
code always think things have changed.
Signed-off-by: Nils Philippsen <nils@redhat.com>
Aside from not using two different idioms for the same thing, it
performs better (not noticeably in our case, but hey).
Signed-off-by: Nils Philippsen <nils@redhat.com>
Previously, the `products` dict mapped product names in Fedora to their
Bugzilla counter parts. Now that all information pertaining products is
in this dictionary, the Bugzilla product name (if differing) is in the
bz_product_name sub-key.
Rename some variables to make their purpose a little more obvious, and
not use `product` for two different things (names and the informational
dictionary stored in the product cache).
fixes: #32
Signed-off-by: Nils Philippsen <nils@redhat.com>
While the script runs, we're keeping in memory a list of all the errors
we have encountered and at the end of the run we send to the admins a
report with all of them, categorized in a way that will hopefully make
it easier to fix for them.
We're also adding an option to preserve the function to send the report
to the admins but disable sending the notifications to the
users/packagers.
This would be useful to start get an idea of the number of people who
would have issues with the script.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
We give an overview of the time for the different steps at the end, so
no need to give it in the middle
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
When building the product cache, the information of which products a
package/component is part of could be leaked from one item to the next
because it's only every reset once per call.
This was introduced when we moved the functionality of the ProductCache
class into BugzillaProxy.build_product_cache().
Signed-off-by: Nils Philippsen <nils@redhat.com>
When a package is retired, we want to de-active it in bugzilla which
makes it no longer visible in the list of packages against which one
can fill a bug.
Fixes https://pagure.io/fedora-infrastructure/issue/7690
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This is in order not to have to hard code EPEL. In the course,
reorganize how products and their correspondent versions and component
namespaces are configured.
Signed-off-by: Nils Philippsen <nils@redhat.com>
- Move the send_email() function into DistgitBugzillaSync as a method in
order to access the configuration environment easily.
- Make whether or not emails are sent use the email.send_mails
configuration option rather than the name of the configuration
environment.
- Don't hard code the SMTP host.
Signed-off-by: Nils Philippsen <nils@redhat.com>
This is for all configuration related to sending emails, not for e.g.
the default QA contact. By chance, it fixes a problem in the default
configuration where the mail templates ended up in the pdc_types
subtree.
Signed-off-by: Nils Philippsen <nils@redhat.com>