Commit Graph
82 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
Kamil Trzcinski b8d1545bf1 Update language after doing all other operations 2016-04-05 10:54:34 +02:00
Grzegorz Bizon 0115ad66d2 Merge branch 'master' into feature/issue-move
* master: (121 commits)
  Dedupe labels in labels selector in Dashboard pages
  Refactor colors and lists
  Add a safeguard in MergeRequest#compute_diverged_commits_count
  Fix an issue when the target branch of a MR had been deleted
  Add avatar to issue and MR pages header
  Cleanup somce css colors
  Re-group scss variables
  Refactor `Todo#target`
  Fixes issue with filter label missing on labels & milestones
  Rename `Todo#to_reference` to `Todo#target_reference`
  Fixed failing tests
  Updated controller with before_action Fixed other issues based on feedback
  Fixes issue on dashboard issues
  Full labels data in JSON
  Fixed issue with labels dropdown getting wrong labels
  Update CHANGELOG
  Use `Note#for_project_snippet?` to skip notes on project snippet
  Use `Commit#short_id` instead of `Commit.truncate_sha`
  Reuse `for_commit?` on conditional validations
  Update schema info comment on todo related files
  ...

Conflicts:
	app/models/issue.rb
	db/schema.rb
	spec/models/issue_spec.rb
2016-03-19 18:50:15 +01: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
Grzegorz Bizon 5e405bfea9 Update methods that use issue close service
`Issues::CloseService#execute` signature has changed, because of using
keyword parameter for commmit.
2016-03-17 09:54:16 +01:00
connorshea 0129f346ee Remove parentheses from if statement
Otherwise Rubocop will give a warning.

As mentioned in !3197.
2016-03-15 10:42:16 -06: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
Dmitriy Zaporozhets 0f14980383 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2016-03-09 10:13:09 +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
tiagonbotelhoandYorick Peterse 96c0255107 moves the main_language update logic to git push service 2016-03-07 21:59:39 +01:00
Valery Sizov 21a05328ff Security: Fix issue auto closing 2016-03-03 16:42:44 +02:00
Yorick Peterse ff28a7cc36 Moved cache expiration code to Repository hooks
This keeps all the cache expiration code in a single file/class instead
of spreading it all across the codebase.
2016-02-23 12:02:59 +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 83a81ffc5d typo 2016-02-12 09:16:19 +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
Kamil Trzcinski 64bfd9d71a Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
Kamil Trzcinski fd6b589496 Since GitLab CI is enabled by default, remove enabling it by pushing .gitlab-ci.yml 2015-11-19 12:09:34 +01:00
Kamil Trzcinski 6384c757b7 Expose CI enable option in project features
- Enable CI by default for all new projects
2015-11-13 10:52:50 +01:00
Douwe Maan cc2b05adf8 Fix bug where a push would only create cross references from the first commit. 2015-10-18 14:05:27 +02: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
Douwe Maan b0164771ec Simplify code around (cross)-references 2015-10-12 11:54:46 +02:00
Dmitriy Zaporozhets 5de0b07844 Prevent creating 2 Ci::Project entities when enable CI
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 10:08:16 +02:00
Dmitriy Zaporozhets aba9668ace Rescue rugged error when detect ci yml file
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-23 14:29:41 +02:00
Dmitriy Zaporozhets 2eb9a20f36 Enable CI for gitlab when .gitlab-ci.yml is pushed
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-23 13:11:40 +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
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 24332b7b99 Revert "Make web editor work correctly after switch from satellites"
This reverts commit 435f680b89.
2015-08-11 11:49:29 +02:00
Dmitriy Zaporozhets 9f10943c1a Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets b48b07044b Merge branch 'master' into drop-satellites
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-04 16:42:36 +02:00
Dmitriy Zaporozhets f0116f1335 Store commit count in project table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-17 15:22:56 +02:00
Dmitriy Zaporozhets 67ca5a53f6 Build missing cache items in background job after each push
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-17 14:50:03 +02:00
Dmitriy Zaporozhets a87989fb7d Remove satellites 2015-07-15 15:45:57 +02:00
Robert SpeicherandDmitriy Zaporozhets 2120e2dd95 Replace remaining references to Note.create_cross_reference_note 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
Dmitriy Zaporozhets 435f680b89 Make web editor work correctly after switch from satellites
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-02 12:06:40 +02: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 27af24c1c9 No longer needed to pass project argument to commit methods. 2015-04-24 12:29:36 +02:00
Douwe Maan 65bb0c3406 Only allow users to cross-reference and close issues they have access to. 2015-04-02 10:57:01 +02:00
Douwe Maan d9698628d9 Add Commit#author and #committer. 2015-04-02 10:57:01 +02:00
Kamil Trzcinski 5b432e7671 Extend push_tag event to include tag message and last commit 2015-03-21 11:25:27 +01:00
Douwe Maan a5a5ec970e Fewer constants, more helpers. 2015-03-19 10:34:04 +01:00
Douwe Maan f2024b1e06 More consistent method naming. 2015-03-13 16:07:02 +01:00
Douwe Maan 383c56efa1 Use Gitlab::Git helper methods and constants as much as possible. 2015-03-10 13:39:31 +01:00