Commit Graph

207 Commits

Author SHA1 Message Date
GitLab Bot a5650b86b5 Add latest changes from gitlab-org/gitlab@master 2020-05-13 21:08:55 +00:00
GitLab Bot 4d0c47058a Add latest changes from gitlab-org/gitlab@master 2020-02-20 21:08:48 +00:00
GitLab Bot cf1d4237a4 Add latest changes from gitlab-org/gitlab@master 2020-02-15 21:08:49 +00:00
GitLab Bot 0e9eea40b6 Add latest changes from gitlab-org/gitlab@master 2020-02-11 21:08:44 +00:00
GitLab Bot c8f773a859 Add latest changes from gitlab-org/gitlab@master 2020-01-30 21:08:47 +00:00
GitLab Bot 898e2cc1df Add latest changes from gitlab-org/gitlab@master 2019-12-20 09:24:38 +00:00
GitLab Bot e723867717 Add latest changes from gitlab-org/gitlab@master 2019-12-17 18:07:48 +00:00
GitLab Bot 5a3f1ba53b Add latest changes from gitlab-org/gitlab@master 2019-11-20 00:06:22 +00:00
GitLab Bot b570d73ecd Add latest changes from gitlab-org/gitlab@master 2019-11-19 12:06:00 +00:00
GitLab Bot 77a73903aa Add latest changes from gitlab-org/gitlab@master 2019-11-01 18:06:00 +00:00
GitLab Bot 1da3754b25 Add latest changes from gitlab-org/gitlab@master 2019-10-03 21:07:29 +00:00
Yuping Zuo cc704112b3 fix: show preferred commit email in empty project page 2019-08-29 18:56:22 +00:00
Robert Speicher b51770c66a Merge branch 'local-test-failures' into 'master'
git-user-related local test failures

See merge request gitlab-org/gitlab-ce!31437
2019-08-29 14:27:05 +00:00
Brett Walker 9be16e1f49 UI for disabling group/project email notification
- Adds UI to configure in group and project settings
- Removes notification configuration for users when
disabled at group or project level
2019-08-17 05:56:48 +00:00
David H. Wilkins 6391eeec30 git-user-related local test failures
Some of the tests fail locally due to the git user being different
than it is on the test runners.   I'd really like to be able to run
all of the tests locally.
2019-08-02 18:18:09 -05:00
Reuben Pereira 5c088584ec Make external_dashboard_url available to frontend
- On Operations settings page
- On Metrics dashboard page
2019-05-29 13:36:36 +00:00
Luke Bennett fae745c342
Resolve CE/EE diffs in new proj member import
Part of single codebase changes.
2019-05-10 23:00:36 +01:00
Ezekiel Kigbo 6accad69e2
Added blank lines to meet style guide
Un-nest title variable output

Update spec test names

Rename sort_value_most_stars -> sort_value_stars_desc

Rename sorted_by_stars -> sorted_by_stars_desc

Renname sort_value_most_stars_asc -> sort_value_stars_asc

Invert feature check, assign feature condition to a variable

Inline conditional nav bar rendering

Invert conditional label

Added follow up task

Fix filters returning 0 projects show the wrong view

Move click action out of test expectation

Use proper variable name for project in before block

Rename projects_sort_admin_options_hash

Renamed projects_sort_admin_options_has to
old_projects_sort_options_hash as its not only used
on the admin screen

Fix extra whitespace errors

Stub project_list_filter_bar in the projects_helper specs

Added follow up task for `show_projects?`

Removed url test expectations
2019-05-06 16:42:44 +01:00
Rémy Coutable f6aa22fc9a
[CE] Reduce the diff with EE in spec/helpers/projects_helper_spec.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-03-28 18:02:42 +01:00
Reuben Pereira 43e713eb41 Refactor model and spec
- Move some specs into contexts
- Let get_slugs method take a parameter and return a specific slug.
- Add rescues when using Addressable::URI.
2019-03-01 14:51:54 +00:00
Grzegorz Bizon fedecbbe01 Merge branch 'jprovazn-remove-redcarpet' into 'master'
Remove Redcarpet markdown engine

Closes #51374

See merge request gitlab-org/gitlab-ce!24819
2019-02-05 13:23:28 +00:00
Francisco Javier López 247bd12264
Changed external wiki query method to prevent attribute caching 2019-02-04 17:33:55 +01:00
Jan Provaznik b2c70230b3 Remove Redcarpet markdown engine
This engine was replaced with CommonMarker in 11.4, it was deprecated
since then.
2019-02-04 12:48:35 +01: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 740f07b1ec
Fixed bug when external wiki is enabled
When the external wiki is enabled, the internal wiki link is replaced
by the external wiki url. But the internal wiki is still accessible.
In this change the external wiki will have its own tab in the sidebar
and only if the services are disabled the tab (and access rights)
will not be displayed.
2019-01-31 16:51:53 +01:00
Mayra Cabrera 28783f8947 Hides ADO banner for certain projects
ADO banner is being hidden if:
- Project has no CI configuration
- Project has CI disabled

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52446
2019-01-04 15:50:08 -06:00
Martin Wortschack 26c7407150 Add test for compact mode and for helpers
- add tests for merge_request_count
- add tests for show_issue_count
- add tests for explore_projects_tab
- change interface for show_merge_request_count and show_issue_count
2018-12-19 20:37:25 +01:00
Gabriel Mazetto 4f5abe4327 Reduce N+1 from Activity Dashboard and Banzai
There is a combination of few strategies implemented here:

1. Few relations were eager loaded
2. Changed few polymorphic routes to specific ones so we don't have to
   use `#becomes(Namespace)` which doesn't preserve association cache
2018-12-10 21:34:33 +01:00
Nick Thomas 9395d198f9
Use BFG object maps to clean projects 2018-12-06 18:58:00 +00:00
Brett Walker 589776fc2e move logic into legacy_render_context helper method 2018-09-05 09:19:16 -05:00
Zeger-Jan van de Weg 9946328761
Remove sanitize_repo_path
This method is unneeded given its been pushed to Gitaly, through
https://gitlab.com/gitlab-org/gitaly/merge_requests/780

Closes https://gitlab.com/gitlab-org/gitaly/issues/1235
2018-07-17 13:30:06 +02:00
Francisco Javier López 837c3b3d73 Fix User role displayed on projects dashboard 2018-07-06 07:51:31 +00:00
Imre Farkas 1fbf6f1869
HTML escape the name of the user in ProjectsHelper#link_to_member 2018-06-15 14:26:48 +02:00
Jacob Vosmaer (GitLab) 5cf5680f9c Deny repository disk access in development and test 2018-06-14 11:18:25 +00:00
Rubén Dávila 6a0178d832 Invalidate cache with project details when repository is updated
The partial using this cache key was showing stale information due to
the cache not being invalidated.
2018-06-13 11:57:18 -05:00
Stan Hu b61e1e7a5c Fix invisible rows on importer status 2018-06-06 01:09:58 +00:00
André Luís bc59fc3719 Resolve "Add Xcode Button in UI" 2018-06-05 10:10:34 +00:00
Douwe Maan 9da52c6fc1
Adjust spec to build correct path when storage path ends in slash 2018-05-09 12:56:03 +02:00
Zeger-Jan van de Weg ec4423665c
Gitlab::Shell works on shard name, not path
Direct disk access is done through Gitaly now, so the legacy path was
deprecated. This path was used in Gitlab::Shell however. This required
the refactoring in this commit.

Added is the removal of direct path access on the project model, as that
lookup wasn't needed anymore is most cases.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
2018-04-25 13:36:22 +02:00
Mike Greiling bbb24da922 Resolve "Clean up old project permissions frontend code" 2018-04-12 15:47:40 +00:00
Douwe Maan f4bc6ec92e Merge branch 'bvl-external-auth-port' into 'master'
Port `read_cross_project` ability from EE

See merge request gitlab-org/gitlab-ce!17208
2018-02-23 09:14:14 +00:00
André Luís da531c3905 Add Tip about Push to Create project on New Project page 2018-02-23 09:00:19 +00:00
Bob Van Landuyt 148816cd67 Port `read_cross_project` ability from EE 2018-02-22 17:11:36 +01:00
Eric Eastwood 2e29597c94 Merge branch 'master' into 42431-add-auto-devops-and-clusters-button-to-projects 2018-02-22 09:34:44 -06:00
Oswaldo Ferreira e0e3f1c275 Move button list logic to project presenter 2018-02-20 13:03:06 -03:00
Andreas Brandl be231d2165 Use more specific #avatar_icon_for_user.
Whenever we already deal with a User object, let's use the more specific
method avatar_icon_for_user.
2018-02-13 18:04:51 +01:00
Mike Greiling 2c1d7c0948
fix spacing and wrap method params in parens 2018-01-22 16:01:48 -06:00
Mike Greiling 96862096f1
add test to can_change_visibility_level? method 2018-01-22 15:33:54 -06:00
Markus Koller 257fd57134 Allow password authentication to be disabled entirely 2017-11-23 13:16:14 +00:00
Jacopo 0ce6785851 Replaces `tag: true` into `:tag` in the specs
Replaces all the explicit include metadata syntax in the specs (tag:
true) into the implicit one (:tag).
Added a cop to prevent future errors and handle autocorrection.
2017-10-07 13:57:54 +02:00
Luke "Jared" Bennett 38c7229156
Update projects_helper_spec 2017-09-28 13:29:32 +01:00
Phil Hughes eab0ca8a0b
Fixes dashboard/projects empty state showing when viewing personal projects
This was caused by the `@projects` value being empty when the current
user does not have any personal projects.
2017-09-22 12:12:16 +01:00
Brandon Everett 528f90b4e5 escape characters in git user name 2017-09-13 12:39:50 +00:00
Yorick Peterse 83355336dd
Rework how recent push events are retrieved
Whenever you push to a branch GitLab will show a button to create a
merge request (should one not exist already). The underlying code to
display this data was quite inefficient. For example, it involved
multiple slow queries just to figure out what the most recent push event
was.

This commit changes the way this data is retrieved so it's much faster.
This is achieved by caching the ID of the last push event on every push,
which is then retrieved when loading certain pages. Database queries are
only executed if necessary and the cached data is removed automatically
once a merge request has been created, or 2 hours after being stored.

A trade-off of this approach is that we _only_ track the last event.
Previously if you were to push to branch A and B then create a merge
request for branch B we'd still show the widget for branch A. As of this
commit this is no longer the case, instead we will only show the widget
for the branch you pushed to most recently. Once a merge request exists
the widget is no longer displayed. Alternative solutions are either too
complex and/or too slow, hence the decision was made to settle for this
trade-off.

Performance Impact
------------------

In the best case scenario (= a user didn't push anything for more than 2
hours) we perform a single Redis GET per page. Should there be cached
data we will run a single (and lightweight) SQL query to get the
event data from the database. If a merge request already exists we will
run an additional DEL to remove the cache key.

The difference in response timings can vary a bit per project. On
GitLab.com the 99th percentile of time spent in User#recent_push hovers
between 100 milliseconds and 1 second, while the mean hovers around 50
milliseconds. With the changes in this MR the expected time spent in
User#recent_push is expected to be reduced down to just a few
milliseconds.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/35990
2017-09-08 00:46:16 +02:00
Maxim Rydkin 091b1c5ed5
remove unnecessary args from `link_to_member_avatar` method in `app/helpers/projects_helper.rb` 2017-09-07 13:27:23 +03:00
Maxim Rydkin 2a54cbcab8
fix project_helper.rb and add couple specs to it 2017-09-07 13:16:15 +03:00
Maxim Rydkin 0a08e07303
fix CI 2017-09-07 13:16:14 +03:00
Maxim Rydkin 0963ac3636
fix helper and spec 2017-09-07 13:16:14 +03:00
Maxim Rydkin db3bc89792
refactor `app/helpers/projects_helper.rb:21:3` 2017-09-07 13:16:14 +03:00
Yorick Peterse b401b3025b
Allow usage of any_projects? with an Array
In some cases we pass an Array to this method which would previously
fail since Array does not respond to "limit_value".

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3646
2017-08-15 12:33:37 +02:00
Yorick Peterse f77fda6437
Improve checking if projects would be returned
In various places we check if the same relation would return projects.
This is done using "any?" which will run a COUNT query with any
LIMIT/OFFSET values still applied.

To work around all this we introduce 2 helper methods that take care of
doing the right thing. This leads to the produced queries being simpler
and fewer queries being executed.
2017-08-07 12:38:27 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Sean McGivern 1afdbe320e Merge branch 'fixes-for-internal-auth-disabled' into 'master'
Fixes needed when GitLab sign-in is not enabled

See merge request !12491
2017-07-14 08:49:36 +00:00
Robin Bobbitt 672a68d372 Fixes needed when GitLab sign-in is not enabled
When sign-in is disabled:
 - skip password expiration checks
 - prevent password reset requests
 - don’t show Password tab in User Settings
 - don’t allow login with username/password for Git over HTTP requests
 - render 404 on requests to Profiles::PasswordsController
2017-07-13 10:08:27 -04:00
Paul Charlton cb3b4a15e6 Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
Robin Bobbitt 7eb26c7ff7 Provide hint to create a personal access token for Git over HTTP
If internal auth is disabled and user is not an LDAP user, present
the user with an alert to create a personal access token if he does
not have one already.
2017-06-26 14:41:27 -04:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Kamil Trzcinski 25b99a5b3b Update tests and application 2017-06-13 16:05:38 +02:00
Mike Greiling e245d7eebe Resolve "When changing project visibility setting, change other dropdowns automatically" 2017-06-06 08:28:39 +00:00
Dmitriy Zaporozhets bbd1be002b
Change project list cache key to use route.cache_key instead of namespace
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-05-12 18:27:59 +03:00
Dmitriy Zaporozhets 1028e05378
Add parent full path to project list cache key
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-05-12 15:16:25 +03:00
Annabel Dunstone Gray 465a818061 Merge branch '26509-show-update-time' into 'master'
Add updated time to project list

Closes #26509

See merge request !8514
2017-04-26 13:21:12 +00:00
Bob Van Landuyt 019b06b9d2 Load a project's CI status in batch from redis 2017-04-26 12:04:22 +00:00
Jeff Stubler 7057fbf404 Add updated time to project list 2017-04-21 10:10:21 -05:00
James Lopez 878e46a1af Fix restricted visibility project setting 2017-04-17 13:57:09 +00:00
Bob Van Landuyt 47abf00b24 Update project build status cache when transitioning 2017-04-07 17:24:11 +02:00
DJ Mountney 0d8fba4eec Merge branch 'path-disclosure-proj-import-export' into 'security'
Fix for path disclosure in project import/export

See merge request !2080
2017-04-05 21:06:36 -07:00
Bob Van Landuyt 7d5b8993f4 Build project cache key in a helper 2017-03-16 12:31:27 +01:00
Semyon Pupkov 3deb66ea56 Add traits for ProjectFeatures to Project factory
https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
2017-02-05 13:11:45 +05:00
Robert Speicher 2fe13fbc4b Use `:empty_project` where possible in helper specs 2017-01-25 17:10:32 -05:00
Dmitriy Zaporozhets 6b90ccb9fd Change user & group landing page routing from /u/:name & /groups/:name to /:name
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-06 19:50:48 +03:00
Nick Thomas 3ed80a0176 Enforce the fork_project permission in Projects::CreateService
Projects::ForkService delegates to this service almost entirely, but needed
one small change so it would propagate create errors correctly.

CreateService#execute needs significant refactoring; it is now right at the
complexity limit set by Rubocop. I avoided doing so in this commit to keep the
diff as small as possible.

Several tests depend on the insecure behaviour of ForkService, so fi them up at
the same time.
2016-09-27 13:17:56 +01:00
Felipe Artur dfa286c181 Fix project settings field 2016-09-06 17:37:56 -03:00
Paco Guzman cfe512d6e9 Show "Create Merge Request" widget for push events to fork projects on the source project 2016-08-24 18:54:26 +02:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Rémy Coutable 515205d3c1 UI and copywriting improvements
+ Move 'Edit Project/Group' out of membership-related partial
+ Show the access request buttons only to logged-in users
+ Put the request access buttons out of in a more visible button
+ Improve the copy in the #remove_member_message helper

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:18:14 +02:00
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Rémy Coutable d4d34b161b Merge branch 'rs-backport-ee-372' into 'master'
Backport changes from gitlab-org/gitlab-ee!372

Mostly replaces several Spinach tests with RSpec Feature tests.

See merge request !4043
2016-05-09 14:48:48 +00:00
Stan Hu 75523d1df9 Sanitize repo paths in new project error message
Closes #17243
2016-05-04 14:06:07 -07:00
Robert Speicher f18ec70743 Backport changes from gitlab-org/gitlab-ee!372
Mostly replaces several Spinach tests with RSpec Feature tests.
2016-05-04 17:05:16 -04:00
Rémy Coutable b8c4a65da7
Fix license detection to detect all license files, not only known licenses
Fixes #15470.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-25 10:31:28 +02:00
Douwe Maan ae7b2ef62c Merge branch 'master' into issue_12658
# Conflicts:
#	app/models/issue.rb
#	app/views/projects/_home_panel.html.haml
#	app/views/shared/projects/_project.html.haml
#	db/schema.rb
#	spec/models/project_spec.rb
2016-03-21 23:22:21 +01:00
Douwe Maan 45e8650c4f Fix specs 2016-03-20 23:26:58 +01:00
Stan Hu 68fa4de6e3 Make HTTP(s) label consistent on clone bar
Sites that use http:// for the external_url should always display HTTP on
the clone bar. Similarly, sites that use https:// should show HTTPS.
2016-03-19 22:47:27 -07:00
Drew Blessing 66a8281fdd Fix and test leave project display 2015-12-21 15:58:42 -06:00
Yorick Peterse ff8f7fb0a1 Re-use User for avatars in link_to_member 2015-10-15 12:05:01 +02:00
Stan Hu 3fbcc51102 Update README cache key to use full project namespace 2015-10-02 13:26:42 -07:00
Stan Hu a5e8ea54ec Fix Error 500 when browsing projects with no HEAD
Steps to reproduce:
1. Create a project with a README
2. In the actual remote, type: `git symbolic-ref HEAD refs/heads/nowhere`
3. Check that HEAD is gone via `git ls-remote .`
4. Go to the projects page and see the Error 500

Closes https://github.com/gitlabhq/gitlabhq/issues/9484
2015-07-24 10:14:58 -07:00
Valery Sizov 111ebe5471 Fork visibility level fix 2015-07-06 17:40:33 +03: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 4641514cbf Update rspec tests to the new external issue logic. 2015-01-26 15:59:40 -08:00
Valery Sizov a9f7fd2c1a Github Importer 2015-01-10 09:51:43 -08:00
Dmitriy Zaporozhets ed82ab4117 Remove some deprecations and fir project helper specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-10 12:11:29 +02:00
Johannes Schleifenbaum d9deb24f3a Preselect the current issue tracker with selected="selected"
The previous behavior was, that the first element of the select was
preselected, thus upon saving the project, the previous selected could
be overwritten.
2013-11-01 15:33:47 +01:00
Stefano Tortarolo 65f5d062e9 Use proper titles for issues trackers 2013-10-09 09:21:53 +02:00