Commit Graph

38 Commits

Author SHA1 Message Date
Yorick Peterse e1a3bf30b6
Rename ActiverecordSerialize cop
This cop has been renamed to ActiveRecordSerialize to match the way
"ActiveRecord" is usually written.
2017-07-06 12:01:36 +02:00
Grzegorz Bizon 0218a0bd23 Merge branch 'dm-update-discussion-diff-position' into 'master'
Update diff discussion position per discussion instead of per note

Closes #33157

See merge request !11833
2017-06-01 14:00:00 +00:00
Douwe Maan 09838ac626 Update diff discussion position per discussion instead of per note 2017-05-31 14:34:56 -05:00
Yorick Peterse cd74c1434e
Added Cop to blacklist the use of serialize
This Cop blacklists the use of ActiveRecord's "serialize" method, except
for cases where we already use this.
2017-05-31 14:03:37 +02:00
Robert Speicher 8e2fefc6c4 Merge branch 'dm-diff-cleanup' into 'master'
Clean up diff rendering

See merge request !11390
2017-05-25 22:15:57 +00:00
Douwe Maan ab91f76e8b Add system note with link to diff comparison when MR discussion becomes outdated 2017-05-23 16:27:30 -05:00
Douwe Maan 7c479d88a9 Pass fallback_diff_refs to Diff::File instead of using view helpers 2017-05-23 15:37:05 -05:00
Douwe Maan f8fabfcc6f Allow commenting on older versions of the diff and comparisons between diff versions 2017-05-03 14:47:21 -05:00
Douwe Maan b202b42cfe Link to outdated diff in older MR version from outdated diff discussion 2017-04-08 14:37:46 -05:00
Douwe Maan cc656a1199 Refactor resolvability checks based on type 2017-04-06 10:51:45 -05:00
Douwe Maan 21e10888c3
Address review comments 2017-04-05 17:44:14 +01:00
Douwe Maan bb8cc94668
Don't use original_discussion_id 2017-04-05 17:44:14 +01:00
Douwe Maan 2058e71e63
Extract commonalities between DiffDiscussion and LegacyDiffDiscussion 2017-04-05 17:44:14 +01:00
Douwe Maan 79889a6aa3
Add specs 2017-04-05 17:44:14 +01:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01:00
Douwe Maan 7d4b52b27d Enable Style/WordArray 2017-02-23 09:32:41 -06:00
Alejandro Rodríguez ea155ccc3e Optimize discussion notes resolving and unresolving
Use `update_all` to only require one query per discussion to
update the notes resolved status. Some changes had to be made to
the discussion spec to accout for the fact that notes are not
individually updated now
2016-09-06 12:14:09 -03:00
Sean McGivern 9b57ad382e Move #to_discussion to NoteOnDiff 2016-08-30 16:30:42 +01:00
Douwe Maan d741303a59 Call `set_discussion_id` again in DiffNote `before_validation` because the order is important 2016-08-19 18:24:12 -05:00
Douwe Maan 080924f979 Fix bug where notes weren’t shown in discussion when the code had changed after creation 2016-08-19 12:38:40 -05:00
Douwe Maan 6a355d451e Improve performance of MR show page 2016-08-18 19:08:59 -05:00
Connor Shea 2df34c20cb
Fix a lingering conflict. 2016-08-17 12:29:05 -06:00
Connor Shea d8654744cd
Merge branch 'master' into diff-line-comment-vuejs 2016-08-17 12:10:09 -06:00
Douwe Maan 4a13aa9f34 Store discussion_id on Note for faster discussion lookup. 2016-08-17 12:16:46 -05:00
Douwe Maan 41007f6d3c Address review feedback 2016-08-16 11:04:26 -05:00
Sean McGivern 427e724698 Don't allow resolving invalid conflicts
An MR can only be resolved in the UI if:
- It has conflicts.
- It has valid diff_refs (in other words, it supports new diff notes).
- It has no conflicts with one side missing.
- It has no conflicts in binary files.
- It has no conflicts in files too large to display.
- It has no conflicts containing invalid conflict markers.
2016-08-12 23:24:48 +03:00
Douwe Maan c80f5e0a1c Add specs for new Note and DiffNote methods. 2016-08-12 00:16:38 -05:00
Douwe Maan 538e66d71c Merge branch 'master' into diff-line-comment-vuejs
# Conflicts:
#	app/models/discussion.rb
#	db/schema.rb
2016-08-03 15:32:00 -07:00
Paco Guzman 8716ff7f63 Speedup DiffNote#active? on discussions, preloading noteables and avoid touching git repository to return diff_refs when possible
- Preloading noteable we share the same noteable instance when more than one 
discussion refers to the same noteable.
- Any other call to that object that is cached in that object will be for any 
discussion.
- In those cases where merge_request_diff has all the sha stored to build a diff_refs get that 
diff_refs using directly those sha instead accessing to the git repository to first get the 
commits and later the sha.
2016-08-02 16:04:15 +02:00
Douwe Maan 1c2eefef3f Backend tweaks 2016-07-28 20:09:36 -06:00
Douwe Maan 35ce7aae01 Use sha1 of discussion ID. 2016-07-25 22:51:26 -06:00
Douwe Maan bbab5d014f Add methods to resolve diff notes and discussions 2016-07-25 22:37:22 -06:00
Douwe Maan 46cc034e05 Add resolved_at and resolved_by_id to DiffNote 2016-07-25 22:33:01 -06:00
Douwe Maan 6dd71888b3 Make `DiffNote#update_position` private 2016-07-07 16:13:55 -04:00
Douwe Maan d7e8479ee8 Keep around DiffNote position commits 2016-07-06 18:51:01 -04:00
Douwe Maan 710c488691 Automatically update diff note positions when MR is pushed to 2016-07-06 18:51:00 -04:00
Douwe Maan 8d7dc26d39 Support new diff notes on MRs with diff_refs 2016-07-06 18:51:00 -04:00
Douwe Maan 2f30d00432 Add DiffNote model 2016-07-06 18:50:59 -04:00