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

[issue_tracker] Add attachments to issues #5394

Merged
merged 137 commits into from
Feb 27, 2020

Conversation

maltheism
Copy link
Member

@maltheism maltheism commented Oct 29, 2019

Brief summary of changes

  1. Comments are now always visible when viewing an issue.
  2. Issues can now have attachments associated with them.
  • Attachment is associated with a sha1 hash.

Testing instructions (if applicable)

  1. Checkout PR.
  2. Make an issue.
  3. Add an attachment to the issue.

@maltheism maltheism added the Category: Feature PR or issue that aims to introduce a new feature label Oct 29, 2019
@maltheism maltheism added the State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed label Oct 29, 2019
Copy link
Contributor

@johnsaigle johnsaigle left a comment

Choose a reason for hiding this comment

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

I'm sorry to ask for this but I think pretty much all of the PHP will need to be redone. Let me know if you have any questions about the points below.

Additionally:

  • I don't think there's any purpose in using cryptographically unique identifiers here. Regular MySQL IDs are just fine.
  • Related: we don't need a new openssl dependency for generating secure random numbers. The code example you've used is four years old. random_int() is fine for such things.
  • You've committed two ZIP files that should be removed (I'd advise against using git add -A)
  • All new functions need type hints; new PHP files should declare strict types

I'd recommend refactoring the Issue Tracker to use Request and Response Interfaces in the newer style and from there making use of the new File Uploader class I linked.

@maltheism
Copy link
Member Author

maltheism commented Oct 29, 2019

Hey @johnsaigle the reason I went with the code I did was because the issue_tracker module does need to be refactored. I thought it would be best to add the features before that task or it would make the task much bigger. I'm not sure how path manipulation would happen with this PR but I didn't see permission checks for the EditIssue.php and just used that as a template for the Attachment.php. I think refactoring after would be best for splitting the task into more easily reviewed PRs.
Also the UUIDs will be discussed at a LORIS meeting because there is a benefit to them that might be worthwhile or I wouldn't have done it.

@johnsaigle
Copy link
Contributor

johnsaigle commented Oct 29, 2019

It's a reasonably-sized task but I think it makes sense to implement the Response/Request interfaces first so that you can use the File Upload class. I think this is better than adding more onto something that should be redone anyway.

The security of it goes beyond permission checks. You can look into some merged PRs labelled with "Security" if you want some background.

You've brought up UUIDs before (discussion begins here). I think the points from that thread still stand.

@maltheism
Copy link
Member Author

@johnsaigle I spoke with @ridz1208 before writing the code. I even mentioned that PR in the discussion. I think there is a benefit and that I want to discuss at the Loris meeting.

@johnsaigle
Copy link
Contributor

For sure we can discuss it further there.

Regardless of the UUID portion, I still think a lot of this will need to be refactored.

In the case that the UUID part continues, you'll need to update and commit the composer.lock file. It would also be good to use a specific version of the SSL dependency.

@johnsaigle
Copy link
Contributor

Adding Needs Work due to the following points from my above review:

You've committed two ZIP files that should be removed (I'd advise against using git add -A)

All new functions need type hints; new PHP files should declare strict types

This PR is also using non-standard DB operations (I think copied from genomic browser if I'm not mistaken). This isn't advised (genomic browser needs updating).

These need to be fixed.

Everything else will be decided by further discussion.

@johnsaigle johnsaigle added the State: Needs work PR awaiting additional work by the author to proceed label Oct 30, 2019
@christinerogers christinerogers added the State: Needs documentation PR that needs a more exhaustive documentation to proceed label Oct 30, 2019
@christinerogers
Copy link
Contributor

feature change -> requires updates to module spec markdown and also Help text.
marking as Needs Documentation

@johnsaigle johnsaigle changed the title [issue_tracker] features requests from Leigh [issue_tracker] Add attachments to issues; fix bug where comments were not visible on issues Oct 30, 2019
@johnsaigle johnsaigle added the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Dec 3, 2019
@maltheism maltheism force-pushed the issue_tracker_major_leigh_features branch from d52c067 to 47805eb Compare December 9, 2019 17:11
@maltheism maltheism changed the base branch from major to master December 9, 2019 17:11
@maltheism maltheism removed the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Dec 9, 2019
@maltheism maltheism changed the title [issue_tracker] Add attachments to issues; fix bug where comments were not visible on issues [issue_tracker] Add attachments to issues Dec 9, 2019
@johnsaigle
Copy link
Contributor

I think there is a benefit and that I want to discuss at the Loris meeting.

This has been discussed in a LORIS meeting as of Dec. 10. The PR is now in @driusan's court to review.

@maltheism maltheism removed State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed State: Needs work PR awaiting additional work by the author to proceed labels Jan 13, 2020
@maltheism maltheism requested a review from jesscall January 15, 2020 20:18
@jesscall
Copy link
Contributor

jesscall commented Jan 15, 2020

I'm having issues manually testing this.
I believe it has something to do with this line and this other line. See #5839, I believe it wasn't removed during the cleanup

@johnsaigle johnsaigle added the State: Needs work PR awaiting additional work by the author to proceed label Jan 15, 2020
@maltheism maltheism force-pushed the issue_tracker_major_leigh_features branch from 74216f1 to 43bdf01 Compare January 15, 2020 23:46
@maltheism maltheism dismissed driusan’s stale review February 25, 2020 19:55

all suggestions added

Copy link
Collaborator

@driusan driusan left a comment

Choose a reason for hiding this comment

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

hopefully one last minor change..

modules/issue_tracker/jsx/IssueForm.js Outdated Show resolved Hide resolved
@maltheism
Copy link
Member Author

Hi @driusan, all requested changes have been added to the PR.

modules/issue_tracker/jsx/attachments/attachmentsList.js Outdated Show resolved Hide resolved
@maltheism
Copy link
Member Author

Hi @driusan, all the baseURL requested change has been added to the PR.

CHANGELOG.md Show resolved Hide resolved
Co-Authored-By: Dave MacFarlane <[email protected]>
@maltheism
Copy link
Member Author

Thanks @driusan updated

@driusan
Copy link
Collaborator

driusan commented Feb 27, 2020

This needs Travis to run on it to be merged

@maltheism
Copy link
Member Author

@driusan how do I get travis to start again. I'm wondering if it's a GitHub issue.

@driusan
Copy link
Collaborator

driusan commented Feb 27, 2020

No idea, all I know is that there's not even a yellow checkmark on the last 2 commits. Sometimes that means there was a GitHub hicup that can be fixed by closing and re-opening the PR, sometimes that means there's a conflict or misformed .travis.yml, and there are probably other potential reasons.

@maltheism maltheism closed this Feb 27, 2020
@maltheism maltheism reopened this Feb 27, 2020
@maltheism
Copy link
Member Author

@driusan resurrection of travis happened after closing & reopening.

@driusan driusan merged commit 6a7b0a0 into aces:master Feb 27, 2020
@ridz1208 ridz1208 added this to the 23.0.0 milestone Feb 27, 2020
@maltheism maltheism deleted the issue_tracker_major_leigh_features branch May 24, 2020 02:04
@maltheism maltheism removed their assignment May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Feature PR or issue that aims to introduce a new feature Passed manual tests PR has been successfully tested by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants