You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2025/12/18 12:29:14 UTC

(iggy) branch fix-version-print updated (d95fb1264 -> 35682c88c)

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

hgruszecki pushed a change to branch fix-version-print
in repository https://gitbox.apache.org/repos/asf/iggy.git


    omit d95fb1264 feat(connectors): add --version flag support to connector runtime
     new 35682c88c feat(connectors): add --version flag support to connector runtime

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d95fb1264)
            \
             N -- N -- N   refs/heads/fix-version-print (35682c88c)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 core/server/src/main.rs | 5 -----
 1 file changed, 5 deletions(-)


(iggy) 01/01: feat(connectors): add --version flag support to connector runtime

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

hgruszecki pushed a commit to branch fix-version-print
in repository https://gitbox.apache.org/repos/asf/iggy.git

commit 35682c88c295aec9ebf9296f98ce501a8681bcc8
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Thu Dec 18 13:24:23 2025 +0100

    feat(connectors): add --version flag support to connector runtime
    
    Extract print_ascii_art() in both server and connector runtime.
    Add clap-based Args struct to connector runtime for consistent
    version output via -V/--version flag.
---
 Cargo.lock                          |  1 +
 core/connectors/runtime/Cargo.toml  |  1 +
 core/connectors/runtime/src/main.rs | 16 +++++++++++++---
 core/server/src/main.rs             | 16 ++++++++--------
 4 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 65920a8ad..8c079c767 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4555,6 +4555,7 @@ dependencies = [
  "axum",
  "axum-server",
  "chrono",
+ "clap",
  "dashmap",
  "dlopen2",
  "dotenvy",
diff --git a/core/connectors/runtime/Cargo.toml b/core/connectors/runtime/Cargo.toml
index 83f49d103..e91272734 100644
--- a/core/connectors/runtime/Cargo.toml
+++ b/core/connectors/runtime/Cargo.toml
@@ -30,6 +30,7 @@ readme = "README.md"
 
 [dependencies]
 async-trait = { workspace = true }
+clap = { workspace = true }
 axum = { workspace = true }
 axum-server = { workspace = true }
 chrono = { workspace = true }
diff --git a/core/connectors/runtime/src/main.rs b/core/connectors/runtime/src/main.rs
index d1990d80f..da0ac4214 100644
--- a/core/connectors/runtime/src/main.rs
+++ b/core/connectors/runtime/src/main.rs
@@ -18,6 +18,7 @@
  */
 
 use crate::configs::connectors::{ConnectorsConfigProvider, create_connectors_config_provider};
+use clap::Parser;
 use configs::connectors::ConfigFormat;
 use configs::runtime::ConnectorsRuntimeConfig;
 use dlopen2::wrapper::{Container, WrapperApi};
@@ -56,6 +57,10 @@ mod transform;
 #[global_allocator]
 static GLOBAL: MiMalloc = MiMalloc;
 
+#[derive(Parser, Debug)]
+#[command(author = "Apache Iggy (Incubating)", version)]
+struct Args {}
+
 static PLUGIN_ID: AtomicU32 = AtomicU32::new(1);
 const ALLOWED_PLUGIN_EXTENSIONS: [&str; 3] = ["so", "dylib", "dll"];
 const DEFAULT_CONFIG_PATH: &str = "core/connectors/runtime/config.toml";
@@ -89,11 +94,16 @@ struct SinkApi {
     close: extern "C" fn(id: u32) -> i32,
 }
 
-#[tokio::main]
-async fn main() -> Result<(), RuntimeError> {
+fn print_ascii_art(text: &str) {
     let standard_font = FIGfont::standard().unwrap();
-    let figure = standard_font.convert("Iggy Connectors");
+    let figure = standard_font.convert(text);
     println!("{}", figure.unwrap());
+}
+
+#[tokio::main]
+async fn main() -> Result<(), RuntimeError> {
+    Args::parse();
+    print_ascii_art("Iggy Connectors");
 
     if let Ok(env_path) = std::env::var("IGGY_CONNECTORS_ENV_PATH") {
         if dotenvy::from_path(&env_path).is_ok() {
diff --git a/core/server/src/main.rs b/core/server/src/main.rs
index e2d47f79c..5ce51716d 100644
--- a/core/server/src/main.rs
+++ b/core/server/src/main.rs
@@ -101,6 +101,12 @@ fn extract_panic_message(payload: Box<dyn std::any::Any + Send>) -> String {
         .unwrap_or_else(|| "unknown panic".to_string())
 }
 
+fn print_ascii_art(text: &str) {
+    let standard_font = FIGfont::standard().unwrap();
+    let figure = standard_font.convert(text);
+    println!("{}", figure.unwrap());
+}
+
 #[instrument(skip_all, name = "trace_start_server")]
 fn main() -> Result<(), ServerError> {
     let rt = match compio::runtime::Runtime::new() {
@@ -115,14 +121,6 @@ fn main() -> Result<(), ServerError> {
         }
     };
     rt.block_on(async move {
-        let standard_font = FIGfont::standard().unwrap();
-        let figure = standard_font.convert("Iggy Server");
-        println!("{}", figure.unwrap());
-
-        if let Some(sha) = option_env!("VERGEN_GIT_SHA") {
-            println!("Commit SHA: {sha}");
-        }
-
         if let Ok(env_path) = std::env::var("IGGY_ENV_PATH") {
             if dotenvy::from_path(&env_path).is_ok() {
                 println!("Loaded environment variables from path: {env_path}");
@@ -134,6 +132,8 @@ fn main() -> Result<(), ServerError> {
             );
         }
         let args = Args::parse();
+        print_ascii_art("Iggy Server");
+
         let is_follower = args.follower;
 
         // FIRST DISCRETE LOADING STEP.