Skip to content

feat: gitlab-ci#2633

Merged
warren830 merged 2 commits into
apache:mainfrom
merico-ai:gitlab-ci
Aug 3, 2022
Merged

feat: gitlab-ci#2633
warren830 merged 2 commits into
apache:mainfrom
merico-ai:gitlab-ci

Conversation

@mappjzc
Copy link
Copy Markdown
Contributor

@mappjzc mappjzc commented Jul 29, 2022

Summary

Add CollectApiJobs
Add ExtractApiJobs
Alert _tool_gitlab_pipelines

Does this close any open issues?

relates to #2583

Screenshots

Include any relevant screenshots here.

Other Information

Any other information that is important to this PR.

@mappjzc mappjzc force-pushed the gitlab-ci branch 5 times, most recently from 21a6181 to 979ca59 Compare August 1, 2022 16:39
Add CollectApiJobs
Add ExtractApiJobs
Alert _tool_gitlab_pipelines

Nddtfjiang <zhicheng.jiang@merico.dev>
Copy link
Copy Markdown
Contributor

@warren830 warren830 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, some minor issues need to be fixed

1,485865876,12345678,2022-03-07T08:04:56.406+00:00,failed,refs/merge-requests/74/head,db45efd231dbaca1337bd29bc1f65f404754e6bd,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485865876,480,,,,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_pipeline,168,
1,485877118,12345678,2022-03-07T08:22:48.943+00:00,failed,refs/merge-requests/74/head,09f81b1b2d083411c0bfecd32d7728479b594503,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485877118,289,,,,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_pipeline,169,
1,485905167,12345678,2022-03-07T09:02:09.994+00:00,failed,refs/merge-requests/74/head,cce432655861efafcd05edc8de09e305c772d2b8,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485905167,687,,,,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_pipeline,170,
1,485932863,12345678,2022-03-07T09:34:57.476+00:00,success,refs/merge-requests/74/head,12fc3a42080bb98ca520817bd4fe0ca33c0bb279,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485932863,398,,,,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_pipeline,171,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'd better do e2e after we finish design

}

func (*alertPipeline) Up(ctx context.Context, db *gorm.DB) error {
err := db.Migrator().DropColumn(&archived.GitlabPipeline{}, "started_at")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep started_at and finished_at, we only need to add prefix for created_at which might be conflict to our devlake created_at

if err != nil {
return err
}
err = db.Migrator().DropColumn(&archived.GitlabPipeline{}, "finished_at")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

return err
}

err = db.Migrator().AddColumn(&GitlabPipeline20220729{}, "gitlab_finished_at")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

return err
}

err = db.Migrator().AddColumn(&GitlabPipeline20220729{}, "gitlab_started_at")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

"gorm.io/gorm"
)

type alertPipeline struct{}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about using modifyCiCD, and also change the file name

Comment thread plugins/gitlab/models/pipeline.go Outdated

GitlabCreatedAt *time.Time
GitlabUpdatedAt *time.Time
GitlabStartedAt *time.Time
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep started_at and finished_at

Status: pipeline.Status,
GitlabCreatedAt: helper.Iso8601TimeToTime(pipeline.CreatedAt),
GitlabUpdatedAt: helper.Iso8601TimeToTime(pipeline.UpdatedAt),
GitlabStartedAt: helper.Iso8601TimeToTime(pipeline.StartedAt),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep started_at and finished_at

revert GitlabStartedAt and GitlabFinishedAt to StartedAt and FinishedAt
Copy link
Copy Markdown
Contributor

@warren830 warren830 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@warren830 warren830 merged commit e00e728 into apache:main Aug 3, 2022
@warren830 warren830 deleted the gitlab-ci branch August 3, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants