Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions backend/plugins/github/models/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ import (

type GithubDeployment struct {
common.NoPKModel `json:"-" mapstructure:"-"`
ConnectionId uint64 `json:"connection_id" gorm:"primaryKey"`
GithubId int `json:"github_id"`
Id string `json:"id" gorm:"type:varchar(255);primaryKey"`
DatabaseId uint `json:"database_id"`
CommitOid string `json:"commit_oid" gorm:"type:varchar(255)"`
Description string `json:"description" gorm:"type:varchar(255)"`
Environment string `json:"environment" gorm:"type:varchar(255)"`
State string `json:"state" gorm:"type:varchar(255)"`
LatestStatusState string `json:"latest_status_state" gorm:"type:varchar(255)"`
LatestUpdatedDate time.Time `json:"latest_status_update_date"`
RepositoryID string `json:"repository_id" gorm:"type:varchar(255)"`
RepositoryName string `json:"repository_name" gorm:"type:varchar(255)"`
RepositoryUrl string `json:"repository_url" gorm:"type:varchar(255)"`
RefName string `json:"ref_name" gorm:"type:varchar(255)"`
Payload string `json:"payload" gorm:"type:text"`
CreatedDate time.Time `json:"created_at"`
UpdatedDate time.Time `json:"updated_at"`
ConnectionId uint64 `json:"connection_id" gorm:"primaryKey"`
GithubId int `json:"github_id"`
Id string `json:"id" gorm:"type:varchar(255);primaryKey"`
DatabaseId uint `json:"database_id"`
CommitOid string `json:"commit_oid" gorm:"type:varchar(255)"`
Description string `json:"description" gorm:"type:varchar(255)"`
Environment string `json:"environment" gorm:"type:varchar(255)"`
State string `json:"state" gorm:"type:varchar(255)"`
LatestStatusState string `json:"latest_status_state" gorm:"type:varchar(255)"`
LatestUpdatedDate *time.Time `json:"latest_status_update_date"`
RepositoryID string `json:"repository_id" gorm:"type:varchar(255)"`
RepositoryName string `json:"repository_name" gorm:"type:varchar(255)"`
RepositoryUrl string `json:"repository_url" gorm:"type:varchar(255)"`
RefName string `json:"ref_name" gorm:"type:varchar(255)"`
Payload string `json:"payload" gorm:"type:text"`
CreatedDate time.Time `json:"created_at"`
UpdatedDate time.Time `json:"updated_at"`
}

func (GithubDeployment) TableName() string {
Expand Down
6 changes: 3 additions & 3 deletions backend/plugins/github_graphql/tasks/deployment_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ type GraphqlQueryDeploymentDeployment struct {
Prefix string `graphql:"prefix"`
} `graphql:"ref"`
LatestStatus struct {
Id string `graphql:"id"`
State string `graphql:"state"`
UpdatedAt time.Time `json:"updatedAt"`
Id string `graphql:"id"`
State string `graphql:"state"`
UpdatedAt *time.Time `json:"updatedAt"`
} `graphql:"latestStatus"`
Repository struct {
Id string `graphql:"id"`
Expand Down
4 changes: 1 addition & 3 deletions backend/plugins/github_graphql/tasks/deployment_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ func convertGithubDeployment(deployment GraphqlQueryDeploymentDeployment, connec
CreatedDate: deployment.CreatedAt,
UpdatedDate: deployment.UpdatedAt,
LatestStatusState: deployment.LatestStatus.State,
}
if !deployment.LatestStatus.UpdatedAt.IsZero() {
ret.LatestUpdatedDate = deployment.LatestStatus.UpdatedAt
LatestUpdatedDate: deployment.LatestStatus.UpdatedAt,
}
if deployment.Ref != nil {
ret.RefName = deployment.Ref.Name
Expand Down