Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gitlab) fetch trigger jobs #6167

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Conversation

Marco-De-Stefani
Copy link
Contributor

@Marco-De-Stefani Marco-De-Stefani commented Sep 28, 2023

Summary

Add the trigger jobs to the jobs already fetched from GitLab

Does this close any open issues?

Closes #6135

Screenshots

data fetched from a real GitLab instance:
image

The processing of the data after the collection is tested with the trigger_job_test.go

@abeizn
Copy link
Contributor

abeizn commented Jan 5, 2024

I will merge it after solving the issue #5920

@abeizn
Copy link
Contributor

abeizn commented Jan 23, 2024

LGTM, to be merged after v0.21-beta1 released

@abeizn abeizn merged commit e121d8b into apache:main Jan 25, 2024
dal.Select("gp.gitlab_id, gp.gitlab_id as iid"),
dal.From("_tool_gitlab_pipelines gp"),
dal.Where(
`gp.project_id = ? and gp.connection_id = ? and gp.gitlab_id not in (select json_extract(tj.input, '$.GitlabId') as gitlab_id from _raw_gitlab_api_trigger_job tj)`,
Copy link
Contributor

Choose a reason for hiding this comment

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

When running this SQL, table _raw_gitlab_api_trigger_job doesn't exist.

@d4x1
Copy link
Contributor

d4x1 commented Jan 29, 2024

@Marco-De-Stefani I encounter a problem when running the latest main branch and the log is

time="2024-01-29 19:39:08" level=info msg=" [pipeline service] [pipeline #8] [task #59] finished step: 17 / 35"
time="2024-01-29 19:39:08" level=info msg=" [pipeline service] [pipeline #8] [task #59] executing subtask collectApiTriggerJobs"
time="2024-01-29 19:39:08" level=info msg="\x1b[31;1m/Users/houlinwei/Code/go/src/github.com/merico-dev/lake-feat-6854/backend/impls/dalgorm/dalgorm.go:188 \x1b[35;1mError 1146 (42S02): Table 'lake._raw_gitlab_api_trigger_job' doesn't exist\n\x1b[0m\x1b[33m[2.624ms] \x1b[34;1m[rows:-]\x1b[0m SELECT gp.gitlab_id, gp.gitlab_id as iid FROM _tool_gitlab_pipelines gp WHERE gp.project_id = 50751699 and gp.connection_id = 1 and gp.gitlab_id not in (select json_extract(tj.input, '$.GitlabId') as gitlab_id from _raw_gitlab_api_trigger_job tj)"
time="2024-01-29 19:39:08" level=error msg=" [pipeline service] [pipeline #8] [task #59] subtask collectApiTriggerJobs ended unexpectedly\n\tWraps: (2) Error 1146 (42S02): Table 'lake._raw_gitlab_api_trigger_job' doesn't exist (500)\n\tWraps: (3) Error 1146 (42S02): Table 'lake._raw_gitlab_api_trigger_job' doesn't exist\n\tError types: (1) *hintdetail.withDetail (2) *hintdetail.withDetail (3) *mysql.MySQLError"
time="2024-01-29 19:39:08" level=info msg=" [task service] run task #61 in background "

And I think SQL in function GetAllPipelinesIterator is the root cause. Please check the codes.
I have created an issue #6892, hope it will be fixed.
cc @abeizn

ViktorGrigorov7 pushed a commit to ViktorGrigorov7/incubator-devlake that referenced this pull request Feb 7, 2024
* feat(gitlab): fetching the "trigger" job as well

* feat(gitlab): add test for parsing trigger job
@Marco-De-Stefani Marco-De-Stefani deleted the feat-6135 branch February 7, 2024 10:27
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.

[Feature][Gitlab] Parsing CI/CD trigger jobs
3 participants