Skip to content

Commit 63b003a

Browse files
authored
Merge pull request #23 from kindredgroup/fix/revert-changes
fix: revert changes
2 parents f5a004c + bce43c3 commit 63b003a

File tree

24 files changed

+58
-138
lines changed

24 files changed

+58
-138
lines changed

.github/workflows/ghcr_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: GHCR Publish
66
on:
77
push:
88
tags:
9-
- 'v[0-9]+.[0-9]+.[0-9]+(-(dev|alpha|beta|rc)[0-9]*)?'
9+
- 'v[0-9]+.[0-9]+.[0-9]+'
1010

1111
jobs:
1212
build:

.github/workflows/npm_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
tags:
5-
- 'v[0-9]+.[0-9]+.[0-9]+(-(dev|alpha|beta|rc)[0-9]*)?'
5+
- 'v[0-9]+.[0-9]+.[0-9]+'
66
env:
77
DEBUG: napi:*
88
APP_NAME: scylla_pg_js

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scylla_models/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "scylla_models"
3-
version = "0.1.34-dev1"
3+
version = "0.1.33"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

scylla_models/src/lib.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct AddTaskModel {
1212
pub queue: String,
1313
}
1414

15-
#[derive(Debug, Default)]
15+
#[derive(Debug)]
1616
pub struct UpdateTaskModel {
1717
pub rn: String,
1818
pub operation: UpdateOperation,
@@ -21,7 +21,6 @@ pub struct UpdateTaskModel {
2121
pub worker: Option<String>,
2222
pub progress: Option<f32>,
2323
pub task_timeout_in_secs: Option<i64>,
24-
pub metrics: Option<Value>,
2524
}
2625

2726
#[derive(Debug)]
@@ -42,12 +41,11 @@ impl Default for GetTaskModel {
4241
}
4342
}
4443

45-
#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, Default)]
44+
#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
4645
#[serde(rename_all = "camelCase")]
4746
pub enum UpdateOperation {
4847
Yield,
4948
HeartBeat,
50-
#[default]
5149
Status,
5250
Lease,
5351
Reset,
@@ -131,7 +129,6 @@ pub struct Task {
131129
pub owner: Option<String>,
132130
pub errors: Vec<TaskError>,
133131
pub history: Vec<TaskHistory>,
134-
pub metrics: Option<Value>,
135132
}
136133
impl Default for Task {
137134
fn default() -> Self {
@@ -148,7 +145,6 @@ impl Default for Task {
148145
owner: None,
149146
errors: Vec::default(),
150147
history: Vec::default(),
151-
metrics: None,
152148
}
153149
}
154150
}
@@ -181,11 +177,10 @@ mod tests {
181177
status: None,
182178
worker: None,
183179
task_timeout_in_secs: None,
184-
metrics: None,
185180
};
186181
assert_eq!(
187182
format!("{:?}", utm),
188-
"UpdateTaskModel { rn: \"1.2.3\", operation: HeartBeat, status: None, error: None, worker: None, progress: None, task_timeout_in_secs: None, metrics: None }"
183+
"UpdateTaskModel { rn: \"1.2.3\", operation: HeartBeat, status: None, error: None, worker: None, progress: None, task_timeout_in_secs: None }"
189184
);
190185
}
191186
#[test]
@@ -273,7 +268,7 @@ mod tests {
273268
..Task::default()
274269
};
275270
// debug trait
276-
assert_eq!(format!("{:?}", t), format!("Task {{ rn: \"\", spec: Null, status: Ready, queue: \"\", progress: 0.0, priority: 0, created: {0:?}, updated: {0:?}, deadline: None, owner: None, errors: [], history: [], metrics: None }}", t_now));
271+
assert_eq!(format!("{:?}", t), format!("Task {{ rn: \"\", spec: Null, status: Ready, queue: \"\", progress: 0.0, priority: 0, created: {0:?}, updated: {0:?}, deadline: None, owner: None, errors: [], history: [] }}", t_now));
277272
// default()
278273
let t = Task {
279274
created: t_now,
@@ -295,7 +290,6 @@ mod tests {
295290
owner: None,
296291
errors: Vec::default(),
297292
history: Vec::default(),
298-
metrics: None,
299293
}
300294
)
301295
}

scylla_operations/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "scylla_operations"
3-
version = "0.1.34-dev1"
3+
version = "0.1.33"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

scylla_operations/src/task/tests.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ fn update_task_calls_get_and_update() {
3131
operation: UpdateOperation::Lease,
3232
status: Some(TaskStatus::Running),
3333
worker: Some("worker1".to_string()),
34-
..UpdateTaskModel::default()
34+
error: None,
35+
progress: None,
36+
task_timeout_in_secs: None,
3537
};
3638
let task_to_update = Task {
3739
rn: "unique_id".to_string(),
@@ -56,7 +58,10 @@ fn update_task_returns_scylla_op_error() {
5658
rn: "unique_id".to_string(),
5759
operation: UpdateOperation::Status,
5860
status: Some(TaskStatus::Completed),
59-
..UpdateTaskModel::default()
61+
worker: None,
62+
error: None,
63+
progress: None,
64+
task_timeout_in_secs: None,
6065
};
6166

6267
assert_eq!(

scylla_operations/src/update_task.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ pub fn validate_status_operation(task: &Task, update_task_model: &UpdateTaskMode
3434
fn prepare_status_task(mut task: Task, update_task_model: &UpdateTaskModel) -> Task {
3535
task.status = update_task_model.status.clone().unwrap();
3636
task.updated = Utc::now();
37-
if let Some(metrics) = &update_task_model.metrics {
38-
task.metrics = Some(metrics.clone());
39-
}
4037
if let Some(error) = update_task_model.error.clone() {
4138
if task.status == TaskStatus::Aborted {
4239
task.errors.push(error);

0 commit comments

Comments
 (0)