svn update and file validator

Posts from previous Beta sessions

svn update and file validator

Postby ScratchMonkey » Sun Mar 09, 2008 8:24 pm

I just updated my roster to 1725 after a long hiatus and ran the diag web page, and see a lot of red. Looking at the details, it looks like the files causing the problem are much later than the baseline being used to compare. Is the baseline version drawn from a local file that doesn't get updated before a commit?

Example:

Code: Select all
footer.php   1666 > 1662    2008/02/01 06:25 < 2008/02/01 21:37    Zanix != pleegwat    MD5 String does NOT match    
settings.php   1720 > 1655    2008/03/05 03:20 > 2008/02/01 05:54    Zanix    MD5 String does NOT match    
motd.php   1722 > 1651    2008/03/07 01:44 > 2008/02/01 22:31    Zanix    MD5 String does NOT match    
realmstatus.php   1720 > 1651    2008/03/05 03:20 > 2008/02/01 22:31    Zanix    MD5 String does NOT match    
install.php   1720 > 1651    2008/03/05 03:20 > 2008/02/01 22:31    Zanix    MD5 String does NOT match    
index.php   1720 > 1651    2008/03/05 03:20 > 2008/02/01 22:31    Zanix    MD5 String does NOT match    
license.txt   1695 > 1251    2008/02/01 06:10 > 2007/08/01 16:28    Zanix    MD5 String does NOT match    
img.php   1720 > 1651    2008/03/05 03:20 > 2008/02/01 22:31    Zanix    MD5 String does NOT match
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

svn update and file validator

Postby PleegWat » Sun Mar 09, 2008 11:33 pm

No, it's comparing to a file on the wowroster.net server.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

svn update and file validator

Postby ScratchMonkey » Mon Mar 10, 2008 1:33 am

Perhaps the color and wording might be different. Blue and "newer" instead of red and "critical", for example. I realize it's just cosmetic. My only concern is that it makes it harder to see if any files really are out of date. OTOH, I use the subversion command line for the authoritative info, and consider the diag page to be for dev use.
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

svn update and file validator

Postby PleegWat » Mon Mar 10, 2008 3:27 am

Diag is mainly diagnostic for support. I have myself also looked at changing the rosterdiag code to a different color usage, but I couldn't wrap my head around how rosterdiag works.

It was made my Mathos, who is no longer active.

If you manage to improve this, feel free to submit a patch.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

svn update and file validator

Postby zanix » Mon Mar 10, 2008 5:34 am

I have also thought about changing RosterDiag a bit as well, but like PleegWat said...
PleegWat wrote:It was made my Mathos, who is no longer active.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

svn update and file validator

Postby ScratchMonkey » Mon Mar 10, 2008 11:48 pm

I'll have a look. My day job is figuring out undocumented software, sometimes in alien languages. ;)
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

Re: svn update and file validator

Postby phoflame » Tue Mar 11, 2008 12:32 am

Changing RosterDiag colors is actually really easy, you can also easily alter or add severity levels and rollup categories.

The only file that needs to be altered is rosterdiag.lib.php

Original Code:

Code: Select all
// Set the severity information
$problemsev['description'] = 6;
$problemsev['revisiongreater'] = 6;
$problemsev['revisionsmaller'] = 6;
$problemsev['dateolder'] = 6;
$problemsev['dateyounger'] = 6;
$problemsev['author'] = 5;
$problemsev['MD5'] = 0;
$problemsev['MD5binary'] = 4;
$problemsev['nosvn'] = 1;
$problemsev['nolocal'] = 6;
$problemsev['unknown'] = 2;

$severity[0] = array('style' => 'sgreen',  'color' => '#12C312', 'weight' => 0,  'severityname' => 'No Issues');
$severity[1] = array('style' => 'sgray',   'color' => '#AFAFAF', 'weight' => 0,  'severityname' => 'Unknown');
$severity[2] = array('style' => 'sblue',   'color' => '#312CF8', 'weight' => 1,  'severityname' => 'Initial');
$severity[3] = array('style' => 'spurple', 'color' => '#E920CF', 'weight' => 1,  'severityname' => 'Strange');
$severity[4] = array('style' => 'syellow', 'color' => '#F1B10E', 'weight' => 3,  'severityname' => 'Minor');
$severity[5] = array('style' => 'sorange', 'color' => '#EE870D', 'weight' => 7,  'severityname' => 'Major');
$severity[6] = array('style' => 'sred',    'color' => '#FF0000', 'weight' => 15, 'severityname' => 'Critical');

$rollups[] = array('rollup' => 2,  'severity' => 4);
$rollups[] = array('rollup' => 5,  'severity' => 5);
$rollups[] = array('rollup' => 14, 'severity' => 6);


This is the code that defines the severity of issues detected and contains the arrays that define the colors and titles to be assigned for those severities. The $rollups define the break off points at which to change the color of a file name in the list.

The way is which the severity to use is determined is pretty simple too. When one of the issues defined in $problemsev is encountered it look up the weight of the severity as defined in $severity. The color and severity assigned to a file is then based off of a running total of the weights for each of the issues encountered for that file, and where that total lands in the $rollups array. The Directory color and severity is based similarly on the running total of of the weighted values of severity levels of all files in the directory.

If you feel that having a newer file is not a problem, but you would like to be notified which files are newer than the SVN you can make the following change:

Code: Select all
// Set the severity information
$problemsev['description'] = 7;
$problemsev['revisiongreater'] = 1;
$problemsev['revisionsmaller'] = 7;
$problemsev['dateolder'] = 7;
$problemsev['dateyounger'] = 1;
$problemsev['author'] = 6;
$problemsev['MD5'] = 0;
$problemsev['MD5binary'] = 5;
$problemsev['nosvn'] = 2;
$problemsev['nolocal'] = 7;
$problemsev['unknown'] = 2;

$severity[0] = array('style' => 'sgreen',  'color' => '#12C312', 'weight' => 0,  'severityname' => 'No Issues');
$severity[1] = array('style' => 'sblue',   'color' => '#312CF8', 'weight' => 1,  'severityname' => 'Newer Files');
$severity[2] = array('style' => 'sgray',   'color' => '#AFAFAF', 'weight' => 0,  'severityname' => 'Unknown');
$severity[3] = array('style' => 'sblue',   'color' => '#312CF8', 'weight' => 6,  'severityname' => 'Initial');
$severity[4] = array('style' => 'spurple', 'color' => '#E920CF', 'weight' => 6,  'severityname' => 'Strange');
$severity[5] = array('style' => 'syellow', 'color' => '#F1B10E', 'weight' => 15,  'severityname' => 'Minor');
$severity[6] = array('style' => 'sorange', 'color' => '#EE870D', 'weight' => 30,  'severityname' => 'Major');
$severity[7] = array('style' => 'sred',    'color' => '#FF0000', 'weight' => 60, 'severityname' => 'Critical');


$rollups[] = array('rollup' => 1,  'severity' => 1);
$rollups[] = array('rollup' => 14,  'severity' => 5);
$rollups[] = array('rollup' => 29,  'severity' => 6);
$rollups[] = array('rollup' => 59, 'severity' => 7);


Granted, with how the rating system works if you have more than 14 newer files in the same directory it will get flagged as a minor issue.

You can also add valid.inc to:

Code: Select all
// Files to ignore
$ignored_files = array('conf.php','.htaccess');


Doing so will keep its absence from flagging as a critical issue.
Last edited by phoflame on Tue Mar 11, 2008 12:56 am, edited 6 times in total.
phoflame
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Thu Mar 01, 2007 9:26 pm

svn update and file validator

Postby zanix » Tue Mar 11, 2008 9:58 am

Good modification
Will be implemented svn[1730]
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: svn update and file validator

Postby phoflame » Thu Mar 13, 2008 6:53 am

So I was not happy with just the changes I made. With the edits I made above new files are not properly handled, and having more than 14 in the same directory would start flagging as issues (Minor at 15, Major 30. and Critical at 60).

Issues detected that totaled less than 15 on the weighted scale would also get flagged as a Newer File, even if this was not.

I also did not like how the reporting and handling of files not on the SVN but present locally, or vise versus was handled.

The $ignored_files array denotes files that you do not want it to scan on the local side, but does nothing to keep it from looking at the SVN version, causing a critical flag.

I have made modifications to the three files that make up the RosterDiag system. I have made the following changes:

Improved the display and handling of files on the local install that are newer than the svn.

Improved the display and handling of files that are present locally, but not on the SVN, and vise versus.

Made the tables for "Basic Server Info", "PHP Settings", "Config Values", "GD Settings", and "List of Tables" collapsible, and collapsed by default, to improve display and reduce overall clutter.


No changes have been made to the way the RosterDiag does what it does, I just refined how it displays the information to you. I reverted the severity scoring system back to the original, but removed the newfile severity from providing any weight to the tally. Instead Newfiles, nosvn, and nolocal are now special cases with no severity weight. severities with weights will always take precedence over them when it comes to what condition to display for a file and a directory.

I would like to submit the revised files for you review as a patch, but I am not sure how to go about doing so.
Last edited by phoflame on Thu Mar 13, 2008 7:03 am, edited 2 times in total.
phoflame
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Thu Mar 01, 2007 9:26 pm

svn update and file validator

Postby zanix » Thu Mar 13, 2008 10:40 am

Just submit all changed files
That would be the easiest way
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

svn update and file validator

Postby phoflame » Fri Mar 14, 2008 11:42 am

Okies, let me finish documenting all the changes I made in each file and I will zip them up and get them to you. May not happen until the weekend due to do finals preparation but I will get them to you.
phoflame
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Thu Mar 01, 2007 9:26 pm

svn update and file validator

Postby zanix » Sat Mar 15, 2008 1:51 am

Thanks, I'm sure all of us appreciate it
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

svn update and file validator

Postby zanix » Sun Mar 30, 2008 4:46 pm

File received from phoflame will be implemented in svn[1741]
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron