You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "Marco-De-Stefani (via GitHub)" <gi...@apache.org> on 2024/02/08 18:36:52 UTC

[PR] fix 6892 - avoid adding clause when table not present [incubator-devlake]

Marco-De-Stefani opened a new pull request, #6943:
URL: https://github.com/apache/incubator-devlake/pull/6943

   ### Summary
   Fixing [https://github.com/apache/incubator-devlake/issues/6892]
   by removing the clause if the table does not exists
   
   ### Does this close any open issues?
   Closes [https://github.com/apache/incubator-devlake/issues/6892]
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix 6892 - avoid adding clause when table not present [incubator-devlake]

Posted by "d4x1 (via GitHub)" <gi...@apache.org>.
d4x1 commented on PR #6943:
URL: https://github.com/apache/incubator-devlake/pull/6943#issuecomment-2277028767

   @meeroslaph  It's included in https://github.com/apache/incubator-devlake/releases/tag/v1.0.1-beta6.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix 6892 - avoid adding clause when table not present [incubator-devlake]

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on code in PR #6943:
URL: https://github.com/apache/incubator-devlake/pull/6943#discussion_r1556793982


##########
backend/plugins/gitlab/tasks/trigger_job_collector.go:
##########
@@ -83,10 +83,14 @@ func GetAllPipelinesIterator(taskCtx plugin.SubTaskContext, collectorWithState *
 		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)`,
+			`gp.project_id = ? and gp.connection_id = ? `,
 			data.Options.ProjectId, data.Options.ConnectionId,
 		),
 	}
+
+	if db.HasTable("_raw_gitlab_api_trigger_job") {
+		clauses = append(clauses, dal.Where("and gp.gitlab_id not in (select json_extract(tj.input, '$.GitlabId') as gitlab_id from _raw_gitlab_api_trigger_job tj)"))

Review Comment:
   Please remove the `and` at the beginning of the sql



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix 6892 - avoid adding clause when table not present [incubator-devlake]

Posted by "d4x1 (via GitHub)" <gi...@apache.org>.
d4x1 commented on PR #6943:
URL: https://github.com/apache/incubator-devlake/pull/6943#issuecomment-1935200400

   LGTM.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix 6892 - avoid adding clause when table not present [incubator-devlake]

Posted by "meeroslaph (via GitHub)" <gi...@apache.org>.
meeroslaph commented on PR #6943:
URL: https://github.com/apache/incubator-devlake/pull/6943#issuecomment-2275501833

   Is this fix going to be included into any release?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix 6892 - avoid adding clause when table not present [incubator-devlake]

Posted by "d4x1 (via GitHub)" <gi...@apache.org>.
d4x1 merged PR #6943:
URL: https://github.com/apache/incubator-devlake/pull/6943


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org