Commit Graph

5456 Commits

Author SHA1 Message Date
Mark Chao a4ba973e24 Allow FoundBlob to access language from gitattributes
Extract language_from_git_attributes as a concern so it can
ben included in two blob classes.
2018-10-30 15:44:55 +08:00
Mark Chao 6580de78bb Add access to Blob's language from gitattributes
Ported from Highlight class since it as a concept is more related to
blob, and this allows more flexibility.
2018-10-30 15:44:55 +08:00
DJ Mountney 06b6daacb1 Merge remote-tracking branch 'origin/master' into dev-master 2018-10-29 14:37:19 -07:00
Jan Provaznik 5b0b73d922 Merge branch 'security-redact-links' into 'master'
[master] Redact unsubscribe links in issuable texts

See merge request gitlab/gitlabhq!2528
2018-10-29 16:10:32 +00:00
Imre Farkas b9652d8e4d [master] Persist only SHA digest of PersonalAccessToken#token 2018-10-29 16:06:45 +00:00
Jan Provaznik 107351e07a Merge branch 'sh-fix-hipchat-ssrf' into 'master'
[master] Prevent SSRF attacks in HipChat integration

See merge request gitlab/gitlabhq!2530
2018-10-29 16:05:25 +00:00
Alessio Caiazza dadc046d3a post merge pipeline and environments status 2018-10-29 11:34:41 +00:00
Andreas Brandl 56a8f4e3bd Merge branch '34758-create-group-clusters' into 'master'
Models and migrations for group level clusters

See merge request gitlab-org/gitlab-ce!22307
2018-10-29 10:34:37 +00:00
Sean McGivern fcd2f35b50 Merge branch 'rz_fix_milestone_count' into 'master'
Fixing count on Milestones

Closes #50848

See merge request gitlab-org/gitlab-ce!21446
2018-10-29 10:23:46 +00:00
Thong Kuah 0e15eec86d Associate clusters model to groups
Even though we currently only should have one group for a cluster, we
allow the flexibility to associate to other groups in the future.

This also matches the runner <=> groups association.

- Adds Cluster#first_group, aliased to Cluster#group. For the
conceivable future, a cluster will have at most one group.

- Prevent mixing of group and project clusters. If project type
clusters, it should only have projects assigned.  Similarly with groups.

- Default cluster_type to :project_type. As it's very small table we can
set default and null: false in one release.
2018-10-29 16:21:31 +13:00
Peter Leitzen 8270be8a67 Resolve "No longer require a deploy to start Prometheus monitoring" 2018-10-26 15:31:04 +00:00
Brett Walker 7aeab58f48 Automatically navigate to last board visited 2018-10-26 12:49:16 +00:00
Eagllus 3b70cf6918 Update MR based on Sean's feedback 2018-10-26 13:43:28 +02:00
Nick Thomas 324ff19571
Backport SSH host key detection code to CE
This functionality is needed for SSH push mirroring support, which is a
CE feature.
2018-10-25 13:51:45 +01:00
Ronald van Zon 0ff5b0f453 Removed the print in test 2018-10-25 09:52:26 +00:00
Jan Provaznik c1c1496405 Redact unsubscribe links in issuable texts
It's possible that user pastes accidentally also unsubscribe link
which is included in footer of notification emails. This unsubscribe
link contains personal token which attacker then use to act as the
original user (e.g. for sending comments under his/her identity).
2018-10-23 21:20:20 +02:00
Tomasz Maczukin 58844fcb7b Update Runner Chart to 0.1.35 2018-10-23 14:02:55 +00:00
Oswaldo Ferreira 86ead874e2 Resolve "Filter discussion (tab) by comments or activity in issues and merge requests" 2018-10-23 09:49:45 +00:00
Grzegorz Bizon 9b5685379e Merge branch '42611-removed-branch-link' into 'master'
Resolve "Removed branch link in pipelines page is broken"

Closes #42611

See merge request gitlab-org/gitlab-ce!21451
2018-10-23 07:40:49 +00:00
Andreas Brandl ec748a8f19 Merge branch '51716-add-kubernetes-namespace-model' into 'master'
Add Clusters::KubernetesNamespace model

See merge request gitlab-org/gitlab-ce!22404
2018-10-22 19:42:58 +00:00
Robert Speicher 616b73f2e6 Merge branch 'refactor-project-rename-repo' into 'master'
Move Project#rename_repo to a service class

See merge request gitlab-org/gitlab-ce!22419
2018-10-22 19:12:19 +00:00
Mayra Cabrera e3ca493876 Add Clusters::KubernetesNamespace model
This model will be used to persist into database Kubernetes properties,
such as namespace, service account name and service account token.
2018-10-22 09:54:00 -05:00
Yorick Peterse 4b9c17f196
Move Project#rename_repo to a service class
This moves the logic of Project#rename_repo and all methods _only_ used
by this method into a new service class: Projects::AfterRenameService.
By moving this code into a separate service class we can more easily
refactor it, and we also get rid of some RuboCop "disable" statements
automatically.

During the refactoring of this code, I removed most of the explicit
logging using Gitlab::AppLogger. The data that was logged would not be
useful when debugging renaming issues, as it does not add any value on
top of data provided by users.

I also removed a variety of comments that either mentioned something the
code does in literal form, or contained various grammatical errors.
Instead we now resort to more clearly named methods, removing the need
for code comments.

This method was chosen based on analysis in
https://gitlab.com/gitlab-org/release/framework/issues/28. In this issue
we determined this method has seen a total of 293 lines being changed in
it. We also noticed that RuboCop determined the ABC size
(https://www.softwarerenovation.com/ABCMetric.pdf) was too great.
2018-10-22 15:12:46 +02:00
Eagllus 473138f115 Update related tests based on comment 2018-10-22 13:56:08 +02:00
Grzegorz Bizon 680afb3d77 Do not raise error when checking pipeline reference
Return from the `Ci::Pipeline#ref_exists?` in case when there is no
repository present.

This also fixes pipeline page feature specs by changing pipeline
reference instead of stubbing `ref_exist?` method.
2018-10-22 13:33:28 +02:00
Grzegorz Bizon 5f412e3a87 Fix pipeline reference existence check and add specs 2018-10-22 11:37:52 +02:00
Grzegorz Bizon 44a9231d19 Merge branch 'use-raw-file-format' into 'master'
Add RAW file format which is used to store security reports

Closes gitlab-ee#7996

See merge request gitlab-org/gitlab-ce!22365
2018-10-22 08:09:40 +00:00
Tomasz Maczukin 8288e91b9a Update used version of Runner Helm Chart to 0.1.34 2018-10-19 14:38:32 +00:00
Douglas Barbosa Alexandre 80cce65d7e Merge branch 'ccr/43034_issues_controller_100_queries' into 'master'
Add preload for routes and namespaces for issues controller.

Closes #43034

See merge request gitlab-org/gitlab-ce!21651
2018-10-19 13:41:40 +00:00
Sean McGivern ffc505d217 Merge branch 'bvl-remove-forked-project-link' into 'master'
Remove ForkedProjectLink model

Closes #38883

See merge request gitlab-org/gitlab-ce!22226
2018-10-19 11:01:44 +00:00
Bob Van Landuyt f3fba178b9 Remove the `ForkedProjectLink` model
This removes the `ForkedProjectLink` model that has been replaced by
the `ForkNetworkMember` and `ForkNetwork` combination. All existing
relations have been adjusted to use these new models.

The `forked_project_link` table has been dropped.

The "Forks" count on the admin dashboard has been updated to count all
`ForkNetworkMember` rows and deduct the number of `ForkNetwork`
rows. This is because now the "root-project" of a fork network also
has a `ForkNetworkMember` row. This count could become inaccurate when
the root of a fork network is deleted.
2018-10-19 11:57:20 +02:00
Alex Lossent 60937adacb Correctly process Bamboo API results
Bamboo API returns an array of results as per
https://docs.atlassian.com/atlassian-bamboo/REST/6.2.5/#d2e786
2018-10-19 10:22:55 +02:00
Chantal Rollison c871faa3e4 Add preload in issues controller 2018-10-18 18:43:50 -07:00
Nick Thomas b9cb0e1632 Merge branch 'ac-review-app-changes-33418' into 'master'
Expose changed URLs in MR ci_environments_status

See merge request gitlab-org/gitlab-ce!22228
2018-10-19 01:24:20 +00:00
Douglas Barbosa Alexandre 1ad946228a Merge branch 'rails5-fix-deployment-spec' into 'master'
Rails5: fix deployment model spec

See merge request gitlab-org/gitlab-ce!22428
2018-10-18 14:28:47 +00:00
Alessio Caiazza d60cc75d43 Show modified and added public paths in MR 2018-10-18 16:25:31 +02:00
Alessio Caiazza 4a9efc606f Move ci_environments_status to a model
GET :namespace/merge_requests/:id/ci_environments_status complexity
already reached a limit for a direct serialization from an hash
computed at within the controller function.

Here we introduce a virtual model EnvironmentStatus and its serializer.
2018-10-18 16:12:16 +02:00
Douglas Barbosa Alexandre ab9cf561c2 Merge branch '52527-harden-wiki-against-missing-last-version' into 'master'
Harden the wiki against missing last_versions

Closes #52527

See merge request gitlab-org/gitlab-ce!22377
2018-10-17 17:07:55 +00:00
Jasper Maes 290e458113 Rails5: fix deployment model spec 2018-10-17 19:02:39 +02:00
Nick Thomas 0669127a32
Use cached readme blobs where appropriate
GitLab keeps a cache of the rendered HTML for a repository's README as
stored in the HEAD branch. However, it was not used in all
circumstances. In particular, the new blob viewer framework bypassed
this cache entirely.

This MR ensures a ::ReadmeBlob is returned instead of a ::Blob when
asking a repository for an individual blob, if the commit and path
match the readme for HEAD. This makes the cached HTML available to
consumers, including the blob viewer.

The ReadmeBlob is a simple delegator to the Blob, so should be
compatible in all cases. Adding the rendered_markdown method is the
only additional behaviour it contains.
2018-10-17 16:24:36 +01:00
Eagllus d96585f573 Moving state_count to Milestone model and related tests
By moving and improving state_count the functions in GlobalMilestone
are no longer used.
2018-10-17 15:42:10 +02:00
Nick Thomas d66066f7cb
Harden the wiki against missing last_versions
Currently, we assume a "last_version" always exists for a wiki page.
In production, this is not always true. So, guard uses of it with a
null check.
2018-10-17 13:24:52 +01:00
Kamil Trzciński 15cd91c71a Make all legacy security reports to use raw format
- This introduces and uses `:raw` format for all legacy reports,
  the ones that do not have yet proper parsers on Backend
- Raw format is needed to make Frontend be able to parse reports,
  without the need of decompressing,
- This also extends fixtures to seed security reports with database,
  even though parser code is part of EE
2018-10-16 13:51:49 +02:00
Peter Leitzen 3a3ec6f021
Show available clusters when installed or updated
Before this commit updating Prometheus (e.g. adding alerts) made it
"updated" therefore not installed.
2018-10-16 09:16:43 +02:00
Douglas Barbosa Alexandre 2e75e93c31
Does not allow an import_url with SSH protocol 2018-10-15 19:03:40 -03:00
Douwe Maan 0602fcb6bf Merge branch 'sh-remove-koding' into 'master'
Remove Koding integration and documentation

Closes #39697

See merge request gitlab-org/gitlab-ce!22334
2018-10-15 16:28:09 +00:00
Douwe Maan 3c15a20ba3 Merge branch 'bvl-merge-base-multiple-revisions' into 'master'
Allow getting the merge base of multiple revisions

Closes #52573

See merge request gitlab-org/gitlab-ce!22295
2018-10-15 16:18:21 +00:00
Stan Hu 656831e173 Remove Koding integration and documentation
This integration no longer works and does not appear to be supported.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39697
2018-10-12 22:18:51 -07:00
Peter Leitzen 4d9ede0be7 Backport CE changes for Ops Dashboard in EE 2018-10-12 14:10:34 +00:00
Bob Van Landuyt 71d71afb3a Allow getting the merge base of multiple revisions
As we now support getting the merge base for multiple revisions in
gitaly, we can provide this functionality in our API
2018-10-12 11:41:22 +02:00