Commit Graph
54 Commits
Author SHA1 Message Date
Drew Blessing 935bf7271d Only update main language if it is not already set 2016-04-06 14:56:40 -05:00
Kamil Trzcinski aad3b6ddf8 Update language only on HEAD of the repository 2016-04-05 11:08:41 +02:00
Douglas Barbosa Alexandre 43d8bdb4f0 Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
Yorick Peterse cd05d3f78d Cache project avatars stored in Git
The avatar logic has been moved from Project to Repository as this makes
caching easier. The logic itself in turn has been changed so that the
logo file names are cached in Redis. This cache is flushed upon pushing
a commit but _only_ if:

1. The commit was pushed to the default branch
2. The commit actually changes any of the logo files

If no branch or commit is given the cache is flushed anyway, this
ensures that calling Repository#expire_cache without any arguments still
flushes the avatar cache (e.g. this is used when removing a project).

Fixes gitlab-org/gitlab-ce#14363
2016-03-17 18:51:54 +01:00
Jacob Vosmaer 30b36c92c3 Use an exception to pass messages 2016-03-15 11:03:43 +01:00
Jacob Vosmaer 021d53c96d Run 'git gc' every 10 pushes 2016-03-14 16:49:24 +01:00
ashleys 4cd9a5208c web hooks to webhooks 2016-03-10 14:48:29 -05:00
Yorick Peterse 53719ecb80 Handle permissions for ExternalIssue instances
This fixes the remainder of the GitPushService specs.
2016-03-09 17:10:43 +01:00
Yorick Peterse 96d35c5975 Fixed part of the GitPushService specs
These were broken by commit 21a05328ff.
Two JIRA tests remain broken but I can't quite figure out how to fix
them.
2016-03-09 17:10:43 +01:00
tiagonbotelhoandYorick Peterse 4929592458 adds test for git push service for updating the language of the project 2016-03-07 21:59:39 +01:00
James Lopez c110c9bd7f refactored spec 2016-02-17 18:29:43 +01:00
James Lopez 5255a54df9 refactored some stuff based on MR feedback 2016-02-17 10:42:59 +01:00
James Lopez 20e79f714a refactored GitPushService and updated spec 2016-02-15 15:51:00 +01:00
James Lopez 77d2aeabec attempt to reduce code complexity on GitPushService#execute 2016-02-11 12:50:27 +01:00
Yorick Peterse 2ce0d06389 Smarter flushing of branch statistics caches
Instead of flushing the behind/ahead counts for all branches upon every
push we now only flush the cache of branches that actually need to have
these statistics recalculated. There are now basically 2 scenarios and
their effects:

1. A user pushes a commit to the default branch, this results in the
   cache being flushed for all branches.
2. A user pushes to a non default branch, this results in _only_ the
   cache for that branch being flushed.

The existing code (Repository#expire_cache) remains backwards compatible
with the previous behaviour, the new behaviour is only applied when a
branch name is passed as an argument. This ensures that when for example
a project is deleted the cache for all branches is flushed.
2016-02-09 17:17:56 +01:00
Yorick Peterse 9a99d8e49d Cache various Repository Git operations
This caches the output of the following methods:

* Repository#empty?
* Repository#has_visible_content?
* Repository#root_ref

The cache for Repository#has_visible_content? is flushed whenever a
commit is pushed to a new branch or an existing branch is removed.
The cache for Repository#root_ref is only flushed whenever a user
changes the default branch of a project. The cache for Repository#empty?
is never explicitly flushed as there's no need for it.
2016-02-08 15:40:19 +01:00
Drew Blessing f177aaa5fa Backport JIRA service 2015-12-18 14:19:48 -06:00
Douwe Maan a2cfb44157 Tag service specs 2015-12-09 11:55:49 +01:00
Stan Hu 2611d9f63c Add a system note and update relevant merge requests when a branch is deleted or re-added
If a branch is deleted with an open merge request, amended offline, and then pushed again,
GitLab doesn't bother to update the merge request even though the last commit ID and/or
code may have changed. This MR ensures that each push will update any relevant merge
requests and adds a system note if this happens as well.

Closes #2926
2015-10-15 23:54:13 -07:00
Robert Speicher 530f0d71f5 Shut up, Rubocop 2015-10-14 01:07:58 -04:00
Douwe Maan 127f288afb Use to_reference where possible. 2015-10-13 09:37:42 +00:00
Douwe Maan b0164771ec Simplify code around (cross)-references 2015-10-12 11:54:46 +02:00
Maël Valais a9e409179b Create cross-reference for closing references on commits pushed to non-default branches.
I also revamped the tests on "closing reference commits" (= "Fixes #xxxx" for example).
Now, there are two different contexts:
- when the commits with "closing reference" are pushed to the default branch,
- when the commits with "closing reference" are pushed to a non-default branch.

Closes gitlab-org/gitlab-ce#2190.
2015-08-22 16:49:09 +02:00
Robert Speicher cf7c57aaf5 Use stub_application_setting in a few more specs
These specs also failed when run by themselves before this change, so
we've likely got some kind of cross-test contamination going on.
2015-07-06 22:39:56 -04:00
Dmitriy Zaporozhets f40b99d02e Merge branch 'master' into rubocop-for-tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/issues_spec.rb
	spec/models/forked_project_link_spec.rb
	spec/models/hooks/service_hook_spec.rb
	spec/models/hooks/web_hook_spec.rb
	spec/models/project_services/hipchat_service_spec.rb
	spec/requests/api/project_members_spec.rb
	spec/requests/api/projects_spec.rb
	spec/requests/api/system_hooks_spec.rb
	spec/services/archive_repository_service_spec.rb
	spec/support/matchers.rb
	spec/tasks/gitlab/backup_rake_spec.rb
2015-06-23 10:44:03 +02:00
Robert Speicher 15a05be70d Fix Style/Blocks cop violations 2015-06-22 16:00:54 -04:00
Dmitriy Zaporozhets cf259cdb43 Remove unnecessary whitespace between let and (
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 14:39:07 +02:00
Robert SpeicherandDmitriy Zaporozhets 7460c39f60 Fix GitPushService spec 2015-06-22 12:13:47 +02:00
Robert SpeicherandDmitriy Zaporozhets 2120e2dd95 Replace remaining references to Note.create_cross_reference_note 2015-06-22 12:13:46 +02:00
Robert SpeicherandDmitriy Zaporozhets 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Stan Hu d45112258e Fix post-receive errors on a push when an external issue tracker is configured
Closes #1700
Closes #1720
2015-06-12 06:59:27 -07:00
Stan Hu 03138a3c72 Make the first branch pushed to an empty repository the default HEAD.
In an empty repository, pushing a new branch not called "master" would
leave HEAD in an unknown state, causing ambiguity if another branch
were pushed. This could in turn cause a new protected branch to be
created and cause the default branch to change.

* Closes #1561
* Closes #1576
* Closes https://github.com/gitlabhq/gitlabhq/issues/8883
2015-05-05 23:49:30 -07:00
Douwe Maan 0ff778c0f4 Link cross-project cross-reference notes to correct project. 2015-04-24 12:30:36 +02:00
Douwe Maan 8ed7ac9d44 Use project.commit convenience method. 2015-04-24 12:29:36 +02:00
Kamil Trzcinski 5b432e7671 Extend push_tag event to include tag message and last commit 2015-03-21 11:25:27 +01:00
Hannes Rosenögger 224e104d8d fix mass SQL statements on initial push
This commit disables process_commit_messages()
for the initial push to the default branch.
This fixes the mass SQL statements (~500000) that were executed during
the initial push of the linux kernel for example.
2015-03-09 12:52:45 +01:00
Stan HuandDouwe Maan afe5d7d209 Issue #595: Support Slack notifications upon issue and merge request events
1) Adds a DB migration for all services to toggle on push, issue, and merge events.

2) Upon an issue or merge request event, fire service hooks.

3) Slack service supports custom messages for each of these events. Other services
not supported at the moment.

4) Label merge request hooks with their corresponding actions.
2015-03-03 11:14:31 +01:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07: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
Marco Wessel ac7af45d89 Add test for default branch protection configuration 2015-01-31 09:10:26 +01:00
Marco Wessel aad6ceaef9 Allow configuring protection of the default branch upon first push 2015-01-25 17:09:10 +01:00
Ciro Santilli c3be1517ae Factor '0' * 40 blank ref constants 2014-11-03 20:37:08 +01:00
Marin Jankovski ab6459ad48 Add a simple spec test. 2014-09-29 16:07:53 +02:00
Dmitriy Zaporozhets 9ecd3bc6ce Improve git_push service specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-26 12:55:57 +03:00
Dmitriy Zaporozhets ff5176d45a Fix git_push service specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-01 15:11:27 +03:00
Dmitriy Zaporozhets 49f977d675 Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 19:55:23 +03:00
Dmitriy Zaporozhets c227aa44f9 Make changes to tests
* project_with_code -> project
* project -> ermpty_project

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 21:03:52 +02:00
Dmitriy Zaporozhets cfcf24dce5 Execute project hooks when issue or merge request created
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-04 13:37:17 +02:00
Marin Jankovski 9ed59ee9f0 Include project_id in webhook payload. 2013-10-14 12:03:25 +02:00
Hiroyuki Sato df9cbbc924 Drop support of root namespace in routing 2013-09-13 07:00:24 +09:00