Commit Graph
46 Commits
Author SHA1 Message Date
Valery Sizov 0f30be02eb Merge remote-tracking branch 'origin/master' into ce_upstream 2015-10-23 13:01:19 +02:00
Douwe Maan 93fcddd7a7 Allow ReferenceExtractor to efficiently load references from multiple texts at once 2015-10-13 22:53:05 +02:00
Douwe Maan 72afcbcd37 Always allow references to the current project 2015-10-07 19:19:23 +02:00
Douwe Maan f42cfa9e87 Refactor reference gathering to use a dedicated filter 2015-10-07 17:00:48 +02:00
Dmitriy Zaporozhets 067673fbe7 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into master-ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-19 11:13:30 +02:00
Dmitriy Zaporozhets 680b087764 Merge master from CE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-17 14:01:32 +02:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 9f10943c1a Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets 0fd7d3ebe0 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-10 16:01:53 +02:00
Dmitriy Zaporozhets 44ac823e59 Improve tests to use real branches in merge requests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-04 17:20:26 +02:00
Dmitriy Zaporozhets f34e8a265a Fix JIRA integration
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-05 15:32:23 +02:00
Dmitriy Zaporozhets 935fc796d1 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	VERSION
	app/controllers/admin/application_settings_controller.rb
	app/controllers/omniauth_callbacks_controller.rb
	app/controllers/projects/project_members_controller.rb
	app/helpers/application_settings_helper.rb
	app/models/user.rb
	app/services/files/base_service.rb
	app/views/profiles/accounts/show.html.haml
	db/schema.rb
	doc/install/installation.md
	doc/update/6.x-or-7.x-to-7.11.md
	doc/workflow/README.md
	lib/gitlab/markdown/external_issue_reference_filter.rb
	lib/gitlab/reference_extractor.rb
	lib/gitlab/upgrader.rb
2015-06-05 11:40:36 +02:00
Douwe Maan 94919c7ef6 Ignore references in blockquotes. 2015-06-02 13:17:21 +02:00
Douwe Maan fe78984f20 Actually ignore references in code blocks etc. 2015-06-02 13:17:11 +02:00
Robert Speicher 5a9c5520d9 Make use of to_reference in more specs 2015-05-26 15:49:22 -04:00
Robert Speicher 2cca78b175 Add external issues to ReferenceExtractor 2015-04-27 15:28:03 -04:00
Dmitriy Zaporozhets 2e243fc321 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	README.md
	VERSION
	app/controllers/projects/services_controller.rb
	app/controllers/projects/uploads_controller.rb
	app/services/test_hook_service.rb
	db/schema.rb
	features/steps/admin/settings.rb
	lib/gitlab/reference_extractor.rb
	spec/models/note_spec.rb
2015-04-27 11:53:31 +03:00
Robert Speicher 95ca6584d8 Add CommitRange directly to results Hash 2015-04-25 14:46:06 -04:00
Robert Speicher 8f8a8ab32b Refactor ReferenceExtractor to use pipeline filters 2015-04-25 14:40:12 -04:00
Douwe Maan 8ed7ac9d44 Use project.commit convenience method. 2015-04-24 12:29:36 +02:00
Dmitriy Zaporozhets f502b293e5 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	db/schema.rb
	spec/helpers/gitlab_markdown_helper_spec.rb
2015-04-24 11:22:54 +03:00
Robert Speicher a3c71d9898 Add spec for ReferenceExtractor#labels 2015-04-20 13:01:46 -04:00
Robert Speicher bc7c35cca0 Fix ReferenceExtractor spec 2015-04-20 13:01:43 -04:00
Dmitriy Zaporozhets d01d0c02b7 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/controllers/admin/application_settings_controller.rb
	app/controllers/groups/group_members_controller.rb
	app/controllers/projects/deploy_keys_controller.rb
	app/controllers/projects/project_members_controller.rb
	app/models/concerns/mentionable.rb
	app/models/project.rb
	app/models/project_team.rb
	app/models/service.rb
	app/views/admin/application_settings/_form.html.haml
	app/views/admin/groups/show.html.haml
	app/views/groups/group_members/_new_group_member.html.haml
	config/initializers/1_settings.rb
	db/schema.rb
	lib/gitlab/reference_extractor.rb
	spec/lib/gitlab/reference_extractor_spec.rb
2015-04-15 19:22:57 +03:00
Douwe Maan 16e1076e6f Update tests. 2015-04-03 18:03:34 +02:00
Douwe Maan c5d7660000 Fix errors. 2015-04-02 22:36:54 +02:00
Dmitriy Zaporozhets 3840549566 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
Conflicts:
	app/assets/javascripts/dispatcher.js.coffee
	features/admin/settings.feature
	features/steps/admin/settings.rb
	features/steps/user.rb
	features/user.feature
	lib/gitlab/git_access.rb
2015-03-25 09:16:09 -07:00
Dmitriy Zaporozhets fb30039668 Merge branch 'disable-ref-generation-in-code-blocks' into 'master'
Disable reference generation in preformatted/code blocks

### Summary

If a user adds text in code or preformatted text via Markdown or HTML that contains `#XXX`, the system adds a note that issue `XXX` was mentioned. This is particularly annoying because we often list gdb backtrace dumps into our issues, and many issues get mentioned as a result. For example:

```
(gdb) bt
#0  0x00000000004004c4 in second () at main.cc:6
#1  0x00000000004004d2 in first () at main.cc:11
#2  0x00000000004004dd in main () at main.cc:17
(gdb)
```

### Steps to reproduce

1. In an issue, write the above text using Markdown or HTML tags (e.g. `<code>`, `<pre>`).
2. Observe that [issue 1](https://gitlab.com/gitlab-org/gitlab-ce/issues/1) and [issue 2](https://gitlab.com/gitlab-org/gitlab-ce/issues/2) have a note that says they were mentioned.

### Expected behavior

Everything enclosed in the code blocks should be ignored as references.

### Observed behavior

Issues get referenced unnecessarily.

### Fix

I've made `reference_extractor.rb` strip out HTML and Markdown blocks before processing. I considered running the raw text through the entire Markdown processor, but this seems overkill and perhaps could lead to some unintended side effects.

See merge request !365
2015-03-22 23:36:07 +00:00
Dmitriy Zaporozhets 31af3f4003 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
Conflicts:
	spec/models/note_spec.rb
2015-03-19 23:21:50 -07:00
Stan Hu 83d552d50d Disable reference creation for comments surrounded by code/preformatted blocks 2015-03-19 14:37:35 -07:00
Stan Hu fad71576f9 Fix cross references when usernames, milestones, or project names contain underscores.
Remove emphasis from system notes to avoid Markdown conflicts in names.
2015-03-19 07:07:30 -07:00
Dmitriy Zaporozhets be4d340381 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Conflicts:
	Gemfile.lock
	app/controllers/uploads_controller.rb
	app/models/application_setting.rb
	app/models/project_services/issue_tracker_service.rb
	app/views/projects/services/_form.html.haml
	db/schema.rb
	doc/integration/README.md
	features/steps/groups.rb
2015-03-11 18:41:41 -07:00
Douwe Maan 4dddaef866 Automatically link commit ranges to compare page. 2015-03-07 00:46:13 +01:00
Marin Jankovski 7d9ef1124e Merge remote-tracking branch 'ce/master' into merge_ce
Conflicts:
	README.md
	app/assets/javascripts/project.js.coffee
	app/models/concerns/mentionable.rb
	app/models/project.rb
	app/models/project_services/jira_service.rb
	app/models/service.rb
	app/models/user.rb
	app/services/git_push_service.rb
	config/initializers/1_settings.rb
	config/routes.rb
	db/schema.rb
	doc/integration/README.md
	doc/integration/external-issue-tracker.md
	doc/integration/github.md
	spec/controllers/import/github_controller_spec.rb
	spec/helpers/merge_requests_helper.rb
	spec/lib/gitlab/upgrader_spec.rb
	spec/models/note_spec.rb
	spec/requests/api/groups_spec.rb
	spec/services/git_push_service_spec.rb
2015-02-16 11:50:30 -08:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Marin Jankovski 7db95489f5 Fix failing specs. 2015-02-06 10:31:00 -08:00
Marin Jankovski 3e875b05b4 Merge remote-tracking branch 'ce/master' into merge_ce
Conflicts:
	Gemfile
	Gemfile.lock
	app/assets/javascripts/project_new.js.coffee
	app/controllers/projects_controller.rb
	app/models/group.rb
	app/models/project.rb
	app/models/project_services/jira_service.rb
	app/models/project_team.rb
	app/models/user.rb
	app/services/files/create_service.rb
	app/views/layouts/nav/_admin.html.haml
	config/routes.rb
	db/schema.rb
	spec/models/jira_service_spec.rb
	spec/requests/api/projects_spec.rb
2015-01-29 11:34:43 -08:00
Marin Jankovski 9b5b334a79 Remove unused feature steps. 2015-01-26 16:04:08 -08:00
Jan-Willem van der Meer d9a8789166 Fix JIRA issue parsing 2014-10-15 07:49:35 +02:00
Dmitriy Zaporozhets f4d43ed3b1 Merge branch 'master' into ce-upstream
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/controllers/projects/services_controller.rb
	app/models/concerns/mentionable.rb
	app/models/project.rb
	app/models/user.rb
	app/views/admin/users/index.html.haml
	app/views/projects/services/_form.html.haml
	config/gitlab.yml.example
	config/initializers/1_settings.rb
	lib/gitlab/git_access.rb
	lib/gitlab/ldap/access.rb
	lib/gitlab/ldap/person.rb
	lib/gitlab/reference_extractor.rb
	spec/lib/gitlab/ldap/access_spec.rb
2014-10-14 18:23:51 +03:00
Vinnie Okada 2c46c4523f Track projects in ReferenceExtractor
Store both the project and identifier of extracted references.  This
prevents `ReferenceExtractor` from returning objects in the wrong
project for cross-project references.
2014-10-03 12:30:20 -05:00
Jacob Vosmaer 873127d6d0 Return JiraIssues in ReferenceExtractor#issues_for 2014-06-13 15:40:21 +02:00
Marin JankovskiandDmitriy Zaporozhets 6b04a5f910 Add support for Jira ticket mentions in format JIRA-123.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG-EE
2014-05-13 15:33:38 +03:00
Marin Jankovski 7bc054ec8a Add support for Jira ticket mentions in format JIRA-123. 2014-05-06 19:51:56 +02:00
Dmitriy Zaporozhets c227aa44f9 Make changes to tests
* project_with_code -> project
* project -> ermpty_project

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 21:03:52 +02:00
ash wilson c8a115c0e3 Link issues from comments and automatically close them
Any mention of Issues, MergeRequests, or Commits via GitLab-flavored markdown
references in descriptions, titles, or attached Notes creates a back-reference
Note that links to the original referencer. Furthermore, pushing commits with
commit messages that match a (configurable) regexp to a project's default
branch will close any issues mentioned by GFM in the matched closing phrase.
If accepting a merge request would close any Issues in this way, a banner is
appended to the merge request's main panel to indicate this.
2013-08-25 18:58:41 -04:00