Commit Graph

58 Commits

Author SHA1 Message Date
GitLab Bot 1b2e02ede9 Add latest changes from gitlab-org/gitlab@master 2020-11-17 21:09:19 +00:00
GitLab Bot ed7568cc80 Add latest changes from gitlab-org/gitlab@master 2020-10-16 09:09:06 +00:00
GitLab Bot 2f5c5b1081 Add latest changes from gitlab-org/gitlab@master 2020-10-08 12:08:31 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot ea335f33ff Add latest changes from gitlab-org/gitlab@master 2020-05-26 21:07:45 +00:00
GitLab Bot 47a2a65f34 Add latest changes from gitlab-org/gitlab@master 2020-05-26 06:08:20 +00:00
GitLab Bot 1219a9dce9 Add latest changes from gitlab-org/gitlab@master 2020-04-01 15:07:45 +00:00
GitLab Bot 0301a0cad0 Add latest changes from gitlab-org/gitlab@master 2020-03-13 06:09:37 +00:00
GitLab Bot c8f773a859 Add latest changes from gitlab-org/gitlab@master 2020-01-30 21:08:47 +00:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
GitLab Bot 6b75320f52 Add latest changes from gitlab-org/gitlab@master 2019-10-17 12:07:33 +00:00
Takuya Noguchi af5da7564e Replace 'JIRA' with 'Jira'
https://community.atlassian.com/t5/Jira-questions/Is-it-quot-JIRA-quot-or-quot-Jira-quot/qaq-p/681163

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-06-28 13:25:56 +00:00
Sean McGivern 0b9a229516 Freeze strings in ReferenceExtractor spec 2019-03-22 09:28:50 +00:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Sean McGivern 1fb49ccd7b Merge branch 'jprovazn-ignore-anchors' into 'master'
Use prefix for TableOfContents filter hrefs

Closes #38473

See merge request gitlab-org/gitlab-ce!15806
2017-12-08 14:20:31 +00:00
Jan Provaznik 3e83d9f73a Use prefix for TableOfContents filter hrefs
TableOfContents filter generates hrefs for each header in markdown,
if the header text consists from digits and redacted symbols only,
e.g. "123" or "1.0 then the auto-generated href has the same format
as issue references.

If the generated id contains only digits, then 'anchor-' prefix is
prepended to the id.

Closes #38473
2017-12-08 14:13:18 +01:00
Jarka Kadlecova 0c2fdb1c34 Refactor banzai to support referencing from group context 2017-12-06 19:16:22 +01:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Jarka Kadlecova 7bee7b848a Support both internal and external issue trackers 2017-07-24 08:13:43 +02:00
Ershad Kunnakkadan 3a23639bc0
Create directly_addressed Todos when mentioned in beginning of a line 2017-02-08 21:53:34 +05:30
Robert Speicher 80a6d2fda2 Use `:empty_project` where possible throughout spec/lib 2017-01-25 12:25:42 -05:00
Douwe Maan bf061d0aff
Merge branch 'issue_23548_dev' into 'master'
disable markdown in comments when referencing disabled features

fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23548

This MR prevents the following references when tool is disabled:

- issues
- snippets
- commits - when repo is disabled
- commit range - when repo is disabled
- milestones

This MR does not prevent references to repository files, since they are just markdown links and don't leak
information.

See merge request !2011

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-09 12:25:17 +01:00
Ilan Shamir 94135e6275 Remove JiraIssue model and replace references with ExternalIssue 2016-06-16 01:25:18 +03:00
Grzegorz Bizon 18f25bc942 Update reference unfolder according to recent ability changes
Commit 43d8bdb4f0 introduced additional
checks for permissions to read issue in references extractor.
2016-03-19 18:58:52 +01:00
Grzegorz Bizon 0115ad66d2 Merge branch 'master' into feature/issue-move
* master: (121 commits)
  Dedupe labels in labels selector in Dashboard pages
  Refactor colors and lists
  Add a safeguard in MergeRequest#compute_diverged_commits_count
  Fix an issue when the target branch of a MR had been deleted
  Add avatar to issue and MR pages header
  Cleanup somce css colors
  Re-group scss variables
  Refactor `Todo#target`
  Fixes issue with filter label missing on labels & milestones
  Rename `Todo#to_reference` to `Todo#target_reference`
  Fixed failing tests
  Updated controller with before_action Fixed other issues based on feedback
  Fixes issue on dashboard issues
  Full labels data in JSON
  Fixed issue with labels dropdown getting wrong labels
  Update CHANGELOG
  Use `Note#for_project_snippet?` to skip notes on project snippet
  Use `Commit#short_id` instead of `Commit.truncate_sha`
  Reuse `for_commit?` on conditional validations
  Update schema info comment on todo related files
  ...

Conflicts:
	app/models/issue.rb
	db/schema.rb
	spec/models/issue_spec.rb
2016-03-19 18:50:15 +01:00
Grzegorz Bizon 9b13ce0b7a Improvements in issue move feaure (refactoring)
According to endbosses' suggestions.
2016-03-19 18:46:01 +01:00
Douglas Barbosa Alexandre 43d8bdb4f0 Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
Grzegorz Bizon fd8394faae Move reference unfolder for GFM to separate class 2016-03-17 07:39:15 +01:00
Drew Blessing f177aaa5fa Backport JIRA service 2015-12-18 14:19:48 -06:00
Douwe Maan 13d6bab177 Tag lib specs 2015-12-09 11:55:42 +01: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 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 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
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 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
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
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