This is an automated email from the git hooks/post-receive script. nthykier pushed a commit to branch master in repository lintian.
commit ed8885ce4aa0e08194ea69014924c85adda112aa Author: Niels Thykier <ni...@thykier.net> Date: Tue Feb 13 20:46:34 2018 +0000 reporting: Tweak handling of unprocessable groups Make "last-error-by" survive new versions so that we can use it to tell if a package had issues with the previous version (until reprocessed). This enables us to: 1) ensure that the report is still considered "truncated" 2) write a separate page for list of packages that recently had issues. Item 1) is done as a part of this patch. Signed-off-by: Niels Thykier <ni...@thykier.net> --- commands/reporting-lintian-harness.pm | 12 ++++++++++-- commands/reporting-sync-state.pm | 5 +++-- lib/Lintian/Util.pm | 8 ++++++-- reporting/templates/maintainer.tmpl | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/commands/reporting-lintian-harness.pm b/commands/reporting-lintian-harness.pm index e2538da..e824c56 100644 --- a/commands/reporting-lintian-harness.pm +++ b/commands/reporting-lintian-harness.pm @@ -426,8 +426,16 @@ sub process_worklist { next if not exists($state->{'groups'}{$group_id}); $group_data = $state->{'groups'}{$group_id}; if ($errors{$group_id}) { - ++$group_data->{'processing-errors'}; - # Set the "last-processed-by" flag so we can clear the + if (not exists($group_data->{'last-error-by'}) + or $group_data->{'last-error-by'} ne $LINTIAN_VERSION) { + # If it is a new lintian version then (re)set the counter + # to 1. Case also triggers for the very first issue. + $group_data->{'processing-errors'} = 1; + } else { + # Repeated error with the same version + ++$group_data->{'processing-errors'}; + } + # Set the "last-error-by" flag so we can clear the # error if there is a new version of lintian. $group_data->{'last-error-by'} = $LINTIAN_VERSION; } else { diff --git a/commands/reporting-sync-state.pm b/commands/reporting-sync-state.pm index 9e9cbce..80741ad 100644 --- a/commands/reporting-sync-state.pm +++ b/commands/reporting-sync-state.pm @@ -308,9 +308,10 @@ sub cleanup_group_state { or $group_data->{'last-error-by'} ne $OPT{'desired-version'}) ) { log_debug( - "Clearing error flag for ${group_id}: New version of lintian"); + "Clearing error-counter for ${group_id}: New version of lintian"); delete($group_data->{'processing-errors'}); - delete($group_data->{'last-error-by'}); + # Leave "last-error-by" as we can use that to tell if the previous + # version triggered errors. } if (not %{$members}) { diff --git a/lib/Lintian/Util.pm b/lib/Lintian/Util.pm index f2eafd0..4f4deeb 100644 --- a/lib/Lintian/Util.pm +++ b/lib/Lintian/Util.pm @@ -1725,8 +1725,12 @@ sub find_backlog { my $last_version = '0'; my $group_data = $state->{'groups'}{$group_id}; my $is_out_of_date; - if (exists($group_data->{'processing-errors'}) - and $group_data->{'processing-errors'} > 2) { + # Does this group repeatedly fail with the current version + # of lintian? + if ( exists($group_data->{'processing-errors'}) + and $group_data->{'processing-errors'} > 2 + and exists($group_data->{'last-error-by'}) + and $group_data->{'last-error-by'} ne $lintian_version) { # To avoid possible "starvation", we will give lower priority # to packages that repeatedly fail. They will be retried as # the backlog is cleared. diff --git a/reporting/templates/maintainer.tmpl b/reporting/templates/maintainer.tmpl index 3e58c5b..ee9cb3f 100644 --- a/reporting/templates/maintainer.tmpl +++ b/reporting/templates/maintainer.tmpl @@ -109,7 +109,7 @@ my $last_processed_by = $state->{'last-processed-by'} // 'N/A'; $status = '<i>outdated</i>' if (exists($state->{'out-of-date'})); $status = '<b class="processing-error">incomplete report; an error occurred during the last check</b>' - if exists($state->{'processing-errors'}) and $state->{'processing-errors'}; + if exists($state->{'last-error-by'}) and $state->{'last-error-by'}; $OUT .= qq( <div class="source-header">\n); $OUT .= qq( <h2 id="$pkg_info->{anchor}">); $OUT .= "$source ($version$component)"; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git