Skip to content

Commit

Permalink
chore: deprecate types
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Oct 25, 2024
1 parent 7787735 commit 3701098
Show file tree
Hide file tree
Showing 69 changed files with 172 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# types

> :warning: The types module is deprecated.
> Please use the types located in [go-vela/server](https://github.com/go-vela/server)
[![license](https://img.shields.io/crates/l/gl.svg)](../LICENSE)
[![GoDoc](https://godoc.org/github.com/go-vela/types?status.svg)](https://godoc.org/github.com/go-vela/types)
[![Go Report Card](https://goreportcard.com/badge/go-vela/types)](https://goreportcard.com/report/go-vela/types)
Expand Down
4 changes: 2 additions & 2 deletions constants/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Package constants provides the defined constant types for Vela.
//
// Usage:
// Deprecated: all constants for Vela have been moved to github.com/go-vela/server/constants.
//
// import "github.com/go-vela/types/constants"
// This package is frozen.
package constants
2 changes: 2 additions & 0 deletions database/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const (
)

// Build is the database representation of a build for a pipeline.
//
// Deprecated: use Build from github.com/go-vela/server/database/types instead.
type Build struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/build_executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ var (
)

// BuildExecutable is the database representation of a BuildExecutable.
//
// Deprecated: use BuildExecutable from github.com/go-vela/server/database/types instead.
type BuildExecutable struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/build_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

// BuildQueue is the database representation of the builds in the queue.
//
// Deprecated: use QueueBuild from github.com/go-vela/server/database/types instead.
type BuildQueue struct {
Status sql.NullString `sql:"status"`
Number sql.NullInt32 `sql:"number"`
Expand Down
2 changes: 2 additions & 0 deletions database/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ var (
)

// Deployment is the database representation of a deployment for a repo.
//
// Deprecated: use Deployment from github.com/go-vela/server/database/types instead.
type Deployment struct {
ID sql.NullInt64 `sql:"id"`
Number sql.NullInt64 `sql:"number"`
Expand Down
4 changes: 2 additions & 2 deletions database/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Package database provides the defined database types for Vela.
//
// Usage:
// Deprecated: all database types for Vela have been moved to github.com/go-vela/server/database/types .
//
// import "github.com/go-vela/types/database"
// This package is frozen.
package database
2 changes: 2 additions & 0 deletions database/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var (
)

// Hook is the database representation of a webhook for a repo.
//
// Deprecated: use Hook from github.com/go-vela/server/database/types instead.
type Hook struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var (
)

// Log is the database representation of a log for a step in a build.
//
// Deprecated: use Log from github.com/go-vela/server/database/types instead.
type Log struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
)

// Pipeline is the database representation of a pipeline.
//
// Deprecated: use Pipeline from github.com/go-vela/server/database/types instead.
type Pipeline struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ var (
)

// Repo is the database representation of a repo.
//
// Deprecated: use Repo from github.com/go-vela/server/database/types instead.
type Repo struct {
ID sql.NullInt64 `sql:"id"`
UserID sql.NullInt64 `sql:"user_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var (
)

// Schedule is the database representation of a schedule for a repo.
//
// Deprecated: use Schedule from github.com/go-vela/server/database/types instead.
type Schedule struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var (
)

// Secret is the database representation of a secret.
//
// Deprecated: use Secret from github.com/go-vela/server/database/types instead.
type Secret struct {
ID sql.NullInt64 `sql:"id"`
Org sql.NullString `sql:"org"`
Expand Down
2 changes: 2 additions & 0 deletions database/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
)

// Service is the database representation of a service in a build.
//
// Deprecated: use Service from github.com/go-vela/server/database/types instead.
type Service struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
)

// Step is the database representation of a step in a build.
//
// Deprecated: use Step from github.com/go-vela/server/database/types instead.
type Step struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
Expand Down
2 changes: 2 additions & 0 deletions database/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var (
)

// User is the database representation of a user.
//
// Deprecated: use User from github.com/go-vela/server/database/types instead.
type User struct {
ID sql.NullInt64 `sql:"id"`
Name sql.NullString `sql:"name"`
Expand Down
2 changes: 2 additions & 0 deletions database/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ var (
)

// Worker is the database representation of a worker.
//
// Deprecated: use Worker from github.com/go-vela/server/database/types instead.
type Worker struct {
ID sql.NullInt64 `sql:"id"`
Hostname sql.NullString `sql:"hostname"`
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "fmt"

// Error is the json error message from the server for a given http response.
//
// swagger:model Error
// Deprecated: use Error from github.com/go-vela/server/api/types instead.
type Error struct {
Message *string `json:"error"`
}
Expand Down
2 changes: 2 additions & 0 deletions item.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
const ItemVersion uint64 = 2

// Item is the queue representation of an item to publish to the queue.
//
// Deprecated: use Item from github.com/go-vela/server/queue/models instead.
type Item struct {
Build *library.Build `json:"build"`

Check failure on line 19 in item.go

View workflow job for this annotation

GitHub Actions / diff-review

SA1019: library.Build is deprecated: use Build from github.com/go-vela/server/api/types instead. (staticcheck)

Check failure on line 19 in item.go

View workflow job for this annotation

GitHub Actions / full-review

SA1019: library.Build is deprecated: use Build from github.com/go-vela/server/api/types instead. (staticcheck)

Check failure on line 19 in item.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] item.go#L19

SA1019: library.Build is deprecated: use Build from github.com/go-vela/server/api/types instead. (staticcheck)
Raw output
item.go:19:9: SA1019: library.Build is deprecated: use Build from github.com/go-vela/server/api/types instead. (staticcheck)
	Build *library.Build `json:"build"`
	       ^
Repo *library.Repo `json:"repo"`

Check failure on line 20 in item.go

View workflow job for this annotation

GitHub Actions / diff-review

SA1019: library.Repo is deprecated: use Repo from github.com/go-vela/server/api/types instead. (staticcheck)

Check failure on line 20 in item.go

View workflow job for this annotation

GitHub Actions / full-review

SA1019: library.Repo is deprecated: use Repo from github.com/go-vela/server/api/types instead. (staticcheck)

Check failure on line 20 in item.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] item.go#L20

SA1019: library.Repo is deprecated: use Repo from github.com/go-vela/server/api/types instead. (staticcheck)
Raw output
item.go:20:9: SA1019: library.Repo is deprecated: use Repo from github.com/go-vela/server/api/types instead. (staticcheck)
	Repo  *library.Repo  `json:"repo"`
	       ^
Expand Down
2 changes: 2 additions & 0 deletions library/actions/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "github.com/go-vela/types/constants"

// Comment is the library representation of the various actions associated
// with the comment event webhook from the SCM.
//
// Deprecated: use Comment from github.com/go-vela/server/api/types/actions instead.
type Comment struct {
Created *bool `json:"created"`
Edited *bool `json:"edited"`
Expand Down
2 changes: 2 additions & 0 deletions library/actions/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "github.com/go-vela/types/constants"

// Deploy is the library representation of the various actions associated
// with the deploy event webhook from the SCM.
//
// Deprecated: use Deploy from github.com/go-vela/server/api/types/actions instead.
type Deploy struct {
Created *bool `json:"created"`
}
Expand Down
8 changes: 8 additions & 0 deletions library/actions/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: Apache-2.0

// Package actions provides the defined event action types for Vela.
//
// Deprecated: all event action types for Vela have been moved to github.com/go-vela/server/api/types/actions .
//
// This package is frozen.
package actions
2 changes: 2 additions & 0 deletions library/actions/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "github.com/go-vela/types/constants"

// Pull is the library representation of the various actions associated
// with the pull_request event webhook from the SCM.
//
// Deprecated: use Pull from github.com/go-vela/server/api/types/actions instead.
type Pull struct {
Opened *bool `json:"opened"`
Edited *bool `json:"edited"`
Expand Down
2 changes: 2 additions & 0 deletions library/actions/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "github.com/go-vela/types/constants"

// Push is the library representation of the various actions associated
// with the push event webhook from the SCM.
//
// Deprecated: use Push from github.com/go-vela/server/api/types/actions instead.
type Push struct {
Branch *bool `json:"branch"`
Tag *bool `json:"tag"`
Expand Down
2 changes: 2 additions & 0 deletions library/actions/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "github.com/go-vela/types/constants"

// Schedule is the library representation of the various actions associated
// with the schedule event.
//
// Deprecated: use Schedule from github.com/go-vela/server/api/types/actions instead.
type Schedule struct {
Run *bool `json:"run"`
}
Expand Down
2 changes: 1 addition & 1 deletion library/build_executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// BuildExecutable is the library representation of a BuildExecutable.
//
// swagger:model BuildExecutable
// Deprecated: use BuildExecutable from github.com/go-vela/server/api/types instead.
type BuildExecutable struct {
ID *int64 `json:"id,omitempty"`
BuildID *int64 `json:"build_id,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions library/build_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ 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"`
Number *int32 `json:"number,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// Deployment is the library representation of a deployment.
//
// swagger:model Deployment
// Deprecated: use Deployment from github.com/go-vela/server/api/types instead.
type Deployment struct {
ID *int64 `json:"id,omitempty"`
Number *int64 `json:"number,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions library/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Package library provides the defined library types for Vela.
//
// Usage:
// Deprecated: all library types for Vela have been moved to github.com/go-vela/server/api/types .
//
// import "github.com/go-vela/types/library"
// This package is frozen.
package library
2 changes: 2 additions & 0 deletions library/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (

// Events is the library representation of the various events that generate a
// webhook from the SCM.
//
// Deprecated: use Events from github.com/go-vela/server/api/types instead.
type Events struct {
Push *actions.Push `json:"push"`
PullRequest *actions.Pull `json:"pull_request"`
Expand Down
2 changes: 1 addition & 1 deletion library/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// Log is the library representation of a log for a step in a build.
//
// swagger:model Log
// Deprecated: use Log from github.com/go-vela/server/api/types instead.
type Log struct {
ID *int64 `json:"id,omitempty"`
BuildID *int64 `json:"build_id,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// Pipeline is the library representation of a Pipeline.
//
// swagger:model Pipeline
// Deprecated: use Pipeline from github.com/go-vela/server/api/types instead.
type Pipeline struct {
ID *int64 `json:"id,omitempty"`
RepoID *int64 `json:"repo_id,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/queue_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package library

// QueueInfo is the library representation of a QueueInfo.
//
// swagger:model QueueInfo
// Deprecated: use QueueInfo from github.com/go-vela/server/api/types instead.
type QueueInfo struct {
QueuePublicKey *string `json:"queue_public_key,omitempty"`
QueueAddress *string `json:"queue_address,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// Secret is the library representation of a secret.
//
// swagger:model Secret
// Deprecated: use Secret from github.com/go-vela/server/api/types instead.
type Secret struct {
ID *int64 `json:"id,omitempty"`
Org *string `json:"org,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// Service is the library representation of a service in a build.
//
// swagger:model Service
// Deprecated: use Service from github.com/go-vela/server/api/types instead.
type Service struct {
ID *int64 `json:"id,omitempty"`
BuildID *int64 `json:"build_id,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// Step is the library representation of a step in a build.
//
// swagger:model Step
// Deprecated: use Step from github.com/go-vela/server/api/types instead.
type Step struct {
ID *int64 `json:"id,omitempty"`
BuildID *int64 `json:"build_id,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Template is the library representation of a template for a pipeline.
//
// swagger:model Template
// Deprecated: use Template from github.com/go-vela/server/api/types instead.
type Template struct {
Link *string `json:"link,omitempty"`
Name *string `json:"name,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion library/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "fmt"

// Token is the library representation of a token response from server.
//
// swagger:model Token
// Deprecated: use Token from github.com/go-vela/server/api/types instead.
type Token struct {
Token *string `json:"token,omitempty"`
}
Expand Down
10 changes: 10 additions & 0 deletions metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,33 @@ import "time"

type (
// Database is the extra set of database data passed to the compiler.
//
// Deprecated: use Database from github.com/go-vela/server/internal instead.
Database struct {
Driver string `json:"driver"`
Host string `json:"host"`
}

// Queue is the extra set of queue data passed to the compiler.
//
// Deprecated: use Queue from github.com/go-vela/server/internal instead.
Queue struct {
Channel string `json:"channel"`
Driver string `json:"driver"`
Host string `json:"host"`
}

// Source is the extra set of source data passed to the compiler.
//
// Deprecated: use Source from github.com/go-vela/server/internal instead.
Source struct {
Driver string `json:"driver"`
Host string `json:"host"`
}

// Vela is the extra set of Vela data passed to the compiler.
//
// Deprecated: use Vela from github.com/go-vela/server/internal instead.
Vela struct {
Address string `json:"address"`
WebAddress string `json:"web_address"`
Expand All @@ -35,6 +43,8 @@ type (

// Metadata is the extra set of data passed to the compiler for
// converting a yaml configuration to an executable pipeline.
//
// Deprecated: use Metadata from github.com/go-vela/server/internal instead.
Metadata struct {
Database *Database `json:"database"`
Queue *Queue `json:"queue"`
Expand Down
2 changes: 1 addition & 1 deletion pipeline/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// Build is the pipeline representation of a build for a pipeline.
//
// swagger:model PipelineBuild
// Deprecated: use Build from github.com/go-vela/server/compiler/types/pipeline instead.
type Build struct {
ID string `json:"id,omitempty" yaml:"id,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
Expand Down
Loading

0 comments on commit 3701098

Please sign in to comment.