Commit Graph

1383 Commits

Author SHA1 Message Date
Lin Jen-Shin 07b9b80a88 Fix tests to use the new API 2016-12-08 19:11:52 +08:00
Valery Sizov f5d7a61760 Fixes ActionView::Template::Error: undefined method `text?` for nil:NilClass 2016-12-02 14:03:30 +02:00
Douwe Maan ec4e7d9a9f Merge branch 'process-commit-worker-improvements' into 'master'
Pass commit data to ProcessCommitWorker

This changes `ProcessCommitWorker` so that it takes a Hash containing commit data instead of a commit SHA. This means the worker doesn't have to access Git just to process a commit message (and other data it may use). This in turn should solve the problem of ending up with 15 000-something jobs in the `process_commit` queue that take forever to process.

See merge request !7744
2016-12-02 04:32:23 +00:00
Yorick Peterse 6b4d33566f
Pass commit data to ProcessCommitWorker
By passing commit data to this worker we remove the need for querying
the Git repository for every job. This in turn reduces the time spent
processing each job.

The migration included migrates jobs from the old format to the new
format. For this to work properly it requires downtime as otherwise
workers may start producing errors until they're using a newer version
of the worker code.
2016-12-01 13:36:06 +01:00
Douglas Barbosa Alexandre 8ca040d8ae Fix branch validation for GitHub PR where repo/fork was renamed/deleted 2016-12-01 00:03:12 -02:00
Douglas Barbosa Alexandre e7d794770a Improve Gitlab::GitAccessWiki spec with download access checks 2016-11-30 16:02:25 -02:00
Kamil Trzciński 35212deb06 Merge branch 'zj-issue-search-slash-command' into 'master'
Add issue search slash command

See merge request !7752
2016-11-29 11:04:17 +00:00
Douwe Maan 3bf34face4 Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'
Replace issue access checks with use of IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

⚠️ - Potentially untested  
💣 - No test coverage  
🚥 - Test coverage of some sort exists (a test failed when error raised)  
🚦 - Test coverage of return value (a test failed when nil used)  
 - Permissions check tested

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] 🚦 app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] 🚥 app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x]  app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x]  lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x]  lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x]  lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031
2016-11-28 21:26:23 -03:00
Yorick Peterse 746b6ec82d Merge branch 'timeout-merge-request-for-binary-file' into 'master'
Fix: Timeout creating and viewing merge request for binary file

See merge request !7713
2016-11-25 16:19:03 +00:00
Z.J. van de Weg 6a08de7386 Add issue search slash command
One of many requested in: gitlab-org/gitlab-ce#24768
2016-11-25 15:41:28 +01:00
Valery Sizov 847ada36c4 Fix: Timeout creating and viewing merge request for binary file 2016-11-25 15:25:01 +02:00
Z.J. van de Weg d71ad49fc5 Accept a valid ref for issue show
For example, now we support `/gitlab issue show #1`. Where the # used
to trip the regex.
2016-11-25 12:33:57 +01:00
Lin Jen-Shin 9ad2dba250 Use Commit#author so we share logic and cache
Closes #24900
2016-11-24 02:33:55 +08:00
Sean McGivern 4646d453b3 Merge branch 'milestone_start_date' into 'master'
Add a starting date to milestones

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23704

See merge request !7484
2016-11-23 13:23:13 +00:00
Sean McGivern 1a45de3d45 Merge branch 'post_receive-any-email' into 'master'
post_receive: accept any user email from last commit

See merge request !7225
2016-11-23 12:45:11 +00:00
Valery Sizov 3789cfe056 Add a starting date to milestones 2016-11-23 13:41:04 +02:00
Ahmad Sherif 747959a832 Update ProjectTeam#max_member_access_for_user_ids to use project authorizations 2016-11-23 12:59:13 +02:00
Douwe Maan db02af3e24 Merge branch 'fix/cycle-analytics-plan-issue' into 'master'
Fix cycle analytics plan stage when commits are missing

Takes into account when commits are `nil` so the app doesn't throw an exception and also removes them.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24836

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !7694
2016-11-23 10:13:29 +00:00
James Lopez b938aa5cc8 Fix and relevant spec for plan stage breaking with nil commits 2016-11-23 09:10:04 +01:00
Kamil Trzciński a713c9c12c Merge branch 'zj-fix-trailing-whitespace-issue-create' into 'master'
Issue creation now accepts trailing whitespace

See merge request !7633
2016-11-22 16:57:12 +00:00
Kamil Trzciński 0f59075030 Merge branch 'fix/ci-linter-undefined-error' into 'master'
Fix undefined error in CI linter

## What does this MR do?

This MR fixes undefined error in CI linter.

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [x] Tests added for this feature/bug
  
## What are the relevant issue numbers?

Closes #24759

See merge request !7650
2016-11-22 09:20:45 +00:00
Grzegorz Bizon c048d5d2d9 Fix entry lookup in CI config inheritance rules 2016-11-22 09:09:38 +01:00
Grzegorz Bizon 4c34b4e517 Extend specs for global ci configuration entry 2016-11-22 09:05:16 +01:00
Z.J. van de Weg 3ff0575669 Issue creation now accepts trailing whitespace 2016-11-22 08:48:17 +01:00
Kamil Trzciński 0472bc66f3 Merge branch 'improve-deploy-message' into 'master'
Improve deploy message

## What does this MR do?
Improves deploy message to make it more descriptive and useable then what is already offered by deploy command.

## Does this MR meet the acceptance criteria?

- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

See merge request !7629
2016-11-21 21:53:39 +00:00
Kamil Trzcinski 41aa605d4e Improve deploy command message 2016-11-21 21:36:22 +01:00
Rémy Coutable 2449d787ad Merge branch 'chatops-deploy-command' into 'master'
Add deploy chat command

This adds a new ChatOps command:
```
/trigger deploy <environment> to <environment>
```

See merge request !7619
2016-11-21 20:27:58 +00:00
Kamil Trzciński 3c8d2148fc Merge branch 'feature/send-registry-address-with-build-payload' into 'master'
Send registry address with build payload

## What does this MR do?

Adds `registry_url` as a part of a build payload, when sending a response to a GitLab Runner which requested a new build.

## Are there points in the code the reviewer needs to double check?

Change in `lib/ci/api/entities.rb`.

## Why was this MR needed?

This is one of the steps needed to add support for private/protected registries hosted with GitLab CE/EE.

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Related to gitlab-org/gitlab-ci-multi-runner#1828, gitlab-org/gitlab-ci-multi-runner!386, gitlab-org/gitlab-ci-multi-runner#1434

See merge request !7474
2016-11-21 20:22:55 +00:00
Tomasz Maczukin 461195665b
Add Gitlab::Ci::Build::Credentials module with build credentials abstraction 2016-11-21 19:49:29 +01:00
Kamil Trzcinski d375e3f15b Fix specs and improve code readability 2016-11-21 18:22:03 +01:00
Sean McGivern 55ca2da768 Merge branch 'smarter-cache-invalidation' into 'master'
Smarter cache invalidation

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23550

See merge request !7360
2016-11-21 17:08:36 +00:00
Kamil Trzcinski a36d556137 Introduce deploy command that allows to start deployment from one environment to second one 2016-11-21 17:26:35 +01:00
Sean McGivern 80eaed1651 Merge branch 'fix/cycle-analytics-permissions' into 'master'
Added permissions per stage to cycle analytics endpoint

See merge request !7613
2016-11-21 16:07:27 +00:00
Yorick Peterse df5548e19e
Unify detecting of special repository files
This moves the logic of detecting special repository files (e.g. a
README or a Koding configuration file) to a single class:
Gitlab::FileDetector. Moving this logic into a single place allows this
to be re-used more easily.

This commit also changes Repository#gitlab_ci_yaml so that its cached
similar to other data (e.g. the Koding configuration file).
2016-11-21 12:51:40 +01:00
Sean McGivern b98193c55e Merge branch 'issue_5541' into 'master'
Allow to block JIRA events for commits and merge requests

implements #5541 

See merge request !7469
2016-11-21 11:07:46 +00:00
James Lopez 0fd397bba1 Added permissions per stage to cycle analytics endpoint 2016-11-21 10:49:05 +01:00
Kamil Trzciński cf0283c893 Merge branch 'fix/require-build-script-configuration-entry' into 'master'
Make job script a required configuration entry

## What does this MR do?

This MR makes a job script a required configuration entry.

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing

## What are the relevant issue numbers?

Closes #24575

See merge request !7566
2016-11-19 11:02:56 +00:00
Kamil Trzciński ffc5fc6a38 Merge branch 'zj-slash-commands-mattermost' into 'master'
Slash command for mattermost

Closes  #22540

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)


See merge request !7438
2016-11-18 18:06:36 +00:00
Rémy Coutable 03933cd279 Merge branch 'fix-tests-for-different-host' into 'master'
Use `Gitlab.config.gitlab.host` over `'localhost'`

Use `Gitlab.config.gitlab.host` over `'localhost'`

This would fix long standing failures running tests on
my development machine, which set `Gitlab.config.gitlab.host`
to another host because it's not my local computer. Now I
finally cannot withstand it and decided to fix them once and
for all.

See merge request !7562
2016-11-18 17:46:44 +00:00
Felipe Artur d399e1ae2b Allow enabling and disabling commit and MR events for JIRA 2016-11-18 15:17:51 -02:00
Douwe Maan 2717675fbc Merge branch 'bugfix/html-only-mail' into 'master'
add parsing support for incoming html email

## What does this MR do?
Fixes #18388 by adding support for parsing HTML email

## Are there points in the code the reviewer needs to double check?
The new class, Gitlab::Email::HTMLParser, which needs to translate the HTML content to text and also delete replies, as they are not necessarily in the correct format to be caught by EmailReplyParser. The solution I found that should work for any HTML-formatted email is to remove all `<table>` and `<blockquote>` tags. Actual `<table>` elements (to be interpreted by markdown) should already be encoded with e.g. `&lt;table&gt;` - the only failure mode is if there is an *actual* HTML table in the content itself, which we wouldn't be able to support easily anyways.

The gem `html2text` traverses the HTML tree and outputs text - and markdown in the case of HTML links or images.

See merge request !7397
2016-11-18 17:15:56 +00:00
Kamil Trzcinski 1db1896ed2 Rename mattermost_command to mattermost_slash_commands 2016-11-18 17:27:14 +01:00
Douwe Maan 2343b83098 Merge branch 'feature/cycle-analytics-events' into 'master'
Cycle Analytics: Events per stage

Adds list of events to each stage:

- Issue: list of issues created in the last XX days, that have been labeled or added to a milestone.
- Plan: list of commits that reference for the fist time an issue from the last stage.
- Code: list of MR created in this stage
- Test: List of unique builds triggered by the commits.
- Review: List of MR merged
- Staging: List of deployed builds
- Production: list of issues with the time from idea to production

Fixes #23449 

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !6859
2016-11-18 13:50:50 +00:00
Grzegorz Bizon bf25b5f69d Remove CI config helper with same name as an entry 2016-11-18 14:30:27 +01:00
Z.J. van de Weg c72c76fde3 Fix typos 2016-11-18 14:23:26 +01:00
Grzegorz Bizon 65724301e6 Make CI job script a required configuration entry 2016-11-18 14:14:41 +01:00
Lin Jen-Shin 9c4e0d6445 Use `Gitlab.config.gitlab.host` over `'localhost'`
This would fix long standing failures running tests on
my development machine, which set `Gitlab.config.gitlab.host`
to another host because it's not my local computer. Now I
finally cannot withstand it and decided to fix them once and
for all.
2016-11-18 20:17:10 +08:00
James Lopez f5b792e22e refactored updater and updated specs 2016-11-18 13:00:38 +01:00
James Lopez 0aa477884c fix small typo 2016-11-18 12:09:36 +01:00
James Lopez cb353d655b added new build updater, specs and refactored allowed_ids 2016-11-18 12:05:29 +01:00