Skip to content

fix(circleci): correct column name in incremental collection WHERE clause#8766

Open
jbsmith7741 wants to merge 1 commit intoapache:mainfrom
jbsmith7741:circleci_createdat
Open

fix(circleci): correct column name in incremental collection WHERE clause#8766
jbsmith7741 wants to merge 1 commit intoapache:mainfrom
jbsmith7741:circleci_createdat

Conversation

@jbsmith7741
Copy link
Copy Markdown
Contributor

@jbsmith7741 jbsmith7741 commented Mar 13, 2026

Summary

Fixes a MySQL error that causes every incremental CircleCI sync to fail
after the first successful run.

Both workflow_collector.go and job_collector.go build a
WHERE created_date > ? clause when isIncremental = true, but the
actual column in _tool_circleci_workflows is created_at (derived
from the Go struct field CircleciWorkflow.CreatedAt).

Fix: change the two WHERE clause strings from created_date to
created_at to match the actual schema. No model changes, no
migration scripts, and no other files are touched.

Does this close any open issues?

Closes #8497

Screenshots

NA

Other Information

alternative solution would be to rename the column to create_date which would require a DB migration script and changes through the code. If desired I can switch to that solution, but this was the simplest fix with the less amount of code changes.

…ause.

  use already name columns created_at rather than created_date
  Fixes apache#8497
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. component/plugins This issue or PR relates to plugins pr-type/bug-fix This PR fixes a bug priority/high This issue is very important severity/p0 This bug blocks key user journey and function labels Mar 13, 2026
@klesh
Copy link
Copy Markdown
Contributor

klesh commented Mar 19, 2026

created_at is reserved for devlake to track when was the record got created in the database.
I think a better solution is to rename the column to created_date.
Duplicated to #8701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/plugins This issue or PR relates to plugins pr-type/bug-fix This PR fixes a bug priority/high This issue is very important severity/p0 This bug blocks key user journey and function size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][CircleCI] plugin fails on second (incremental) data collection due to SQL error: unknown column created_date

2 participants