Commit graph

13 commits

Author SHA1 Message Date
Robert Speicher
bc7c35cca0 Fix ReferenceExtractor spec 2015-04-20 13:01:43 -04: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
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
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
Douwe Maan
4dddaef866 Automatically link commit ranges to compare page. 2015-03-07 00:46:13 +01: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
9b5b334a79 Remove unused feature steps. 2015-01-26 16:04:08 -08: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
Marin Jankovski
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
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