-
Notifications
You must be signed in to change notification settings - Fork 118
Add ability to group pipelines into "folders" #6229
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| -- Add metadata field to the pipeline table. | ||
| -- This is arbitrary, optional text provided by the user. | ||
| ALTER TABLE pipeline ADD COLUMN metadata TEXT NOT NULL DEFAULT ''; | ||
|
|
||
| -- Copy existing description values into the metadata JSON "description" field. | ||
| UPDATE pipeline SET metadata = json_build_object('description', description)::text WHERE description != ''; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,10 @@ pub struct ConnectorStats { | |
| pub struct PipelineInfo { | ||
| pub id: PipelineId, | ||
| pub name: String, | ||
| /// Deprecated: use `metadata` instead. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to mark it deprecated; nothing has changed we weren't using it before we dont need to use it now?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to discuss this more with Simon once he's back; I think it's benefitial to fold the "description" column into the "metadata" column model I propose here |
||
| #[schema(deprecated)] | ||
| pub description: String, | ||
| pub metadata: String, | ||
| pub created_at: DateTime<Utc>, | ||
| pub version: Version, | ||
| pub platform_version: String, | ||
|
|
@@ -143,6 +146,7 @@ pub struct PipelineInfoInternal { | |
| pub id: PipelineId, | ||
| pub name: String, | ||
| pub description: String, | ||
| pub metadata: String, | ||
| pub created_at: DateTime<Utc>, | ||
| pub version: Version, | ||
| pub platform_version: String, | ||
|
|
@@ -184,6 +188,7 @@ impl PipelineInfoInternal { | |
| id: extended_pipeline.id, | ||
| name: extended_pipeline.name, | ||
| description: extended_pipeline.description, | ||
| metadata: extended_pipeline.metadata, | ||
| created_at: extended_pipeline.created_at, | ||
| version: extended_pipeline.version, | ||
| platform_version: extended_pipeline.platform_version, | ||
|
|
@@ -245,7 +250,10 @@ impl PipelineInfoInternal { | |
| pub struct PipelineSelectedInfo { | ||
| pub id: PipelineId, | ||
| pub name: String, | ||
| /// Deprecated: use `metadata` instead. | ||
| #[schema(deprecated)] | ||
| pub description: String, | ||
| pub metadata: String, | ||
| pub created_at: DateTime<Utc>, | ||
| pub version: Version, | ||
| pub platform_version: String, | ||
|
|
@@ -303,6 +311,7 @@ pub struct PipelineSelectedInfoInternal { | |
| pub id: PipelineId, | ||
| pub name: String, | ||
| pub description: String, | ||
| pub metadata: String, | ||
| pub created_at: DateTime<Utc>, | ||
| pub version: Version, | ||
| pub platform_version: String, | ||
|
|
@@ -355,6 +364,7 @@ impl PipelineSelectedInfoInternal { | |
| id: extended_pipeline.id, | ||
| name: extended_pipeline.name, | ||
| description: extended_pipeline.description, | ||
| metadata: extended_pipeline.metadata, | ||
| created_at: extended_pipeline.created_at, | ||
| version: extended_pipeline.version, | ||
| platform_version: extended_pipeline.platform_version, | ||
|
|
@@ -418,6 +428,7 @@ impl PipelineSelectedInfoInternal { | |
| id: extended_pipeline.id, | ||
| name: extended_pipeline.name, | ||
| description: extended_pipeline.description, | ||
| metadata: extended_pipeline.metadata, | ||
| created_at: extended_pipeline.created_at, | ||
| version: extended_pipeline.version, | ||
| platform_version: extended_pipeline.platform_version, | ||
|
|
@@ -490,7 +501,8 @@ pub enum PipelineFieldSelector { | |
| /// The selection includes the following fields: | ||
| /// - `id` | ||
| /// - `name` | ||
| /// - `description` | ||
| /// - `description` (deprecated, use `metadata`) | ||
| /// - `metadata` | ||
| /// - `created_at` | ||
| /// - `version` | ||
| /// - `platform_version` | ||
|
|
@@ -530,7 +542,8 @@ pub enum PipelineFieldSelector { | |
| /// The selection includes the following fields: | ||
| /// - `id` | ||
| /// - `name` | ||
| /// - `description` | ||
| /// - `description` (deprecated, use `metadata`) | ||
| /// - `metadata` | ||
| /// - `created_at` | ||
| /// - `version` | ||
| /// - `platform_version` | ||
|
|
@@ -591,7 +604,10 @@ pub struct GetPipelineParameters { | |
| #[derive(Debug, Serialize, Deserialize, ToSchema)] | ||
| pub struct PostPutPipeline { | ||
| pub name: String, | ||
| /// Deprecated: use `metadata` instead. | ||
| #[schema(deprecated)] | ||
| pub description: Option<String>, | ||
| pub metadata: Option<String>, | ||
| pub runtime_config: Option<RuntimeConfig>, | ||
| pub program_code: String, | ||
| pub udf_rust: Option<String>, | ||
|
|
@@ -609,6 +625,7 @@ pub struct PostPutPipeline { | |
| pub struct PostPutPipelineInternal { | ||
| pub name: String, | ||
| pub description: Option<String>, | ||
| pub metadata: Option<String>, | ||
| pub runtime_config: Option<serde_json::Value>, | ||
| pub program_code: String, | ||
| pub udf_rust: Option<String>, | ||
|
|
@@ -623,6 +640,7 @@ impl From<PostPutPipelineInternal> for PipelineDescr { | |
| PipelineDescr { | ||
| name: value.name.clone(), | ||
| description: value.description.clone().unwrap_or("".to_string()), | ||
| metadata: value.metadata.clone().unwrap_or("".to_string()), | ||
| runtime_config: value.runtime_config.clone().unwrap_or(json!({})), | ||
| program_code: value.program_code.clone(), | ||
| udf_rust: value.udf_rust.clone().unwrap_or("".to_string()), | ||
|
|
@@ -641,7 +659,13 @@ impl From<PostPutPipelineInternal> for PipelineDescr { | |
| #[derive(Debug, Serialize, Deserialize, ToSchema)] | ||
| pub struct PatchPipeline { | ||
| pub name: Option<String>, | ||
| /// Deprecated: use `metadata` instead. | ||
| #[schema(deprecated)] | ||
| pub description: Option<String>, | ||
| /// Free-form client-side annotation. Unlike the other fields, `metadata` | ||
| /// can be patched at any time — including while the pipeline is running — | ||
| /// because it has no effect on the deployed pipeline. | ||
| pub metadata: Option<String>, | ||
| pub runtime_config: Option<RuntimeConfig>, | ||
| pub program_code: Option<String>, | ||
| pub udf_rust: Option<String>, | ||
|
|
@@ -658,6 +682,7 @@ pub struct PatchPipeline { | |
| pub struct PatchPipelineInternal { | ||
| pub name: Option<String>, | ||
| pub description: Option<String>, | ||
| pub metadata: Option<String>, | ||
| pub runtime_config: Option<serde_json::Value>, | ||
| pub program_code: Option<String>, | ||
| pub udf_rust: Option<String>, | ||
|
|
@@ -1151,6 +1176,7 @@ pub(crate) async fn patch_pipeline( | |
| &pipeline_name, | ||
| &body.name, | ||
| &body.description, | ||
| &body.metadata, | ||
| &state.common_config.platform_version, | ||
| false, | ||
| &body.runtime_config, | ||
|
|
@@ -1240,6 +1266,7 @@ pub(crate) async fn post_update_runtime( | |
| &pipeline_name, | ||
| &None, | ||
| &None, | ||
| &None, | ||
| &state.common_config.platform_version, | ||
| true, // bump platform version. | ||
| &None, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's good to have a catch-all JSON element this. We're already strictly structured, we dont have to switch to the dark side of using unstructured data on top of a relational database.