incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

`issues.parent_issue_id` should be null rather than empty string if not exists

Open narrowizard opened this issue 3 years ago • 5 comments

Description

I noticed that issues.parent_issue_id is now an empty string if not exists. I think it is more reasonable to be null as it's a nullable field.

Additional context

image

narrowizard avatar Apr 28 '22 08:04 narrowizard

Hey @warren830, I would like to work on this feature. Could you please assign it to me ?

iamppborah avatar Jul 02 '22 03:07 iamppborah

Here you are, happy coding

klesh avatar Jul 02 '22 06:07 klesh

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Aug 02 '22 00:08 github-actions[bot]

Any updates? @ppborah

narrowizard avatar Aug 03 '22 03:08 narrowizard

Apologies for the delay @narrowizard, but I am working on it

iamppborah avatar Sep 01 '22 16:09 iamppborah

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Oct 02 '22 00:10 github-actions[bot]

Is it possible to attach the Hactoberfest label ?

iamppborah avatar Oct 02 '22 05:10 iamppborah

@ppborah Done

klesh avatar Oct 08 '22 03:10 klesh

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Nov 26 '22 00:11 github-actions[bot]

@shubham-cmyk, would you like to take this ?

iamppborah avatar Nov 26 '22 07:11 iamppborah

Can I pick this up?

deepto98 avatar Dec 18 '22 03:12 deepto98

Please go ahead @deepto98 :)

iamppborah avatar Dec 18 '22 07:12 iamppborah

@deepto98 Thanks, happy coding

klesh avatar Dec 20 '22 01:12 klesh

Hello @klesh , is this issue still open? I want to work on this.

shenderaj9021 avatar Jan 02 '23 13:01 shenderaj9021

Hi @deepto98, how is it going on?

mindlesscloud avatar Jan 03 '23 14:01 mindlesscloud

@mindlesscloud I'll give this a try today, will let you know

deepto98 avatar Jan 05 '23 05:01 deepto98

@mindlesscloud @ppborah I forked this repo and am trying to setup the dev environment, by following the steps here: https://devlake.apache.org/docs/DeveloperManuals/DeveloperSetup/. In step 7, when I run make dev, I'm getting an error. Can you please help with this? The error:

...
go run main.go
Version:  dev
time="2023-01-07 03:44:08" level=info msg="migration initialized"
time="2023-01-07 03:44:08" level=info msg="plugin loaded ae"
time="2023-01-07 03:44:08" level=info msg="plugin loaded azure"
time="2023-01-07 03:44:08" level=info msg="plugin loaded bitbucket"
time="2023-01-07 03:44:08" level=info msg="plugin loaded customize"
time="2023-01-07 03:44:08" level=info msg="plugin loaded dbt"
time="2023-01-07 03:44:08" level=info msg="plugin loaded dora"
time="2023-01-07 03:44:08" level=info msg="plugin loaded feishu"
time="2023-01-07 03:44:08" level=info msg="plugin loaded gitee"
panic: plugin.Open("bin/plugins/gitextractor/gitextractor.so"): libgit2.so.1.3: cannot open shared object file: No such file or directory
Wraps: (2) plugin.Open("bin/plugins/gitextractor/gitextractor.so"): libgit2.so.1.3: cannot open shared object file: No such file or directory
Error types: (1) *hintdetail.withDetail (2) *errors.errorString

goroutine 1 [running]:
github.com/apache/incubator-devlake/services.Init()
        /workspaces/incubator-devlake/services/init.go:73 +0x385
github.com/apache/incubator-devlake/api.CreateApiService()
        /workspaces/incubator-devlake/api/api.go:51 +0x2e
main.main()
        /workspaces/incubator-devlake/main.go:39 +0x7e
exit status 2
make: *** [Makefile:83: run] Error 1

Environment : Github Codespaces, 16-core, 32GB RAM

deepto98 avatar Jan 07 '23 03:01 deepto98

@deepto98 Seems like libgit2 is missing, please follow this link to install

klesh avatar Jan 09 '23 06:01 klesh

@klesh Thanks, I think I had set it up, but trying this once more

deepto98 avatar Jan 09 '23 06:01 deepto98

@deepto98 I see, try the LD_LIBRARY_PATH variable, the path of the libgit2 may vary from OS to OS, try locating the libgit2.so first, and set it to the variable before you launching the devlake

klesh avatar Jan 09 '23 08:01 klesh

@klesh Oh okay, I got the project running, and am trying to understand the implementation of ticket.Issue. The field parent_issue_id is defined here, where it has type string: https://github.com/apache/incubator-devlake/blob/ad6d65ecaefbf2d7ca6b705c11dd7a4bf921140d/models/domainlayer/ticket/issue.go#L43 . I think the issue is persisted from here: https://github.com/apache/incubator-devlake/blob/ad6d65ecaefbf2d7ca6b705c11dd7a4bf921140d/plugins/webhook/api/issue.go#L156-L160 If we are to truncate empty strings to null, I found this type https://pkg.go.dev/database/sql#NullString, which can be used. However, it would probably affect the existing rows too. Can you help with how it can be implemented? Maybe the type has to be truncated to NULL, when the rows are fetched for the SELECT query, instead of changing the model itself?

deepto98 avatar Jan 09 '23 09:01 deepto98

You can convert the

ParentIssueId string gorm:"type:varchar(255)"

to

ParentIssueId *string gorm:"type:varchar(255)"

Then I think you can make pass the nil

shubham-cmyk avatar Jan 09 '23 09:01 shubham-cmyk

@shubham-cmyk Thanks, will try this.

deepto98 avatar Jan 09 '23 20:01 deepto98

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Feb 09 '23 00:02 github-actions[bot]

This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.

github-actions[bot] avatar Feb 17 '23 00:02 github-actions[bot]