From dad91743d6a0eac544817f9ce34d95bff05de560 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Sun, 14 Jul 2024 12:57:40 -0500 Subject: [PATCH 1/5] fix(swagger): remove old model annotations the modified model annotations have moved to go-vela/server/api/types where a duplicate of these annotations can be found. this change is needed for accurate swagger doc generation. see https://github.com/go-vela/server/pull/1159 --- library/build.go | 2 -- library/executor.go | 2 -- library/repo.go | 2 -- library/schedule.go | 2 -- library/user.go | 2 -- library/worker.go | 2 -- 6 files changed, 12 deletions(-) diff --git a/library/build.go b/library/build.go index 2ca9c368..993f3523 100644 --- a/library/build.go +++ b/library/build.go @@ -12,8 +12,6 @@ import ( ) // Build is the library representation of a build for a pipeline. -// -// swagger:model Build type Build struct { ID *int64 `json:"id,omitempty"` RepoID *int64 `json:"repo_id,omitempty"` diff --git a/library/executor.go b/library/executor.go index 62200230..0decb1e0 100644 --- a/library/executor.go +++ b/library/executor.go @@ -10,8 +10,6 @@ import ( ) // Executor is the library representation of an executor for a worker. -// -// swagger:model Executor type Executor struct { ID *int64 `json:"id,omitempty"` Host *string `json:"host,omitempty"` diff --git a/library/repo.go b/library/repo.go index 46c87df7..cc50e504 100644 --- a/library/repo.go +++ b/library/repo.go @@ -8,8 +8,6 @@ import ( ) // Repo is the library representation of a repo. -// -// swagger:model Repo type Repo struct { ID *int64 `json:"id,omitempty"` UserID *int64 `json:"user_id,omitempty"` diff --git a/library/schedule.go b/library/schedule.go index b9511e98..06fcf168 100644 --- a/library/schedule.go +++ b/library/schedule.go @@ -7,8 +7,6 @@ import ( ) // Schedule is the API representation of a schedule for a repo. -// -// swagger:model Schedule type Schedule struct { ID *int64 `json:"id,omitempty"` RepoID *int64 `json:"repo_id,omitempty"` diff --git a/library/user.go b/library/user.go index 3e2deb8e..e4b06bef 100644 --- a/library/user.go +++ b/library/user.go @@ -9,8 +9,6 @@ import ( ) // User is the library representation of a user. -// -// swagger:model User type User struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` diff --git a/library/worker.go b/library/worker.go index a454190a..01090271 100644 --- a/library/worker.go +++ b/library/worker.go @@ -7,8 +7,6 @@ import ( ) // Worker is the library representation of a worker. -// -// swagger:model Worker type Worker struct { ID *int64 `json:"id,omitempty"` Hostname *string `json:"hostname,omitempty"` From a031832f61db50f2cf3cf348d16d14d9852c6681 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Sat, 20 Jul 2024 14:48:03 -0500 Subject: [PATCH 2/5] mark as deprecated --- library/build.go | 2 ++ library/executor.go | 2 ++ library/repo.go | 2 ++ library/schedule.go | 2 ++ library/worker.go | 2 ++ 5 files changed, 10 insertions(+) diff --git a/library/build.go b/library/build.go index 993f3523..f8f5d4d5 100644 --- a/library/build.go +++ b/library/build.go @@ -12,6 +12,8 @@ import ( ) // Build is the library representation of a build for a pipeline. +// +// Deprecated: use Build from github.com/go-vela/server/api/types instead. type Build struct { ID *int64 `json:"id,omitempty"` RepoID *int64 `json:"repo_id,omitempty"` diff --git a/library/executor.go b/library/executor.go index 0decb1e0..1ae78135 100644 --- a/library/executor.go +++ b/library/executor.go @@ -10,6 +10,8 @@ import ( ) // Executor is the library representation of an executor for a worker. +// +// Deprecated: use Executor from github.com/go-vela/server/api/types instead. type Executor struct { ID *int64 `json:"id,omitempty"` Host *string `json:"host,omitempty"` diff --git a/library/repo.go b/library/repo.go index cc50e504..eb4c801d 100644 --- a/library/repo.go +++ b/library/repo.go @@ -8,6 +8,8 @@ import ( ) // Repo is the library representation of a repo. +// +// Deprecated: use Repo from github.com/go-vela/server/api/types instead. type Repo struct { ID *int64 `json:"id,omitempty"` UserID *int64 `json:"user_id,omitempty"` diff --git a/library/schedule.go b/library/schedule.go index 06fcf168..6b5437f3 100644 --- a/library/schedule.go +++ b/library/schedule.go @@ -7,6 +7,8 @@ import ( ) // Schedule is the API representation of a schedule for a repo. +// +// Deprecated: use Schedule from github.com/go-vela/server/api/types instead. type Schedule struct { ID *int64 `json:"id,omitempty"` RepoID *int64 `json:"repo_id,omitempty"` diff --git a/library/worker.go b/library/worker.go index 01090271..adf89045 100644 --- a/library/worker.go +++ b/library/worker.go @@ -7,6 +7,8 @@ import ( ) // Worker is the library representation of a worker. +// +// Deprecated: use Worker from github.com/go-vela/server/api/types instead. type Worker struct { ID *int64 `json:"id,omitempty"` Hostname *string `json:"hostname,omitempty"` From 16990bd1bdc3d9a1764cbf1897229ec1e882cfb3 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:22:56 -0500 Subject: [PATCH 3/5] also add deprecation notice to User --- library/user.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/user.go b/library/user.go index e4b06bef..4d95583e 100644 --- a/library/user.go +++ b/library/user.go @@ -9,6 +9,8 @@ import ( ) // User is the library representation of a user. +// +// Deprecated: use User from github.com/go-vela/server/api/types instead. type User struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` From b1c9e7460d6f4042d099e58e708612afd0f241eb Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:03:36 -0500 Subject: [PATCH 4/5] add deprecation to queuebuild --- library/build_queue.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/build_queue.go b/library/build_queue.go index 64ab0587..6d2da542 100644 --- a/library/build_queue.go +++ b/library/build_queue.go @@ -7,6 +7,8 @@ import "fmt" // BuildQueue is the library representation of the builds in the queue. // +// Deprecated: Use QueueBuild from github.com/go-vela/server/api/types instead. +// // swagger:model BuildQueue type BuildQueue struct { Status *string `json:"status,omitempty"` From 4f4e00c7ce9b1bfc2bcba0cbc178d3c426f898da Mon Sep 17 00:00:00 2001 From: David May <49894298+wass3rw3rk@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:05:43 -0500 Subject: [PATCH 5/5] Update build_queue.go --- library/build_queue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/build_queue.go b/library/build_queue.go index 6d2da542..21cf3a20 100644 --- a/library/build_queue.go +++ b/library/build_queue.go @@ -7,7 +7,7 @@ import "fmt" // BuildQueue is the library representation of the builds in the queue. // -// Deprecated: Use QueueBuild from github.com/go-vela/server/api/types instead. +// Deprecated: use QueueBuild from github.com/go-vela/server/api/types instead. // // swagger:model BuildQueue type BuildQueue struct {