From 0313522d15c9e43488385d914fb01b7dba711793 Mon Sep 17 00:00:00 2001 From: Ming Yu Wang <90855268+mwangggg@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:09:55 -0400 Subject: [PATCH] chore(matchExpressions): rename target.isAgent match expression to target.agent to fit current nomenclature (#625) * rename isAgent match expression to agent * chore(schema): automatic update --------- Co-authored-by: Cryostat CI --- schema/schema.graphql | 1 - .../io/cryostat/expressions/MatchExpressionEvaluator.java | 4 ++-- src/main/java/io/cryostat/targets/Target.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/schema/schema.graphql b/schema/schema.graphql index a3b06cc12..1d074cf16 100644 --- a/schema/schema.graphql +++ b/schema/schema.graphql @@ -190,7 +190,6 @@ type RuntimeMetrics { type Target { activeRecordings(filter: ActiveRecordingsFilterInput): ActiveRecordings - agent: Boolean! alias: String! annotations: Annotations! archivedRecordings(filter: ArchivedRecordingsFilterInput): ArchivedRecordings diff --git a/src/main/java/io/cryostat/expressions/MatchExpressionEvaluator.java b/src/main/java/io/cryostat/expressions/MatchExpressionEvaluator.java index 563378c38..f1cfeb748 100644 --- a/src/main/java/io/cryostat/expressions/MatchExpressionEvaluator.java +++ b/src/main/java/io/cryostat/expressions/MatchExpressionEvaluator.java @@ -223,7 +223,7 @@ public static class ScriptCreation extends Event {} * expression-relevant fields exposed, connection URI exposed as a String, etc. */ private static record SimplifiedTarget( - boolean isAgent, + boolean agent, String connectUrl, String alias, @Nullable String jvmId, @@ -242,7 +242,7 @@ private static record SimplifiedTarget( static SimplifiedTarget from(Target target) { return new SimplifiedTarget( - target.isAgent(), + target.agent(), target.connectUrl.toString(), target.alias, target.jvmId, diff --git a/src/main/java/io/cryostat/targets/Target.java b/src/main/java/io/cryostat/targets/Target.java index f24f9af7c..8921cd329 100644 --- a/src/main/java/io/cryostat/targets/Target.java +++ b/src/main/java/io/cryostat/targets/Target.java @@ -113,7 +113,7 @@ public class Target extends PanacheEntity { public DiscoveryNode discoveryNode; @JsonProperty(access = JsonProperty.Access.READ_ONLY) - public boolean isAgent() { + public boolean agent() { return AgentConnection.isAgentConnection(connectUrl); }