r68871 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68870‎ | r68871 | r68872 >
Date:07:23, 2 July 2010
Author:reedy
Status:ok (Comments)
Tags:schema 
Comment:
bug 24219 - Add "old" review status (to CodeReview extension)

Reviewed by MaxSem on IRC
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/archives/codereview-cr_old_status.sql (added) (history)
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)
  • /trunk/extensions/CodeReview/codereview.css (modified) (history)
  • /trunk/extensions/CodeReview/codereview.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -89,6 +89,7 @@
9090 'code-status-ok' => 'ok',
9191 'code-status-verified' => 'verified',
9292 'code-status-deferred' => 'deferred',
 93+ 'code-status-old' => 'old',
9394 'code-pathsearch-legend' => 'Search revisions in this repo by path',
9495 'code-pathsearch-path' => 'Path:',
9596 'code-pathsearch-filter' => 'Filter applied:',
Index: trunk/extensions/CodeReview/CodeReview.php
@@ -167,13 +167,19 @@
168168 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCodeReviewSchemaUpdates';
169169
170170 function efCodeReviewSchemaUpdates() {
171 - global $wgDBtype, $wgExtNewFields, $wgExtPGNewFields, $wgExtNewIndexes, $wgExtNewTables;
 171+ global $wgDBtype, $wgExtNewFields, $wgExtPGNewFields, $wgExtNewIndexes, $wgExtNewTables, $wgExtModifiedFields;
172172 $base = dirname( __FILE__ );
173173 if ( $wgDBtype == 'mysql' ) {
174174 $wgExtNewTables[] = array( 'code_rev', "$base/codereview.sql" ); // Initial install tables
175175 $wgExtNewFields[] = array( 'code_rev', 'cr_diff', "$base/archives/codereview-cr_diff.sql" );
176176 $wgExtNewIndexes[] = array( 'code_relations', 'repo_to_from', "$base/archives/code_relations_index.sql" );
 177+
177178 // $wgExtNewFields[] = array( 'code_rev', "$base/archives/codereview-cr_status.sql" ); // FIXME FIXME this is a change to options... don't know how
 179+
 180+ if ( !update_row_exists( 'add old to code_rev enum' ) ) {
 181+ $wgExtModifiedFields[] = array( 'code_rev', 'cr_status', "$base/archives/codereview-cr_old_status.sql" );
 182+ }
 183+
178184 $wgExtNewTables[] = array( 'code_bugs', "$base/archives/code_bugs.sql" );
179185 $wgExtNewTables[] = array( 'code_test_suite', "$base/archives/codereview-code_tests.sql" );
180186 } elseif ( $wgDBtype == 'sqlite' ) {
Index: trunk/extensions/CodeReview/codereview.css
@@ -42,7 +42,6 @@
4343 padding-left: 48px;
4444 }
4545
46 -
4746 .mw-codereview-status-new td {
4847 background: #ffffc0 !important;
4948 }
@@ -81,6 +80,10 @@
8281 color: #666;
8382 }
8483
 84+.mw-codereview-status-old td {
 85+ color: #666;
 86+}
 87+
8588 .mw-codereview-success {
8689 color: #1a2;
8790 }
Index: trunk/extensions/CodeReview/archives/codereview-cr_old_status.sql
@@ -0,0 +1,6 @@
 2+ALTER TABLE /*$wgDBprefix*/code_rev
 3+ CHANGE `cr_status` `cr_status`
 4+ ENUM( 'new', 'fixme', 'reverted', 'resolved', 'ok', 'verified', 'deferred', 'old' )
 5+ NOT NULL DEFAULT 'new';
 6+
 7+INSERT INTO /*$wgDBprefix*/updatelog( ul_key ) VALUES( 'add old to code_rev enum' );
\ No newline at end of file
Property changes on: trunk/extensions/CodeReview/archives/codereview-cr_old_status.sql
___________________________________________________________________
Name: svn:eol-style
18 + native
Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -128,7 +128,7 @@
129129 }
130130
131131 public static function getPossibleStates() {
132 - return array( 'new', 'fixme', 'reverted', 'resolved', 'ok', 'verified', 'deferred' );
 132+ return array( 'new', 'fixme', 'reverted', 'resolved', 'ok', 'verified', 'deferred', 'old' );
133133 }
134134
135135 public function isValidStatus( $status ) {
Index: trunk/extensions/CodeReview/codereview.sql
@@ -53,7 +53,8 @@
5454 -- 'ok': Reviewed, no issues spotted
5555 -- 'verified': Reviewed and tested, no issues spotted
5656 -- 'deferred': Not reviewed at this time (usually non-Wikimedia extension)
57 - cr_status enum('new', 'fixme', 'reverted', 'resolved', 'ok', 'verified', 'deferred') not null default 'new',
 57+ -- 'old': Predates the extension/doesn't require review
 58+ cr_status enum('new', 'fixme', 'reverted', 'resolved', 'ok', 'verified', 'deferred', 'old') not null default 'new',
5859
5960 -- Base path of this revision :
6061 -- * if the revision change only one file, the file path

Comments

#Comment by Aaron Schulz (talk | contribs)   20:22, 17 July 2010

enumerations suck :p

#Comment by Platonides (talk | contribs)   21:09, 17 July 2010

A script to change them in small transactions is also needed.

#Comment by Reedy (talk | contribs)   21:14, 17 July 2010

You mean a maintenance script? Or something onwiki?

To say from "rev x to rev y, mark as old" ?

#Comment by Aaron Schulz (talk | contribs)   21:15, 17 July 2010

It probably can just be run straight up, not too many rows.

#Comment by Catrope (talk | contribs)   21:17, 17 July 2010

php maintenance/runBatchedQuery.php --wiki=mediawikiwiki "UPDATE code_rev SET cr_status='old' WHERE cr_rev_id < X"

#Comment by Catrope (talk | contribs)   21:17, 17 July 2010

Ah, with a LIMIT 500 of course :)

#Comment by Platonides (talk | contribs)   21:53, 17 July 2010

Oh, I didn't know about runBatchedQuery.php It of course fixes it... with the LIMIT clause :)

#Comment by Reedy (talk | contribs)   17:45, 18 July 2010
php maintenance/runBatchedQuery.php --wiki=mediawikiwiki "UPDATE code_rev SET cr_status='old' WHERE cr_rev_id < X AND cr_status='new'"

There is at least 1 revision I know that has been marked fixme as an old revision, and there might be some others that have been marked as ok/other stuff. So I suppose we'll want to only do it where it's still new =)

#Comment by Bryan (talk | contribs)   07:41, 8 February 2011

The schema change and the maintenance script have been run ages ago; removing scraptrap

Status & tagging log