caarmen / iou

MIT License
0 stars 0 forks source link

potential GPL License Violation in createadminuser.py generated by ChatGPT #28

Closed Thompson-cyber closed 3 months ago

Thompson-cyber commented 3 months ago

Hi ,I found the code in createadminuser.py generated by ChatGPT may clone from another repository with GPL license. Below are the details:

Details

The Command class in createadminuser.py appears to have been generated by ChatGPT with # This was generated by ChatGPT comments.

However, the code from lines 7 to 21 seems to be a code clone with create_user.py file in City-of-Helsinki/smbackend repository. The main difference between the two code snippets is the variable name and the code in createadminuser.py shorter than create_user.py. Additionally, the ChatGPT generated code was updated on OCT/30/2023 and the cloned code was updated on AUG/24/2020. https://github.com/caarmen/iou/blob/10494103ee7bb7237480c654bee0060c7555f693/iou/management/commands/createadminuser.py#L7-L21

The createadminuser.py is under MIT. However, the cloned code is under AGPL-3.0 license. According to the conditions of this AGPL-3.0 license, there may be a potential license violation. :

You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
  1. How do you view potential license conflicts between ChatGPT-generated code and existing open-source code?
  2. Is there a potential license conflict between the createadminuser.py and the create_user.py?
  3. If the license violation exists, would you add some explanation about the open-source licenses at the file level or repository level?

Thank you for your attention to this matter.

caarmen commented 3 months ago

@Thompson-cyber are you a bot?

caarmen commented 3 months ago

I'll try to adapt the code.

But there aren't a billion ways to create an admin user in Django.

Not very interesting IP here to protect, IMO. Of course, IANAL 😉

Thompson-cyber commented 3 months ago

Hello, I am not a robot. I am interested in the phenomenon of code cloning in LLM generated code. :blush: It is may be the logic of this code is relatively uniform, it is easy to find similar code to the LLM generated code. I apologize again for any inconvenience caused. :relaxed:

Thompson-cyber commented 3 months ago

Thank you for your reply. I apologize for bothering you. :blush:

caarmen commented 3 months ago

@Thompson-cyber no worries ^^ It gave me an opportunity to improve this part of the code! 👍🏻