Skip to content

Commit

Permalink
feat:add fields dataProcessMs and syncMsg for the data processing inf…
Browse files Browse the repository at this point in the history
…ormation and file synchronisation information respectively
  • Loading branch information
xxxxibo committed Jan 15, 2024
1 parent 80366f4 commit d79d56b
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
118 changes: 118 additions & 0 deletions apiserver/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apiserver/graph/generated/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apiserver/graph/schema/versioned_dataset.gql
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ query getVersionedDataset($name: String!, $namespace: String!, $fileInput: FileF
creationTimestamp
released
syncStatus
syncMsg
dataProcessStatus
dataProcessMsg
files(input: $fileInput){
totalCount
hasNextPage
Expand Down Expand Up @@ -81,7 +83,9 @@ query listVersionedDatasets($input: ListVersionedDatasetInput!, $fileInput: File
creationTimestamp
released
syncStatus
syncMsg
dataProcessStatus
dataProcessMsg
files(input: $fileInput){
totalCount
hasNextPage
Expand Down
4 changes: 4 additions & 0 deletions apiserver/graph/schema/versioned_dataset.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ type VersionedDataset {

"""文件的同步状态, Processing或者'' 表示文件正在同步,Succeede 文件同步成功,Failed 存在文件同步失败"""
syncStatus: String
"""文件同步状态信息,表示同步的错误信息"""
syncMsg: String

"""数据处理状态,如果为空,表示还没有开始,processing 处理中,process_fail处理失败,process_complete处理完成"""
dataProcessStatus: String
"""数据处理信息,如果版本数据处理状态失败时,显示失败原因"""
dataProcessMsg: String
}

"""
Expand Down
4 changes: 4 additions & 0 deletions apiserver/pkg/versioneddataset/versioned_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ func versionedDataset2model(obj *unstructured.Unstructured) (*generated.Versione

vds.Version = versioneddataset.Spec.Version
vds.SyncStatus = new(string)
vds.SyncMsg = new(string)
vds.DataProcessStatus = new(string)
vds.DataProcessMsg = new(string)
first := true
for _, cond := range versioneddataset.Status.Conditions {
if cond.Type == v1alpha1.TypeReady {
*vds.SyncStatus = string(cond.Reason)
*vds.SyncMsg = cond.Message
}
if cond.Type == v1alpha1.TypeDataProcessing {
*vds.DataProcessStatus = string(cond.Reason)
*vds.DataProcessMsg = cond.Message
}
if !cond.LastTransitionTime.IsZero() {
if first || vds.UpdateTimestamp.Before(cond.LastSuccessfulTime.Time) {
Expand Down

0 comments on commit d79d56b

Please sign in to comment.