Skip to content

EE Refactor 2 #5829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

EE Refactor 2 #5829

wants to merge 2 commits into from

Conversation

diegoimbert
Copy link
Contributor

No description provided.

Copy link

cloudflare-workers-and-pages bot commented May 28, 2025

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: bd70e59
Status: ✅  Deploy successful!
Preview URL: https://8838ecf7.windmill.pages.dev
Branch Preview URL: https://di-ee-refactor-2.windmill.pages.dev

View logs

@diegoimbert
Copy link
Contributor Author

/ai
This is the content of kafka_triggers_ee.rs:

use crate::db::DB;
use axum::Router;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct KafkaResourceSecurity {}

pub fn workspaced_service() -> Router {
    Router::new()
}

pub fn start_kafka_consumers(
    _db: DB,
    mut _killpill_rx: tokio::sync::broadcast::Receiver<()>,
) -> () {
    // implementation is not open source
}

#[derive(Serialize, Deserialize)]
pub enum KafkaTriggerConfigConnection {}

#[derive(Serialize, Clone)]
pub struct KafkaTrigger {
    pub workspace_id: String,
    pub path: String,
    pub kafka_resource_path: String,
    pub group_id: String,
    pub topics: Vec<String>,
    pub script_path: String,
    pub is_flow: bool,
    pub edited_by: String,
    pub email: String,
    pub edited_at: chrono::DateTime<chrono::Utc>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub server_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_server_ping: Option<chrono::DateTime<chrono::Utc>>,
    pub extra_perms: serde_json::Value,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    pub enabled: bool,
}

I created a new file kafka_triggers_oss.rs with this content:

use crate::db::DB;
use axum::Router;

pub fn workspaced_service() -> Router {
    crate::kafka_triggers_ee::workspaced_service()
}

pub fn start_kafka_consumers(
    _db: DB,
    mut _killpill_rx: tokio::sync::broadcast::Receiver<()>,
) -> () {
    crate::kafka_triggers_ee::start_kafka_consumers(_db, _killpill_rx)
}

Basically: Copy the function signatures from the _ee file and call the functions

Do this for every *_ee.rs file

Copy link
Contributor

claude bot commented May 28, 2025

Claude finished @diegoimbert's task —— View job


EE Refactor Task: Creating OSS wrappers for all *_ee.rs files ✅

Todo List:

  • Gather context and understand the current EE structure
  • Find all *_ee.rs files in the backend
  • Analyze the kafka_triggers_ee.rs example
  • Create corresponding *_oss.rs files for each *_ee.rs file
  • Verify the changes compile correctly (skipped - no Bash permissions for Rust install)
  • Commit all changes

Summary

Successfully created 32 OSS wrapper files for all *_ee.rs files across the Windmill backend! 🎉

Created Files:

  • windmill-api (19 files): agent_workers, git_sync, gcp_triggers, apps, oidc, oauth2, nats_triggers, kafka_triggers, job_helpers, indexer, smtp_server, scim, saml, workspaces, users, teams, teams_approvals, stripe, sqs_triggers
  • windmill-autoscaling (1 file): autoscaling
  • windmill-common (6 files): job_s3_helpers, email, teams, stats, otel, oidc
  • windmill-audit (1 file): audit
  • windmill-indexer (3 files): service_logs, completed_runs, indexer
  • windmill-git-sync (1 file): git_sync
  • windmill-queue (1 file): jobs
  • windmill-worker (2 files): otel, job_logger

Pattern Applied:
Each OSS file follows the established pattern from kafka_triggers_oss.rs:

  • Maintains identical public API signatures
  • Re-exports public structs, enums, and traits where needed
  • Calls through to corresponding EE implementations
  • Ensures API compatibility for seamless EE/OSS swapping

The refactor maintains backward compatibility while providing the foundation for switching between Enterprise and Open Source implementations.

Note: Skipped compilation verification due to lack of Bash permissions for Rust installation. The code follows established patterns and should compile correctly.


Create OSS implementations for all *_ee.rs files following the established pattern:
- Copy function signatures from EE modules and call EE implementations
- Re-export public structs, enums, and traits to maintain API compatibility
- Enables seamless switching between Enterprise and Open Source builds

Co-authored-by: diegoimbert <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant