jenkins-bot has submitted this change and it was merged.

Change subject: Store and show scores when rc_type == RC_NEW
......................................................................


Store and show scores when rc_type == RC_NEW

cuz why not?

Change-Id: I2f1cdca0fadcbf8d0deaefcaefd4efc15c9cbf76
---
M includes/Hooks.php
M maintenance/PopulateDatabase.php
2 files changed, 10 insertions(+), 7 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Hooks.php b/includes/Hooks.php
index 087f01d..f4bc1c4 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -41,8 +41,8 @@
                if ( $rc->getAttribute( 'rc_bot' ) && $wgOresExcludeBots ) {
                        return true;
                }
-
-               if ( $rc->getAttribute( 'rc_type' ) === RC_EDIT ) {
+               $rc_type = $rc->getAttribute( 'rc_type' );
+               if ( $rc_type === RC_EDIT || $rc_type === RC_NEW ) {
                        $revid = $rc->getAttribute( 'rc_this_oldid' );
                        $logger = LoggerFactory::getInstance( 'ORES' );
                        $logger->debug( 'Processing edit {revid}', [
@@ -107,15 +107,18 @@
                $tables[] = 'ores_model';
 
                $fields[] = 'oresc_probability';
+               // Add user-based threshold
+               $fields[] = $threshold . ' AS ores_threshold';
+
+               $conds[] = '(oresm_name = ' . \wfGetDB( DB_SLAVE )->addQuotes( 
'damaging' ) .
+                       ' OR oresm_name IS NULL)';
+
                $join_conds['ores_classification'] = [ 'LEFT JOIN',
                        'rc_this_oldid = oresc_rev ' .
                        'AND oresc_is_predicted = 1 AND oresc_class = 1' ];
 
-               // Add user-based threshold
-               $fields[] = $threshold . ' AS ores_threshold';
-
                $join_conds['ores_model'] = [ 'LEFT JOIN',
-                       'oresc_model = oresm_id AND oresm_name = \'damaging\' ' 
.
+                       'oresc_model = oresm_id ' .
                        'AND oresm_is_current = 1'
                ];
 
diff --git a/maintenance/PopulateDatabase.php b/maintenance/PopulateDatabase.php
index b4fc512..6bfb718 100644
--- a/maintenance/PopulateDatabase.php
+++ b/maintenance/PopulateDatabase.php
@@ -50,7 +50,7 @@
                $count = 0;
                while ( $count < $this->revisionLimit ) {
 
-                       $conditions = [ 'oresc_id IS NULL', 'rc_type' => 0 ];
+                       $conditions = [ 'oresc_id IS NULL', 'rc_type' => [ 
RC_EDIT, RC_NEW ] ];
                        if ( $wgOresExcludeBots === true ) {
                                $conditions['rc_bot'] = 0;
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/273995
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f1cdca0fadcbf8d0deaefcaefd4efc15c9cbf76
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to