From e886a0c4a84a80272c02dc46f0a4858523e41862 Mon Sep 17 00:00:00 2001 From: sundargates Date: Mon, 6 Jan 2025 09:25:51 -0800 Subject: [PATCH 1/3] Removing myself from the codeowners (#739) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 47da1f9a0..c8f04389b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @calvin681 @sundargates @Andyz26 @hmitnflx @fdc-ntflx @dtrager02 +* @calvin681 @Andyz26 @hmitnflx @fdc-ntflx @dtrager02 From 320ddcb617ff3a27144628f838a3844d12cfb7c7 Mon Sep 17 00:00:00 2001 From: Andy Zhang <87735571+Andyz26@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:00:56 -0800 Subject: [PATCH 2/3] fix artifact update backcompat (#742) --- .../proto/JobClusterManagerProto.java | 6 ++++- .../master/jobcluster/JobClusterAkkaTest.java | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java index 5dda906d9..91bf59906 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java +++ b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java @@ -553,7 +553,11 @@ public UpdateJobClusterArtifactRequest( this.clusterName = clusterName; this.artifactName = artifact; - this.jobJarUrl = jobJarUrl != null ? jobJarUrl : "http://" + artifact; + // [Note] in the legacy setup this artifact field is used to host the job jar url field (it maps to the + // json property "url". + this.jobJarUrl = jobJarUrl != null ? + jobJarUrl : + (artifact.startsWith("http://") ? artifact : "http://" + artifact); this.version = version; this.skipSubmit = skipSubmit; this.user = user; diff --git a/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java b/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java index ae68d5d27..c04096a8f 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java +++ b/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java @@ -789,6 +789,30 @@ public void testJobClusterMigrationConfigUpdate() throws Exception { verify(jobStoreMock, times(1)).createJobCluster(any()); } + @Test + public void testJobClusterArtifactUpdateBackCompat() throws Exception { + String clusterName = "testJobClusterArtifactUpdateBackCompat"; + UpdateJobClusterArtifactRequest req = new UpdateJobClusterArtifactRequest( + clusterName, + "http://path1/artifact1-1.zip", + null, + "1", + true, + "user"); + assertEquals("http://path1/artifact1-1.zip", req.getArtifactName()); + assertEquals("http://path1/artifact1-1.zip", req.getjobJarUrl()); + + UpdateJobClusterArtifactRequest req2 = new UpdateJobClusterArtifactRequest( + clusterName, + "artifact1-1.zip", + null, + "1", + true, + "user"); + assertEquals("artifact1-1.zip", req2.getArtifactName()); + assertEquals("http://artifact1-1.zip", req2.getjobJarUrl()); + } + @Test public void testJobClusterArtifactUpdate() throws Exception { TestKit probe = new TestKit(system); From 9ddcd1b5b903bc844aef181c2946162992d0fe29 Mon Sep 17 00:00:00 2001 From: Andy Zhang <87735571+Andyz26@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:27:28 -0800 Subject: [PATCH 3/3] fix https jar url (#743) --- .../jobcluster/proto/JobClusterManagerProto.java | 2 +- .../mantisrx/master/jobcluster/JobClusterAkkaTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java index 91bf59906..6612b9c79 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java +++ b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java @@ -557,7 +557,7 @@ public UpdateJobClusterArtifactRequest( // json property "url". this.jobJarUrl = jobJarUrl != null ? jobJarUrl : - (artifact.startsWith("http://") ? artifact : "http://" + artifact); + (artifact.startsWith("http://") || artifact.startsWith("https://") ? artifact : "http://" + artifact); this.version = version; this.skipSubmit = skipSubmit; this.user = user; diff --git a/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java b/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java index c04096a8f..f9dad2467 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java +++ b/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java @@ -811,6 +811,16 @@ public void testJobClusterArtifactUpdateBackCompat() throws Exception { "user"); assertEquals("artifact1-1.zip", req2.getArtifactName()); assertEquals("http://artifact1-1.zip", req2.getjobJarUrl()); + + UpdateJobClusterArtifactRequest req3 = new UpdateJobClusterArtifactRequest( + clusterName, + "https://path1/artifact1-1.zip", + null, + "1", + true, + "user"); + assertEquals("https://path1/artifact1-1.zip", req3.getArtifactName()); + assertEquals("https://path1/artifact1-1.zip", req3.getjobJarUrl()); } @Test