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

[Bug][Config-UI] subtask calculateChangeLeadTime unable to handle NULL values #8217

Open
2 of 3 tasks
mdapke-insight opened this issue Nov 25, 2024 · 3 comments
Open
2 of 3 tasks
Assignees
Labels
component/config-ui This issue or PR relates to config-ui severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug

Comments

@mdapke-insight
Copy link

Search before asking

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

What happened

The subtask for my devlake config-UI pipeline fails with the error :
level=error msg=" [pipeline service] [pipeline #5907] [task #47939] subtask calculateChangeLeadTime ended unexpectedly\n\tWraps: (2) error adding result to batch (500)\n\tWraps: (3) Error 1292 (22007): Incorrect datetime value: '0000-00-00' for column 'first_commit_authored_date' at row 43 (500)\n\tWraps: (4) Error 1292 (22007): Incorrect datetime value: '0000-00-00' for column 'first_commit_authored_date' at row 43\n\tError types: (1) *hintdetail.withDetail (2) *hintdetail.withDetail (3) *hintdetail.withDetail (4) *mysql.MySQLError"

What do you expect to happen

Successful pipeline run

How to reproduce

A new column named first_commit_authored_date is introduced in the latest devlake versions (I am using v1.0.2-beta5 ) and this column was not in V0.21 and after upgrade, I am getting the above mentioned error .
The table containing this column is : project_pr_metrics

NULL values in this column are not being correctly handled by devlake.

Anything else

No response

Version

v1.0.2-beta5

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@mdapke-insight mdapke-insight added the type/bug This issue is a bug label Nov 25, 2024
Copy link

dosubot bot commented Nov 25, 2024

Hey @mdapke-insight! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's tackle this issue together!

The error you're encountering with the calculateChangeLeadTime subtask seems to be related to handling incorrect datetime values, specifically '0000-00-00', in the first_commit_authored_date column. This issue arises because the subtask does not handle NULL or default datetime values properly, which can lead to errors during processing.

To address this issue, you might consider implementing a check in the code to handle such default or NULL datetime values before they are processed. This could involve:

  1. Modifying the logic in the calculateChangeLeadTime subtask to check for and handle '0000-00-00' or NULL values in the first_commit_authored_date column.
  2. Ensuring that any datetime processing functions gracefully handle these cases, possibly by skipping the calculation or setting a default value.

Unfortunately, I couldn't find specific details on how NULL values are currently handled in the calculateChangeLeadTime subtask or any existing error handling mechanisms for incorrect datetime values in the repository. You might need to review the code and add the necessary checks to prevent this error from occurring.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added component/config-ui This issue or PR relates to config-ui severity/p1 This bug affects functionality or significantly affect ux labels Nov 25, 2024
@mdapke-insight
Copy link
Author

@klesh Can you help with this?

@klesh klesh self-assigned this Nov 28, 2024
@klesh
Copy link
Contributor

klesh commented Nov 28, 2024

Will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config-ui This issue or PR relates to config-ui severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants