gitlab-org--gitlab-foss/lib
Douwe Maan 99f08b3f72 Merge branch 'feature/cross-project-labels' into 'master'
Add support for cross project references for labels

## Summary

Support for cross project references for labels.

## Rationale

1.   Cross project label references are currently not supported in GitLab
1.   `to_reference` method signature in `Label` model breaks the abstraction introduced in `Referable`.

      `concerns/referable.rb:  def to_reference(_from_project = nil)`

      Signatures:

      ```
      label.rb:           def to_reference(format = :id)

      commit_range.rb:    def to_reference(from_project = nil)
      commit.rb:          def to_reference(from_project = nil)
      external_issue.rb:  def to_reference(_from_project = nil)
      group.rb:           def to_reference(_from_project = nil)
      issue.rb:           def to_reference(from_project = nil)
      merge_request.rb:   def to_reference(from_project = nil)
      milestone.rb:       def to_reference(from_project = nil)
      project.rb:         def to_reference(_from_project = nil)
      snippet.rb:         def to_reference(from_project = nil)
      user.rb:            def to_reference(_from_project = nil)
      ```

     This MR suggests using `def to_reference(from_project = nil, format: :id)` which makes use of keyword arguments and preserves abstract interface.

1.   We need support for cross project label references when we want to move issue to another project

     It may happen that issue description, system notes or comments contain reference to label and this reference will be invalid after moving issue to another project and will not be displayed correctly unless we have support for cross project references.

     Merge request that needs this feature: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2831


I think that cross project label references may be useful, (example: `Hey, see our issues for CI in GitLab CE! - gitab-org/gitlab-ce~"CI"`).

cc @JobV @DouweM @rspeicher 

See merge request !2966
2016-03-07 09:16:22 +00:00
..
api Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
assets
backup Make sure there is a connection before using ActiveRecord 2016-02-08 17:31:24 +01:00
banzai Merge branch 'feature/cross-project-labels' into 'master' 2016-03-07 09:16:22 +00:00
ci Move build eraseable API to proper API context 2016-02-19 17:24:59 +01:00
gitlab Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
omni_auth
rouge/formatters Remove custom Lexer. #3945 [ci skip] 2016-01-08 15:20:48 -05:00
support Merge branch 'doc_relative_url' into 'master' 2016-02-10 10:51:18 +00:00
tasks Reduce progress bar noise during brakeman run 2016-03-04 22:12:25 +00:00
award_emoji.rb Emoji picker: better alias handling 2015-12-24 11:28:55 +02:00
banzai.rb Add a PreProcessPipeline 2016-03-02 22:19:36 -05:00
disable_email_interceptor.rb
event_filter.rb
extracts_path.rb
file_size_validator.rb
file_streamer.rb
gitlab.rb
gt_one_coercion.rb
repository_cache.rb
static_model.rb
unfold_form.rb
uploaded_file.rb
version_check.rb Update version check images to use SVG 2016-01-05 14:35:29 -05:00