Commit Graph

5576 Commits

Author SHA1 Message Date
Takuya Noguchi a565f3d88d Fix misspellings in app/spec executable lines
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-02-27 22:41:34 +09:00
Matija Čupić 316889cb47
Revert "Merge branch 'revert-8baf9e5f' into 'master'"
This reverts commit f5201a816f, reversing
changes made to 48e6db0dad.
2019-02-27 12:52:53 +01:00
Jason Lenny 55826a7a77 Add Project template for go-micro 2019-02-27 11:03:57 +00:00
Jacob Vosmaer 078f11a6b9 Prepare test suite for switch to Gitaly-embedded Git hooks 2019-02-27 10:58:21 +00:00
Nick Thomas f497c0f236
Danger ignores gitlab.pot 2019-02-27 10:52:19 +00:00
Grzegorz Bizon 1b10b77bab Merge branch 'include-ci-yaml' into 'master'
fix: validate 'include' keywords in gitlab-ci.yml configuration files

Closes #55863

See merge request gitlab-org/gitlab-ce!24098
2019-02-27 10:29:08 +00:00
Alexander Koval 1874aa9a3b Reduce code duplication
Move logic of obtaining Issuable data to separate method
2019-02-27 10:28:53 +00:00
Shinya Maeda 314062fec5 Persist source sha and target sha for merge pipelines
source_sha and target_sha are used for merge request pipelines
2019-02-27 17:12:04 +09:00
Diana Stanley 46da2764ce Add test for nil due_on value during import 2019-02-26 16:57:01 -08:00
Heinrich Lee Yu f4be2d4e1b Revert "Merge branch '56726-fix-n+1-in-issues-and-merge-requests-api' into 'master'"
This reverts merge request !25042
2019-02-26 17:59:26 +00:00
Kamil Trzciński 7b445f9b15 Revert "Merge branch '13784-simple-masking-of-protected-variables-in-logs' into 'master'"
This reverts merge request !25293
2019-02-26 17:32:23 +00:00
Alexander Koval 35c1092282 Reduce code duplication
Move logic of obtaining Issuable data to separate method
2019-02-26 17:13:45 +00:00
João Cunha 4c974f50f6 Get rid of ScheduleInstallationService
- deletes schedule_installation_service.rb
- moves schedule_installation_service.rb logic to create_service.rb
- moves specs as well

Removes code duplication

Remove unecessary spec block

Abide review suggestions

Test installable applications which are not associated to a cluster

Fix a typo

Removes duplciated expectation

Reuse variable instead of redefining

Remove method in favor of a local scoped lambda

Improve 'failing service' shared examples

Test the increase of status count

Remove duplicated test

Enable fronzen literal
2019-02-26 16:44:31 +00:00
Sean McGivern f26cd63b0f Merge branch 'add_YouTrack_integration' into 'master'
Added YouTrack integration

Closes #42595

See merge request gitlab-org/gitlab-ce!25361
2019-02-26 15:06:29 +00:00
Matija Čupić c9125c4786 Add Maskable concern for CI variables
This adds a concern that abstracts the concept of masking a variable,
including the RegEx for validation.
2019-02-26 14:03:42 +00:00
Douwe Maan c1d8f8a410 Merge branch 'osw-create-and-store-merge-ref-for-mrs' into 'master'
Support merge ref writing (without merging to target branch)

Closes #47110

See merge request gitlab-org/gitlab-ce!24692
2019-02-26 14:02:41 +00:00
Kamil Trzciński ed5ff8017e Merge branch '54417-improve-authorize-dsl' into 'master'
Improve GraphQL Authorization DSL

Closes #57828

See merge request gitlab-org/gitlab-ce!25328
2019-02-26 09:05:50 +00:00
Luke Duncalfe ccb4edbca1 Improve GraphQL Authorization DSL
Previously GraphQL field authorization happened like this:

    class ProjectType
      field :my_field, MyFieldType do
        authorize :permission
      end
    end

This change allowed us to authorize like this instead:

    class ProjectType
      field :my_field, MyFieldType, authorize: :permission
    end

A new initializer registers the `authorize` metadata keyword on GraphQL
Schema Objects and Fields, and we can collect this data within the
context of Instrumentation like this:

    field.metadata[:authorize]

The previous functionality of authorize is still being used for
mutations, as the #authorize method here is called at during the code
that executes during the mutation, rather than when a field resolves.

https://gitlab.com/gitlab-org/gitlab-ce/issues/57828
2019-02-26 10:22:12 +13:00
Jason Lenny 5b42ce387f Merge branch '57794-project-template-for-net' of https://gitlab.com/gitlab-org/gitlab-ce into 57794-project-template-for-net 2019-02-25 14:42:03 +00:00
Lin Jen-Shin 27ed9d958a Merge branch '57712-project-import-error-user-expected-got-hash' into 'master'
Resolve "Project import error, User expected, got Hash"

Closes #57712

See merge request gitlab-org/gitlab-ce!25495
2019-02-25 13:41:28 +00:00
Oswaldo Ferreira 1ad699677f Support merge to ref for merge-commit and squash
Adds the ground work for writing into
the merge ref refs/merge-requests/:iid/merge the
merge result between source and target branches of
a MR, without further side-effects such as
mailing, MR updates and target branch changes.
2019-02-25 10:40:58 -03:00
Rémy Coutable a91bacf51c Merge branch 'am-fix-pagination-relative-links' into 'master'
Properly implement API pagination headers and add specs

Closes #57684

See merge request gitlab-org/gitlab-ce!25267
2019-02-25 11:01:39 +00:00
Jason Lenny 76ad4c04ae Merge branch '57785-create-project-template-for-netlify' of https://gitlab.com/gitlab-org/gitlab-ce into 57785-create-project-template-for-netlify 2019-02-25 08:43:57 +00:00
James Lopez c643042a49
Fix project import error on releases 2019-02-22 15:07:53 +01:00
Andrew Newdigate f78cd68ddf Switch back to using regexps in `tracing_url_template`
This approach is able to cope with `%` characters in the URL template,
which is important since `%` is a valid URL character. Additionally
this approach is less likely to fail on an invalid string. This is
important since the distributed tracing infrastructure is designed to
degrade gracefully when not properly configured, and a small mistake
in the configuration of the URL template could have led to a production
outage.
2019-02-22 14:47:37 +02:00
Andrew Newdigate 24fb8cdae0 Add test for URL encoded characters
Tracing URL templates should be able to include % characters. This test
is intended to show that the current implementation needs rework in
order to handle this requirement.
2019-02-22 14:40:58 +02:00
Oswaldo Ferreira 445709345f Stop linking to unrecognized package sources 2019-02-21 16:17:38 -03:00
Adam Mulvany 38bbc097fa
Properly implement API pagination headers and add specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-21 18:29:00 +01:00
Winnie Hellmann fc6cbcbb9b Add spec/frontend/ to frontend roulette 2019-02-21 15:58:01 +01:00
Thong Kuah af16fd687e Do not allow local urls in Kubernetes form
Use existing `public_url` validation to block various local urls. Note
that this validation will allow local urls if the "Allow requests to the
local network from hooks and services" admin setting is enabled.

Block KubeClient from using local addresses

It will also respect `allow_local_requests_from_hooks_and_services` so
if that is enabled KubeClinet will allow local addresses
2019-02-21 23:16:11 +13:00
Diana Stanley d24ea868ab Capture due date when importing milestones from Github 2019-02-20 15:09:27 -08:00
James Fargher 2d19b1adef Move ChatOps to Core
ChatOps used to be in the Ultimate tier.
2019-02-20 21:29:48 +00:00
Nick Thomas b0006630d6 Merge branch 'gitlab_kubernetes_helm_bump' into 'master'
Bump helm and kubectl for Kubernetes integration

See merge request gitlab-org/gitlab-ce!25268
2019-02-20 13:44:28 +00:00
Imre Farkas 6d92a3d4e2 Remove undigested token column from personal_access_tokens table
Token column are no longer used as token values are stored digested in
token_digest.
2019-02-20 11:39:37 +00:00
Thong Kuah 8004508943 Bump helm and kubectl versions
Bump the helm and kubectl used in our Kubernetes integration, used e.g.
to install apps.

Note I have only bumped to the latest patch of the v1.11 series for
kubectl as GKE clusters are still on 1.10/1.11
2019-02-20 09:54:07 +13:00
Paul B d3aa9feffd
tests(yaml_processor): complete test scenarios on 'include' keyword 2019-02-19 17:10:51 +01:00
Paul B e5d491d15b
tests: adding a failing unit test 2019-02-19 16:44:49 +01:00
Bob Van Landuyt 7e55a227a5 Revert "Merge branch 'use_gitlab_current_settings' into 'master'"
This reverts merge request !25370
2019-02-19 12:58:05 +00:00
Thong Kuah 8a1b6041c8 Use Gitlab::CurrentSettings in UrlValidator
Gitlab::CurrentSettings will create ApplicationSetting.current if not
present which means we don't have to use `&.`. We can also more easily
use stub_application_setting in specs
2019-02-19 22:04:08 +13:00
Yauhen Kotau 04daa0b970 Added YouTrack integration
Fixes gitlab-org/gitlab-ce#42595
2019-02-18 20:08:36 +03:00
Rémy Coutable 951e891276 Merge branch '57680-roulette-ignores-changelogs' into 'master'
Reviewer roulette ignores changelogs

Closes #57680

See merge request gitlab-org/gitlab-ce!25264
2019-02-18 09:29:21 +00:00
Douglas Barbosa Alexandre c34c50e1b8 Merge branch '57353-git-push-fails-on-large-lfs-files-where-the-push-take-a-long-time' into 'master'
Provide expires_in in LFS authentication payload

Closes #57353

See merge request gitlab-org/gitlab-ce!25082
2019-02-15 13:15:55 +00:00
James Lopez 0328d4faee Merge branch '56485-implement-graphql-mergerequestsresolver' into 'master'
Resolve "Implement GraphQL MergeRequestsResolver"

Closes #56485

See merge request gitlab-org/gitlab-ce!24805
2019-02-15 08:47:10 +00:00
Nick Thomas 9afc4f9d11
Reviewer roulette ignores changelogs 2019-02-14 23:52:30 +00:00
Ash McKenzie 1cfa3c76a1
Include expires_in for LFS authentication payload
When using git-lfs with SSH we weren't passing in
the expires_header header which is allows large
transfers to succeed in the event the current
default of 30 mins expires.

https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md#ssh
2019-02-15 09:29:52 +11:00
Rémy Coutable e3b79499f5
Make Danger as for backend review for .gitlab-ci.yml
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-14 16:49:29 +01:00
James Lopez 401a3bca40
Fix import_jid error on project import 2019-02-14 09:29:42 +01:00
Lin Jen-Shin 50491d3241 Instead of returning all or nothing, return whichever passed
And add tests
2019-02-14 15:52:17 +08:00
Lin Jen-Shin 564b86a314 Allow authorize on array of objects for GraphQL
And add tests
2019-02-14 15:52:17 +08:00
Nick Thomas 77b2ecd2b1
Reviewer roulette via Danger
Make danger pick reviewers and maintainers at random, for feontend,
backend, database, etc, changes, whenever files belonging to those
teams get changed.
2019-02-13 16:41:28 +00:00
Hiroyuki Sato 30cd8432dd Support `only: changes:` on MR pipelines 2019-02-13 10:59:34 +00:00
Grzegorz Bizon d29e81b2aa Merge branch '7048_usage_ping_for_security_dashboard_as_default_view_for_groups-ce' into 'master'
Usage ping for Group overview default user preference

See merge request gitlab-org/gitlab-ce!24980
2019-02-12 14:41:34 +00:00
Yorick Peterse 1319a9edd9 Merge branch '8798-geo-implement-selective-sync-support-for-the-various-fdw-queries' into 'master'
Replace dots with an underscore when creating an alias for the recursive CTE

See merge request gitlab-org/gitlab-ce!25112
2019-02-12 13:09:32 +00:00
Yorick Peterse 6dfce6e786 Merge branch 'sh-import-source-branch-github-forks' into 'master'
Create the source branch for a GitHub import

Closes #57370

See merge request gitlab-org/gitlab-ce!25064
2019-02-12 11:05:22 +00:00
Victor Zagorodny fa518963ec Protect group overview usage ping w/ feature flag
user_preferences key is includes into system usage
data only if group_overview_security_dashboard
feature flag is enabled; see
https://gitlab.com/gitlab-org/gitlab-ee/issues/7048
2019-02-12 12:46:31 +02:00
Victor Zagorodny 60bd0a24f5 Add user_preferences_usage to usage ping 2019-02-12 12:46:31 +02:00
Grzegorz Bizon 91f74f455e Merge branch 'add-client-for-count-diverging-commits' into 'master'
add client support for CountDivergingCommits rpc

See merge request gitlab-org/gitlab-ce!24287
2019-02-12 07:53:13 +00:00
Stan Hu e34a321327 Create the source branch for a GitHub import
When the GitHub importer creates a merge request, it retrieves the SHA
but does not actually create the source branch. This makes it impossible
to merge an open merge request, particularly if the source branch were
from a forked project. In that case, the branch will never exist because
the original `project-name:source-branch` name is never created, nor
is it a valid branch name.

To prevent possible branch name conflicts, forked source branches
are now renamed `github/fork/project-name/source-branch` and created
when necessary.

Note that we only create the source branch if the merge request
is open. For projects that have many merge requests, the project
would end up with a lot of possibly dead branches.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57370
2019-02-11 22:00:05 -08:00
Douglas Barbosa Alexandre 9100ca188c
Replace dots with an underscore when creating an alias for the CTE
When the Arel table to use as the alias contains a schema in your
name, e.g., "gitlab_secondary"."namespaces" it produces an invalid
query.
2019-02-11 18:06:54 -02:00
Lin Jen-Shin b502d90a9f Adapt that diverging commits could be just one bar
refactors the ui for diverging commits so that it's only a single
bar instead of two separate bars
2019-02-11 10:44:06 -08:00
Douglas Barbosa Alexandre 42c3ef50ae Merge branch '52424-goodbye-hipchat' into 'master'
Remove HipChat integration from GitLab

Closes #52424

See merge request gitlab-org/gitlab-ce!22223
2019-02-11 15:26:55 +00:00
Grzegorz Bizon 25af903275 Merge branch 'an-peek-jaeger' into 'master'
Provide a performance bar link to the Jaeger UI

See merge request gitlab-org/gitlab-ce!24902
2019-02-11 08:49:20 +00:00
Ash McKenzie c4f1e8ed10
Move LFS auth hash creation into GitLab::LfsToken 2019-02-11 15:49:36 +11:00
Ash McKenzie 9ab268b9c1
Tidy up Gitlab::LfsToken spec
- Remove unnecessary encrypted_password stubbing
- Remove unnecessary attr_encrypted_db_key_base stub
- Rename shared_example to 'a valid LFS token'
2019-02-11 15:49:36 +11:00
Nick Thomas a5378665a1
Remove HipChat integration from GitLab 2019-02-08 18:20:38 +00:00
Andrew Newdigate 48bcd5248f Provide a performance bar link to the Jaeger UI
Jaeger is a distributed tracing tool. This change adds a "Tracing" link
to the performance bar to directly link to a current request in Jaeger.

This is useful for two reasons: 1 - it provides affordance to developers
that the distributed tracing tool is available, so that it can quickly
be discovered. 2 - it allows developers to quickly find a specific trace
without having to manually navigate to a second user-interface.
2019-02-08 14:08:31 +02:00
Thong Kuah f67fc23727 Upgrade cluster applications, starting with runner 2019-02-07 21:40:55 +00:00
Jason Lenny 37410a9ddf
Add Pages templates
Adds templates for the 5 most popular Pages templates to the new project
menu. This does not add unique icons for the templates because that
turned out more complicated than expected, and this feature is valuable
without them.
2019-02-07 17:05:33 +01:00
John Cai 1f2f38f59a Add client support for count diverging commits
Adds the client call for the gitaly rpc CountDivergingCommits

fixing signature

simplifying commit logic

adding test for max-count

refactoring tests
2019-02-06 22:25:37 -08:00
John Cai 04b9de85a8 Modifying gitaly search files client to add chunking support
updates gitaly proto to 1.7.0, modifies the search files gitaly client
call to use the new chunked_response flag in the rpc request, and stitch
the responses together.

maintains backwards compatibility with older gitaly servers.
2019-02-06 20:32:53 -08:00
Stan Hu e059cca42c Merge branch 'bjk/56788_unicorn_labels' into 'master'
Clean up unicorn sampler metric labels

Closes #56788

See merge request gitlab-org/gitlab-ce!24626
2019-02-06 22:36:33 +00:00
Rémy Coutable b0e2e76004 Merge branch 'sh-log-project-name-with-gitaly' into 'master'
Send project name with Gitaly repository requests

Closes gitaly#1394

See merge request gitlab-org/gitlab-ce!23373
2019-02-06 17:03:39 +00:00
GotenXiao 7a1c810dc9 Fix #44332 - Add support for profile and email 2019-02-06 16:48:36 +00:00
Ben Kochie 54438ad04b
Clean up unicorn sampler metric labels
Change `type` and `address` labels to be less generic to avoid conflicts
with other systems.
2019-02-06 14:19:51 +01:00
Heinrich Lee Yu a04d9ba90c Add reply to notes to turn into discussions 2019-02-06 10:31:46 +00:00
Stan Hu f929411c6d Rename gl_project_name -> gl_project_path
Upgrade gitaly-proto to 1.10.0 to have this field.
2019-02-05 21:33:10 -08:00
Stan Hu 322402aada Add more tests and comments around Wiki formatting 2019-02-05 21:33:10 -08:00
Stan Hu a9ab6dbc63 Refactor use of Shell.import_repository for Wikis
The previous behavior would pass in a list of parameters
to Shell, but we can improve this by using the WikiFormatter
and Project models to give us the same information.
2019-02-05 21:33:09 -08:00
Stan Hu 6bac612dc4 Clean up Shell.fork_repository
Use project models instead of a list of parameters.
2019-02-05 21:33:09 -08:00
Stan Hu 82b6e5378a Send project name with Gitaly repository requests
When hashed storage is in use, it's helpful to have the project
name associated with the request.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1394
2019-02-05 21:33:09 -08:00
Reuben Pereira 2079444091 DB and model changes for Sentry project selection dropdown 2019-02-04 12:12:24 +00:00
Mark Chao c34f6ea604 Consume remaining MigrateApproverToApprovalRulesInBatch
Allow `steal` to handle dead jobs.
2019-02-02 21:45:10 +08:00
Kamil Trzciński d4c7214799
[master] Pipelines section is available to unauthorized users 2019-01-31 16:52:50 +01:00
Francisco Javier López 4b868ba8e7
[master] Check access rights when creating/updating ProtectedRefs 2019-01-31 16:52:50 +01:00
James Lopez f78545af98
Fix tree restorer visibility level 2019-01-31 16:52:49 +01:00
Heinrich Lee Yu 35b8f103a8
Prevent comments by email when issue is locked
This changes the permission check so it uses the policy on Noteable
instead of Project. This prevents bypassing of rules defined in
Noteable for locked discussions and confidential issues.

Also rechecks permissions when reply_to_discussion_id is provided since the
discussion_id may be from a different noteable.
2019-01-31 16:52:48 +01:00
Francisco Javier López b3c13bbb3c
Added validations to prevent LFS object forgery 2019-01-31 16:51:54 +01:00
Luke Duncalfe f27cba0fee
Fix private user email being visible in tag webhooks
Fixes #54721
2019-01-31 16:51:18 +01:00
Luke Duncalfe 6c0758f69b
Prefer build() rather than create() 2019-01-31 16:51:17 +01:00
James Lopez 57f082d969
Fix path disclosure on Project Import 2019-01-31 16:51:16 +01:00
Balasankar "Balu" C 232a7a36e2
Add number of repositories to usage ping data 2019-01-31 18:46:07 +05:30
Douwe Maan 4c2096b46a Merge branch 'an-opentracing-render-tracing' into 'master'
Add OpenTracing instrumentation for Action View Render events

See merge request gitlab-org/gitlab-ce!24728
2019-01-30 12:33:02 +00:00
Andrew Newdigate d022ce8655 Add OpenTracing instrumentation for Action View Render events
This change adds three new instrumentations, driven through rails
notifications: render_template.action_view,
render_collection.action_view and render_partial.action_view.

These can help developers understand why renders are taking a long
time which may in turn help them to improve their performance.
2019-01-30 13:38:19 +02:00
Lin Jen-Shin 6fc5495703 Merge branch 'anan-add-MethodCallWithoutArgsParentheses-cop' into 'master'
Re-enable MethodCallWithoutArgsParentheses Cop

Closes #56795

See merge request gitlab-org/gitlab-ce!24631
2019-01-30 10:02:38 +00:00
Brandon Labuschagne def2b548d2 Revert the "What's new" feature 2019-01-29 20:45:47 +00:00
Andrew Newdigate ff0b2cc61f Re-enable MethodCallWithoutArgsParentheses Cop
Re-enables and autocorrects all instances of the
Style/MethodCallWithoutArgsParentheses rule
2019-01-29 21:05:30 +02:00
Andreas Brandl 4ac06d344b
Revert " Trigger iid logic from GitHub importer for merge requests."
This reverts commit fb98496f49.
2019-01-29 15:38:40 +01:00
Andreas Brandl 820739eb09
Revert "Trigger iid logic from GitHub importer for issues."
This reverts commit b78a69b06c.
2019-01-29 15:38:40 +01:00
Andreas Brandl 852e68fd95
Revert "Trigger iid logic from GitHub importer for milestones."
This reverts commit 358675d09f.
2019-01-29 15:38:40 +01:00
Gabriel Mazetto 7bc16889df Refactor Storage Migration
Specs were reviewed and improved to better cover the current behavior.
There was some standardization done as well to facilitate the
implementation of the rollback functionality.

StorageMigratorWorker was extracted to HashedStorage namespace were
RollbackerWorker will live one as well.
2019-01-25 20:26:35 +01:00