You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2023/01/19 21:37:43 UTC

[solr] branch branch_9x updated: SOLR-14336 Warn users running old version of Solr (#1297)

This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new e9c64c9d517 SOLR-14336 Warn users running old version of Solr (#1297)
e9c64c9d517 is described below

commit e9c64c9d517504b118c507994a9e466fb1436066
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Thu Jan 19 22:36:38 2023 +0100

    SOLR-14336 Warn users running old version of Solr (#1297)
---
 solr/CHANGES.txt                                | 2 ++
 solr/webapp/web/js/angular/controllers/index.js | 7 +++++++
 solr/webapp/web/partials/index.html             | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 01f7ba9c0b2..d6b8c6f27bc 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -196,6 +196,8 @@ Other Changes
 
 * SOLR-16534: Jaegertracer-Configurator is now deprecated. From v10.0 we'll only support OpenTelemetry (janhoy)
 
+* SOLR-14336: Warning about potentially old Solr version in Admin UI dashboard (janhoy)
+
 * SOLR-13243: Correct the initial capacity of the ZK operations to run in ShardLeaderElectionContextBase#runLeaderProcess (Haythem Khiri)
 
 * SOLR-16544: Improve documentation on how to contribute to Solr (Justin Sweeney)
diff --git a/solr/webapp/web/js/angular/controllers/index.js b/solr/webapp/web/js/angular/controllers/index.js
index e931d59e1eb..68803bcf2ea 100644
--- a/solr/webapp/web/js/angular/controllers/index.js
+++ b/solr/webapp/web/js/angular/controllers/index.js
@@ -20,6 +20,8 @@ solrAdminApp.controller('IndexController', function($scope, System, Cores, Const
   $scope.reload = function() {
     System.get(function(data) {
       $scope.system = data;
+      const releaseDate = parse_release_date($scope.system.lucene['solr-impl-version'])
+      $scope.releaseDaysOld = (new Date() - releaseDate)/1000/60/60/24;
 
       if ("username" in data.security) {
         // Needed for Kerberos, since this is the only place from where
@@ -84,6 +86,11 @@ var parse_memory_value = function( value ) {
   return value;
 };
 
+const parse_release_date = function(value) {
+  const match = value.match( /.* (20\d\d-[0-1]\d-[0-3]\d) .*/ );
+  return match === null ? new Date() : new Date(match[1]);
+};
+
 var pretty_print_bytes = function(byte_value) {
   var unit = null;
 
diff --git a/solr/webapp/web/partials/index.html b/solr/webapp/web/partials/index.html
index 5f77bffae38..3fe47efa64a 100644
--- a/solr/webapp/web/partials/index.html
+++ b/solr/webapp/web/partials/index.html
@@ -97,6 +97,9 @@ limitations under the License.
 
           </div>
 
+          <div class="content" ng-show="releaseDaysOld > 365">
+            <p class="warning-msg"><img src="img/ico/exclamation-button.png"/>&nbsp;WARNING: This Solr release is more than a year old. Consider upgrading.</p>
+          </div>
       </div>
 
     </div>