Skip to content

Commit

Permalink
Bug 1946805 - Count is not being incremented properly when excluding …
Browse files Browse the repository at this point in the history
…bugs from the full list and therefore the export script is hanging
  • Loading branch information
dklawren authored Feb 7, 2025
1 parent fb13bf0 commit 7713ff6
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions extensions/BMO/bin/export_bmo_etl.pl
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ sub process_bugs {

if (any { $obj->product eq $_ } EXCLUDE_PRODUCTS) {
$excluded_bugs{$obj->id} = 1;
$count++;
next;
}

Expand Down Expand Up @@ -262,7 +263,10 @@ sub process_attachments {

my $obj = Bugzilla::Attachment->new($id);

next if $excluded_bugs{$obj->bug_id};
if ($excluded_bugs{$obj->bug_id}) {
$count++;
next;
}

# Standard non-sensitive fields
$data = {
Expand Down Expand Up @@ -323,7 +327,10 @@ sub process_flags {

my $obj = Bugzilla::Flag->new($id);

next if $excluded_bugs{$obj->bug_id};
if ($excluded_bugs{$obj->bug_id}) {
$count++;
next;
}

$data = {
attachment_id => $obj->attach_id || undef,
Expand Down Expand Up @@ -389,7 +396,10 @@ sub process_flag_state_activity {

my $obj = Bugzilla::Extension::Review::FlagStateActivity->new($id);

next if $excluded_bugs{$obj->bug_id};
if ($excluded_bugs{$obj->bug_id}) {
$count++;
next;
}

$data = {
attachment_id => $obj->attachment_id || undef,
Expand Down Expand Up @@ -446,7 +456,10 @@ sub process_tracking_flags {
$sth->execute(API_BLOCK_COUNT, $last_offset);

while (my ($name, $bug_id, $value) = $sth->fetchrow_array()) {
next if $excluded_bugs{$bug_id};
if ($excluded_bugs{$bug_id}) {
$count++;
next;
}

# Standard fields
my $data = {bug_id => $bug_id};
Expand Down Expand Up @@ -495,7 +508,10 @@ sub process_keywords {
$sth->execute(API_BLOCK_COUNT, $last_offset);

while (my ($bug_id, $keyword) = $sth->fetchrow_array()) {
next if $excluded_bugs{$bug_id};
if ($excluded_bugs{$bug_id}) {
$count++;
next;
}

# Standard fields
my $data = {bug_id => $bug_id};
Expand Down Expand Up @@ -534,7 +550,10 @@ sub process_see_also {
$sth->execute(API_BLOCK_COUNT, $last_offset);

while (my ($bug_id, $value, $class) = $sth->fetchrow_array()) {
next if $excluded_bugs{$bug_id};
if ($excluded_bugs{$bug_id}) {
$count++;
next;
}

# Standard fields
my $data = {bug_id => $bug_id,};
Expand Down Expand Up @@ -643,7 +662,10 @@ sub process_two_columns {
$sth->execute(API_BLOCK_COUNT, $last_offset);

while (my ($value1, $value2) = $sth->fetchrow_array()) {
next if $excluded_bugs{$value1};
if ($excluded_bugs{$value1}) {
$count++;
next;
}

print "Processing values $value1, $value2 for $table_name.\n" if $verbose;

Expand Down

0 comments on commit 7713ff6

Please sign in to comment.