Closed
Bug 277571
Opened 21 years ago
Closed 21 years ago
checksetup should not always output a message about checking for flags
Categories
(Bugzilla :: Installation & Upgrading, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: mkanat, Assigned: mkanat)
Details
Attachments
(1 file, 1 obsolete file)
1.17 KB,
patch
|
goobix
:
review+
|
Details | Diff | Splinter Review |
checksetup always outputs a message that it's checking for bad flag names. It
should only do that if it actually has to update the flags.
Assignee | ||
Comment 1•21 years ago
|
||
OK, here's a very simple fix that only outputs a message if we actually *do*
something.
Attachment #170678 -
Flags: review?
Comment 2•21 years ago
|
||
Comment on attachment 170678 [details] [diff] [review]
Move the flags message to the inside of the if block
- print "... done.\n";
+ print "... done.\n" unless $silent;
That's wrong. That's the kind of text that should appear to the admin if
checksetup.pl is a cron job. That block of code executes when the need to
update flags exists. The admin would want to know the result of the operation
(if the operation was "done" or not) no matter if the script is ran as silent
or not.
Attachment #170678 -
Flags: review? → review-
Updated•21 years ago
|
Status: NEW → ASSIGNED
Flags: blocking2.20?
Flags: blocking2.18?
Flags: blocking2.18.1?
Target Milestone: --- → Bugzilla 2.18
Assignee | ||
Comment 3•21 years ago
|
||
OK, vladd and I talked in IRC.
The conclusion is that $silent should be assumed to be used by people who are
running a cron job, so they want to see output if checksetup changes anything.
Attachment #170678 -
Attachment is obsolete: true
Attachment #170688 -
Flags: review?
Comment 4•21 years ago
|
||
Comment on attachment 170688 [details] [diff] [review]
Version 2
It's a pitty to remove the strings from CVS since they would really be suitable
if we had a "debug" mode.
However, for now, this seems like the right thing.
Attachment #170688 -
Flags: review? → review+
Updated•21 years ago
|
Flags: approval?
Flags: approval2.18?
Comment 5•21 years ago
|
||
How about this:
We have a recent change to fix the emailprefs for users that don't have them.
The initial test this makes to find out if it has to do anything is very quick
and painless. It also was introduced after the restrictions on flag names were
changed, so we can guarantee that any installation running the emailprefs fixup
code also needs to flags fixup code (except for those who updated from CVS
between the two patches, but it won't hurt anything for them to run it one more
time, since currently we're doing it every time anyway).
So how about if we stick the entire test for flag correctness (since it seems to
take longer than emailprefs to test whether or not it has to do anything) inside
the block that does all the emailprefs corrections? Then leave the text about
"I'm testing for bad flag names" in the output. It gets done once, and they
never see it again.
We've pulled this trick previously on these kinds of data manipulation tests,
where something went into checksetup.pl unconditionally, then the next time we
had a schema change, we tied it to it so that it wouldn't keep running every time.
Flags: blocking2.18.1?
Flags: approval?
Flags: approval2.18?
Updated•21 years ago
|
Flags: blocking2.18.1?
Flags: approval?
Whiteboard: patch awaiting approval
Comment 6•21 years ago
|
||
OK, discussed this with Max on IRC, and we discovered the reason the flagtype
check is taking so long is it pulls the entire flag list out of the database and
iterates over it in Perl to check for invalid characters. It should be possible
to test for the invalid flagtypes directly in the initial SQL statement,
reducing the amount of data going back and forth from the database. Max is
filing another bug for that part, and this patch is good as-is, since making it
speedier will get rid of the need to only run it once. There's about 90 or so
flagtypes defined on b.m.o, and it took a noticible amount of time to run that
part, which is why I was complaining about it running every time. It does
confuse me *why* it took a noticible amount of time, since it shouldn't in
theory take that long to do a simple iteration through 90 items with a regexp in
perl, but it did. Both queries (pulling everything, and only pulling the broken
ones) appear to take the same amount of time from a profiling perspective on the
database end, but the query to pull only the broken ones returns faster when
there aren't any (because there's no data to transfer).
Flags: blocking2.20?
Flags: blocking2.20+
Flags: blocking2.18?
Flags: blocking2.18.1?
Flags: blocking2.18+
Flags: approval?
Flags: approval2.18+
Flags: approval+
Whiteboard: patch awaiting approval → patch awaiting checkin
Comment 7•21 years ago
|
||
(In reply to comment #6)
> It should be possible to test for the invalid flagtypes directly in the initial
> SQL statement, reducing the amount of data going back and forth from the
> database. Max is filing another bug for that part, and this patch is good
For the record: this is bug 277723.
Comment 8•21 years ago
|
||
(In reply to comment #5)
> So how about if we stick the entire test for flag correctness (since it seems to
> take longer than emailprefs to test whether or not it has to do anything)
I'm surprised that it takes very long at all. How long does it take? What's
the database like? In my test database with ten thousand flag types, it takes
less than one second (on my antique desktop machine). See the discussion on bug
277723. It's possible that I'm not testing it properly. Is it possible that
you're mistaken about what's taking so long?
I'm quite happy to add a SQL test checking whether there are any bad flagtype
names (although without an index on flagtypes.name it's not clear whether this
would be much faster). But see bug 277723 for reasons to be careful with this.
Comment 9•21 years ago
|
||
2.18
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl
new revision: 1.289.2.21; previous revision: 1.289.2.20
done
Tip:
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl
new revision: 1.324; previous revision: 1.323
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Whiteboard: patch awaiting checkin
Updated•13 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•