Sync branch magefile with main #104308

Merged
Sybren A. Stüvel merged 85 commits from abelli/flamenco:magefile into magefile 2024-05-13 16:26:32 +02:00
4 changed files with 13 additions and 11 deletions
Showing only changes of commit 3fbb3cde34 - Show all commits

View File

@ -742,7 +742,7 @@ func convertSqlcJob(job sqlc.Job) (*Job, error) {
CreatedAt: job.CreatedAt, CreatedAt: job.CreatedAt,
UpdatedAt: job.UpdatedAt.Time, UpdatedAt: job.UpdatedAt.Time,
}, },
UUID: job.Uuid, UUID: job.UUID,
Name: job.Name, Name: job.Name,
JobType: job.JobType, JobType: job.JobType,
Priority: int(job.Priority), Priority: int(job.Priority),
@ -755,11 +755,11 @@ func convertSqlcJob(job sqlc.Job) (*Job, error) {
} }
if err := json.Unmarshal(job.Settings, &dbJob.Settings); err != nil { if err := json.Unmarshal(job.Settings, &dbJob.Settings); err != nil {
return nil, jobError(err, fmt.Sprintf("job %s has invalid settings: %v", job.Uuid, err)) return nil, jobError(err, fmt.Sprintf("job %s has invalid settings: %v", job.UUID, err))
} }
if err := json.Unmarshal(job.Metadata, &dbJob.Metadata); err != nil { if err := json.Unmarshal(job.Metadata, &dbJob.Metadata); err != nil {
return nil, jobError(err, fmt.Sprintf("job %s has invalid metadata: %v", job.Uuid, err)) return nil, jobError(err, fmt.Sprintf("job %s has invalid metadata: %v", job.UUID, err))
} }
if job.WorkerTagID.Valid { if job.WorkerTagID.Valid {

View File

@ -14,7 +14,7 @@ type Job struct {
ID int64 ID int64
CreatedAt time.Time CreatedAt time.Time
UpdatedAt sql.NullTime UpdatedAt sql.NullTime
Uuid string UUID string
Name string Name string
JobType string JobType string
Priority int64 Priority int64
@ -58,7 +58,7 @@ type Task struct {
ID int64 ID int64
CreatedAt time.Time CreatedAt time.Time
UpdatedAt sql.NullTime UpdatedAt sql.NullTime
Uuid string UUID string
Name string Name string
Type string Type string
JobID int64 JobID int64
@ -85,7 +85,7 @@ type Worker struct {
ID int64 ID int64
CreatedAt time.Time CreatedAt time.Time
UpdatedAt sql.NullTime UpdatedAt sql.NullTime
Uuid string UUID string
Secret string Secret string
Name string Name string
Address string Address string
@ -104,7 +104,7 @@ type WorkerTag struct {
ID int64 ID int64
CreatedAt time.Time CreatedAt time.Time
UpdatedAt sql.NullTime UpdatedAt sql.NullTime
Uuid string UUID string
Name string Name string
Description string Description string
} }

View File

@ -31,7 +31,7 @@ VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
type CreateJobParams struct { type CreateJobParams struct {
CreatedAt time.Time CreatedAt time.Time
Uuid string UUID string
Name string Name string
JobType string JobType string
Priority int64 Priority int64
@ -46,7 +46,7 @@ type CreateJobParams struct {
func (q *Queries) CreateJob(ctx context.Context, arg CreateJobParams) error { func (q *Queries) CreateJob(ctx context.Context, arg CreateJobParams) error {
_, err := q.db.ExecContext(ctx, createJob, _, err := q.db.ExecContext(ctx, createJob,
arg.CreatedAt, arg.CreatedAt,
arg.Uuid, arg.UUID,
arg.Name, arg.Name,
arg.JobType, arg.JobType,
arg.Priority, arg.Priority,
@ -80,7 +80,7 @@ func (q *Queries) FetchJob(ctx context.Context, uuid string) (Job, error) {
&i.ID, &i.ID,
&i.CreatedAt, &i.CreatedAt,
&i.UpdatedAt, &i.UpdatedAt,
&i.Uuid, &i.UUID,
&i.Name, &i.Name,
&i.JobType, &i.JobType,
&i.Priority, &i.Priority,
@ -107,7 +107,7 @@ func (q *Queries) FetchTask(ctx context.Context, uuid string) (Task, error) {
&i.ID, &i.ID,
&i.CreatedAt, &i.CreatedAt,
&i.UpdatedAt, &i.UpdatedAt,
&i.Uuid, &i.UUID,
&i.Name, &i.Name,
&i.Type, &i.Type,
&i.JobID, &i.JobID,

View File

@ -11,3 +11,5 @@ sql:
go_type: go_type:
import: "encoding/json" import: "encoding/json"
type: "RawMessage" type: "RawMessage"
rename:
uuid: "UUID"