You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by gi...@apache.org on 2026/09/12 09:10:07 UTC

(seatunnel) branch gh-readonly-queue/dev/pr-12270-6ee0c374478a7c8be090e3eb33895027c5ac2ffd created (now 56cfbca0fb)

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

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/dev/pr-12270-6ee0c374478a7c8be090e3eb33895027c5ac2ffd
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


      at 56cfbca0fb [Feature] [connector-http-linear] Add Linear HTTP Source Connector and Unit Test (#12270)

This branch includes the following new commits:

     new 56cfbca0fb [Feature] [connector-http-linear] Add Linear HTTP Source Connector and Unit Test (#12270)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(seatunnel) 01/01: [Feature] [connector-http-linear] Add Linear HTTP Source Connector and Unit Test (#12270)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/dev/pr-12270-6ee0c374478a7c8be090e3eb33895027c5ac2ffd
in repository https://gitbox.apache.org/repos/asf/seatunnel.git

commit 56cfbca0fb418a560d17992af91b6d15a1ff7e03
Author: Saloni Gupta <sg...@gmail.com>
AuthorDate: Sat Sep 12 09:09:41 2026 +0000

    [Feature] [connector-http-linear] Add Linear HTTP Source Connector and Unit Test (#12270)
---
 config/plugin_config                               |  1 +
 docs/en/connector-v2/source/Http-Linear.md         | 35 ++++++++++++++
 plugin-mapping.properties                          |  1 +
 .../{ => connector-http-linear}/pom.xml            | 34 +++++--------
 .../connectors/seatunnel/linear/LinearSource.java  | 56 ++++++++++++++++++++++
 .../seatunnel/linear/LinearSourceFactory.java      | 50 +++++++++++++++++++
 .../linear/config/LinearSourceOptions.java         | 27 +++++++++++
 .../linear/config/LinearSourceParameter.java       | 38 +++++++++++++++
 .../seatunnel/linear/LinearSourceFactoryTest.java  | 47 ++++++++++++++++++
 seatunnel-connectors-v2/connector-http/pom.xml     |  1 +
 seatunnel-dist/pom.xml                             |  6 +++
 11 files changed, 273 insertions(+), 23 deletions(-)

diff --git a/config/plugin_config b/config/plugin_config
index da470370cb..ee7d2ea427 100644
--- a/config/plugin_config
+++ b/config/plugin_config
@@ -71,6 +71,7 @@ connector-http-jira
 connector-http-klaviyo
 connector-http-stripe
 connector-http-lemlist
+connector-http-linear
 connector-http-myhours
 connector-http-notion
 connector-http-onesignal
diff --git a/docs/en/connector-v2/source/Http-Linear.md b/docs/en/connector-v2/source/Http-Linear.md
new file mode 100644
index 0000000000..4d6b240b2d
--- /dev/null
+++ b/docs/en/connector-v2/source/Http-Linear.md
@@ -0,0 +1,35 @@
+# Http-Linear
+
+> Http-Linear source connector
+
+## Description
+
+Read data from the Linear API via HTTP.
+
+## Key Features
+
+- [x] batch
+- [ ] stream
+- [ ] exactly-once
+
+## Options
+
+| Name | Type | Required | Default Value | Description |
+| --- | --- | --- | --- | --- |
+| url | String | Yes | - | Linear API Endpoint URL |
+| api_key | String | Yes | - | Linear API Key for Authentication |
+| plugin_output | String | No | - | The result table name when generating data |
+
+## Example
+
+```hocon
+source {
+  Http-Linear {
+    url = "https://api.linear.app/graphql"
+    api_key = "your_linear_api_key"
+    method = "POST"
+    body = "{\"query\": \"{ issues { nodes { id title } } }\"}"
+    plugin_output = "linear_data"
+  }
+}
+```
\ No newline at end of file
diff --git a/plugin-mapping.properties b/plugin-mapping.properties
index 97c64b60dd..c6c0b53912 100644
--- a/plugin-mapping.properties
+++ b/plugin-mapping.properties
@@ -190,6 +190,7 @@ seatunnel.sink.Fluss = connector-fluss
 seatunnel.sink.Lance = connector-lance
 seatunnel.sink.BigQuery = connector-bigquery
 seatunnel.sink.NatsJetStream = connector-nats-jetstream
+seatunnel.source.Linear = connector-http-linear
 
 # For custom transforms, make sure to use the seatunnel.transform.[PluginIdentifier]=[JarPerfix] naming convention. For example:
 # seatunnel.transform.Sql = seatunnel-transforms-v2
diff --git a/seatunnel-connectors-v2/connector-http/pom.xml b/seatunnel-connectors-v2/connector-http/connector-http-linear/pom.xml
similarity index 54%
copy from seatunnel-connectors-v2/connector-http/pom.xml
copy to seatunnel-connectors-v2/connector-http/connector-http-linear/pom.xml
index d45f5c4294..80ad6f9e28 100644
--- a/seatunnel-connectors-v2/connector-http/pom.xml
+++ b/seatunnel-connectors-v2/connector-http/connector-http-linear/pom.xml
@@ -22,31 +22,19 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.seatunnel</groupId>
-        <artifactId>seatunnel-connectors-v2</artifactId>
+        <artifactId>connector-http</artifactId>
         <version>${revision}</version>
     </parent>
-    <artifactId>connector-http</artifactId>
-    <packaging>pom</packaging>
-    <name>SeaTunnel : Connectors V2 : Http :</name>
 
-    <modules>
-        <module>connector-http-base</module>
-        <module>connector-http-feishu</module>
-        <module>connector-http-wechat</module>
-        <module>connector-http-myhours</module>
-        <module>connector-http-lemlist</module>
-        <module>connector-http-klaviyo</module>
-        <module>connector-http-onesignal</module>
-        <module>connector-http-jira</module>
-        <module>connector-http-gitlab</module>
-        <module>connector-http-github</module>
-        <module>connector-http-notion</module>
-        <module>connector-http-persistiq</module>
-        <module>connector-http-airtable</module>
-        <module>connector-http-posthog</module>
-        <module>connector-http-shopify</module>
-        <module>connector-http-zendesk</module>
-        <module>connector-http-stripe</module>
-    </modules>
+    <artifactId>connector-http-linear</artifactId>
+    <name>SeaTunnel : Connectors V2 : Http : Linear</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>connector-http-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
 
 </project>
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSource.java b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSource.java
new file mode 100644
index 0000000000..97a6844ee5
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSource.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.linear;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSource;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSourceReader;
+import org.apache.seatunnel.connectors.seatunnel.linear.config.LinearSourceOptions;
+import org.apache.seatunnel.connectors.seatunnel.linear.config.LinearSourceParameter;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class LinearSource extends HttpSource {
+    private final LinearSourceParameter linearSourceParameter = new LinearSourceParameter();
+
+    public LinearSource(ReadonlyConfig pluginConfig) {
+        super(pluginConfig);
+        String apiKey = pluginConfig.get(LinearSourceOptions.API_KEY);
+        linearSourceParameter.buildWithConfig(pluginConfig, apiKey);
+    }
+
+    @Override
+    public String getPluginName() {
+        return "linear";
+    }
+
+    @Override
+    public AbstractSingleSplitReader<SeaTunnelRow> createReader(
+            SingleSplitReaderContext readerContext) throws Exception {
+        return new HttpSourceReader(
+                this.linearSourceParameter,
+                readerContext,
+                this.deserializationSchema,
+                jsonField,
+                contentField);
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSourceFactory.java b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSourceFactory.java
new file mode 100644
index 0000000000..1b966c6451
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSourceFactory.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.linear;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.table.connector.TableSource;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSourceFactoryContext;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSourceFactory;
+import org.apache.seatunnel.connectors.seatunnel.linear.config.LinearSourceOptions;
+
+import com.google.auto.service.AutoService;
+
+import java.io.Serializable;
+
+@AutoService(Factory.class)
+public class LinearSourceFactory extends HttpSourceFactory {
+    @Override
+    public String factoryIdentifier() {
+        return "Linear";
+    }
+
+    @Override
+    public <T, SplitT extends SourceSplit, StateT extends Serializable>
+            TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {
+        return () -> (SeaTunnelSource<T, SplitT, StateT>) new LinearSource(context.getOptions());
+    }
+
+    @Override
+    public OptionRule optionRule() {
+        return getHttpBuilder().required(LinearSourceOptions.API_KEY).build();
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/config/LinearSourceOptions.java b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/config/LinearSourceOptions.java
new file mode 100644
index 0000000000..5aa3033c66
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/config/LinearSourceOptions.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.linear.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpCommonOptions;
+
+public class LinearSourceOptions extends HttpCommonOptions {
+    public static final Option<String> API_KEY =
+            Options.key("api_key").stringType().noDefaultValue().withDescription("Linear API Key");
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/config/LinearSourceParameter.java b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/config/LinearSourceParameter.java
new file mode 100644
index 0000000000..708fbbd1bd
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/main/java/org/apache/seatunnel/connectors/seatunnel/linear/config/LinearSourceParameter.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.linear.config;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter;
+
+import java.util.HashMap;
+
+public class LinearSourceParameter extends HttpParameter {
+    /**
+     * Overrides buildWithConfig to accept an explicit apiKey parameter. Linear's GraphQL API
+     * requires the API key to be passed specifically as an Authorization header, so this method
+     * ensures the key is properly extracted and configured
+     */
+    public void buildWithConfig(ReadonlyConfig pluginConfig, String apiKey) {
+        super.buildWithConfig(pluginConfig);
+        if (this.headers == null) {
+            this.headers = new HashMap<>();
+        }
+        this.headers.put("Authorization", apiKey);
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/connector-http-linear/src/test/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSourceFactoryTest.java b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/test/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSourceFactoryTest.java
new file mode 100644
index 0000000000..e3feb004a0
--- /dev/null
+++ b/seatunnel-connectors-v2/connector-http/connector-http-linear/src/test/java/org/apache/seatunnel/connectors/seatunnel/linear/LinearSourceFactoryTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.linear;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.connectors.seatunnel.linear.config.LinearSourceParameter;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.HashMap;
+
+public class LinearSourceFactoryTest {
+
+    @Test
+    public void testFactoryIdentifier() {
+        LinearSourceFactory factory = new LinearSourceFactory();
+        Assertions.assertEquals("Linear", factory.factoryIdentifier());
+    }
+
+    @Test
+    public void testHeadersInitializationWithoutExistingHeaders() {
+        ReadonlyConfig config = ReadonlyConfig.fromMap(new HashMap<>());
+        String apiKey = "test-linear-api-key";
+
+        LinearSourceParameter parameter = new LinearSourceParameter();
+        parameter.buildWithConfig(config, apiKey);
+
+        Assertions.assertNotNull(parameter.getHeaders());
+        Assertions.assertEquals(apiKey, parameter.getHeaders().get("Authorization"));
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/pom.xml b/seatunnel-connectors-v2/connector-http/pom.xml
index d45f5c4294..133cf63a74 100644
--- a/seatunnel-connectors-v2/connector-http/pom.xml
+++ b/seatunnel-connectors-v2/connector-http/pom.xml
@@ -47,6 +47,7 @@
         <module>connector-http-shopify</module>
         <module>connector-http-zendesk</module>
         <module>connector-http-stripe</module>
+        <module>connector-http-linear</module>
     </modules>
 
 </project>
diff --git a/seatunnel-dist/pom.xml b/seatunnel-dist/pom.xml
index 2e3f39d51e..eeaeb02cc0 100644
--- a/seatunnel-dist/pom.xml
+++ b/seatunnel-dist/pom.xml
@@ -308,6 +308,12 @@
                     <version>${project.version}</version>
                     <scope>provided</scope>
                 </dependency>
+                <dependency>
+                    <groupId>org.apache.seatunnel</groupId>
+                    <artifactId>connector-http-linear</artifactId>
+                    <version>${project.version}</version>
+                    <scope>provided</scope>
+                </dependency>
                 <dependency>
                     <groupId>org.apache.seatunnel</groupId>
                     <artifactId>connector-http-zendesk</artifactId>