fix(circleci): CircleCI Workflow nil check for CreatedDate#8310
Merged
Conversation
Adds a nil check during `convertWorkflows` task when CircleCI workflows API returns a weird malformed pipeline data with no created_date. Previously, the entire task fails and panics when trying to get convert a nil in ToTime util. Fixes Issue apache#8309
magichair
commented
Feb 26, 2025
| 1,89054eb2-8e85-4f5c-9a93-66d753a0e970,github/coldgust/coldgust.github.io,625ca634-68fe-4515-91f0-7ba8af51dc99,,say-hello-workflow,,,success,1c762fc2-b0fb-4fe2-97d2-5e54ddd1eba7,3,2023-03-25T17:39:23.000+00:00,2023-03-25T17:39:28.000+00:00,5 | ||
| 1,8971a56b-5547-4824-94dd-07bb467524c5,github/coldgust/coldgust.github.io,87aad008-1ad5-486a-8174-fdeed846561a,,say-hello-workflow,,,success,1c762fc2-b0fb-4fe2-97d2-5e54ddd1eba7,2,2023-03-25T17:12:18.000+00:00,2023-03-25T17:12:23.000+00:00,5 | ||
| 1,8fe60291-68f7-40e2-acec-d99bff4da713,github/coldgust/coldgust.github.io,afef32b3-5ffe-48d2-8d9e-46dcedd82554,,say-hello-workflow,,,success,1c762fc2-b0fb-4fe2-97d2-5e54ddd1eba7,1,2023-03-25T17:12:18.000+00:00,2023-03-25T17:12:22.000+00:00,4 | ||
| 1,b3b77371-e27a-4e93-a554-c728f757cd24,github/coldgust/coldgust.github.io,f5a2a6e8-4430-4935-8bec-77ca2b26c61d,,workflow,,,failed,,16,,,0 |
Contributor
Author
There was a problem hiding this comment.
It's not clear to me if it's going to be OK or not for there to be NULL created_date columns in the _tool_circleci_workflows table later in the pipeline for processing.
Contributor
Author
There was a problem hiding this comment.
Local testing, so far, doesn't show any obvious issues with the NULL values in the database in the _tool tables.
Contributor
|
LGTM, would you like to cherrypick it back to v1.0 by putting up another PR to the |
klesh
approved these changes
Feb 28, 2025
magichair
added a commit
to magichair/incubator-devlake
that referenced
this pull request
Feb 28, 2025
* fix(circleci): Add CircleCI workflow nil check for CreatedDate Adds a nil check during `convertWorkflows` task when CircleCI workflows API returns a weird malformed pipeline data with no created_date. Previously, the entire task fails and panics when trying to get convert a nil in ToTime util. Fixes Issue apache#8309 * Update to fix compile problems * Tweak the _tool csv to allow for the NULL value entries --------- Co-authored-by: John Ibsen <john@videa.ai>
Contributor
Author
|
Thanks for the merge! Cherry-pick ready now #8314 |
klesh
pushed a commit
that referenced
this pull request
Mar 7, 2025
… check for CreatedDate (#8310) (#8314) * fix(circleci): CircleCI Workflow nil check for CreatedDate (#8310) * fix(circleci): Add CircleCI workflow nil check for CreatedDate Adds a nil check during `convertWorkflows` task when CircleCI workflows API returns a weird malformed pipeline data with no created_date. Previously, the entire task fails and panics when trying to get convert a nil in ToTime util. Fixes Issue #8309 * Update to fix compile problems * Tweak the _tool csv to allow for the NULL value entries --------- Co-authored-by: John Ibsen <john@videa.ai> * Update with latest updates in circleci plugin for createdAt --------- Co-authored-by: John Ibsen <john@videa.ai> Co-authored-by: Klesh Wong <zhenmian.huang@merico.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added relevant documentation.N/Apr-type/bug-fix,pr-type/feature-development, etc.Summary
Add a nil check on CreatedDate during convertWorkflows task for edge case malformed CircleCI workflow objects.
Does this close any open issues?
Closes #8309
Screenshots
N/A - See #8309 for JSON snippets from CircleCI API responses
Other Information
I need to run the test suite to get a failing test first, I'm not sure that this extra raw data will be enough to hit this workflow bug.