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

fix(copyright): Make check strict #2011

Merged

Conversation

GMishx
Copy link
Member

@GMishx GMishx commented Jun 12, 2021

Description

While editing/fetching the copyrights, the association with uploadtree_pk was not very strong. It caused issue while editing copyrights from a single file view instead of aggregated table view.

This causes problem when same upload has duplicate files. Since copyright table holds information of pfile_fk and agent_fk only, there will be only one entry for a copyright in those files. But if someone made some changes, the copyright_event is involved which takes uploadtree_fk into account. This caused ambiguity on which copyright to show.

Changes

  1. Add checks for uploadtree_fk while fetching copyrights to get only relevant copyrights.
  2. Update the check while inserting edits in copyright_event to make sure all uploadtree_fk are updated.

How to test

  1. Upload a package with duplicate files which contains copyright texts.
  2. Update some copyrights from single file view.
  3. See if the updates are reflected in the aggregated table view.
  4. Editing copyrights from aggregated view should be consistent as well.

@shaheemazmalmmd
Copy link
Member

Copyright loading issue with new changes.

To Reproduce :

upload FCKeditor go to sample folder and default.html page(See highlight). See the entry in database(using uploadtree_pk) and not in UI.

screenShot17

@GMishx
Copy link
Member Author

GMishx commented Jun 15, 2021

Copyright loading issue with new changes.

To Reproduce :

upload FCKeditor go to sample folder and default.html page(See highlight). See the entry in database(using uploadtree_pk) and not in UI.

screenShot17

Hello @shaheemazmalmmd , unfortunately I can not recreate the issue on my machine. I just uploaded another package 30-seconds-of-code (can not find the source for FCKeditor) and this is what it says:
image

Also seeing from your snapshot, the branch and commit seems to be wrong. Can you please check that?

Add uploadtree_fk and hash checks whenver required.

Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
@GMishx GMishx force-pushed the fix/copyright/create-itemids branch from eb1394c to 7343edb Compare June 15, 2021 18:06
Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Copy link
Member

@shaheemazmalmmd shaheemazmalmmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Needs test

@shaheemazmalmmd shaheemazmalmmd merged commit 48594ad into fossology:master Jun 17, 2021
@GMishx GMishx deleted the fix/copyright/create-itemids branch June 17, 2021 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants