You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/12/10 08:21:07 UTC

[skywalking] branch master updated: Fix group name can't be queried when it is null. (#5986)

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

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ff7766  Fix group name can't be queried when it is null. (#5986)
8ff7766 is described below

commit 8ff77667b722909d1305fd04dcd564286e864a06
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Dec 10 16:20:50 2020 +0800

    Fix group name can't be queried when it is null. (#5986)
---
 CHANGES.md                                                     |  3 ++-
 .../skywalking/oap/server/core/query/MetadataQueryService.java | 10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index a06f660..b38bac2 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -18,7 +18,8 @@ Release Notes.
 * Support influxDB connection response format option. Fix some error when use JSON as influxDB response format.
 * Support Kafka MirrorMaker 2.0 to replicate topics between Kafka clusters.
 * Add the rule name field to alarm record storage entity as a part of ID, to support multiple alarm rules triggered for one entity. The scope id has been removed from the ID.
-* Fix MAL concurrent execution issues
+* Fix MAL concurrent execution issues.
+* Fix group name can't be query in the GraphQL.
 
 #### UI
 * Fix un-removed tags in trace query.
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
index 696dcb1..a5f1e8b 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
@@ -20,6 +20,8 @@ package org.apache.skywalking.oap.server.core.query;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.analysis.IDManager;
 import org.apache.skywalking.oap.server.core.query.type.Database;
 import org.apache.skywalking.oap.server.core.query.type.Endpoint;
@@ -47,7 +49,13 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
     }
 
     public List<Service> getAllServices(final String group) throws IOException {
-        return getMetadataQueryDAO().getAllServices(group);
+        return getMetadataQueryDAO().getAllServices(group).stream()
+                                    .map(service -> {
+                                        if (service.getGroup() == null) {
+                                            service.setGroup(Const.EMPTY_STRING);
+                                        }
+                                        return service;
+                                    }).collect(Collectors.toList());
     }
 
     public List<Service> getAllBrowserServices() throws IOException {