Skip to content

[Bug][CircleCI] Need better error handling in convertWorkflows when API is malformed #8309

Description

@magichair

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Running off of devlake.docker.scarf.sh/apache/devlake:main_250221_154524_8f654df I am unable to do an initial Collect Data of a CircleCI project (without some serious manual DB gymnastics during the sync).

Logs from the convertWorkflows job failure:

devlake-1  | time="2025-02-24 21:46:16" level=error msg=" [pipeline service] [pipeline #10] [task #74] run task failed with panic\n\tcaused by: run task failed with panic (github.com/apache/incubator-devlake/core/models/common.(*Iso8601Time).ToTime:120)\n\tWraps: (2) runtime error: invalid memory address or nil pointer dereference\n\tError types: (1) *hintdetail.withDetail (2) runtime.errorString"

For some reason the CreatedDate comes back as Null (well, a lot of things are missing in this particular entry).

Here's what I've found so far digging into this particular entry in the raw and tool tables and also from the CircleCI API directly for this weird workflow.

Here's what CircleCI tells me about this workflow from https://circleci.com/api/v2/pipeline/<GUID REDACTED>/workflow (fields redacted):

{
  "next_page_token" : null,
  "items" : [ {
    "pipeline_id" : "<GUID REDACTED>",
    "id" : null,
    "name" : null,
    "project_slug" : "gh/org-name/repo-name",
    "status" : null,
    "started_by" : null,
    "pipeline_number" : 6561,
    "created_at" : null,
    "stopped_at" : null
  } ]
}

What do you expect to happen

I expect an initial sync of CircleCI to complete successfully.

How to reproduce

Unfortunately, I don't have a public project with pipelines failing. However, there may be a way to write a test case using the raw CircleCI API response provided above (with a mock GUID).

Anything else

No response

Version

devlake.docker.scarf.sh/apache/devlake:main_250221_154524_8f654df

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/pluginsThis issue or PR relates to pluginsdevopsSomething about CI/CD (devops)type/bugThis issue is a bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions