There is no need to check if `repository_ref` is present as:
```
@repository_ref = if repository_ref.present?
repository_ref
else
nil
end
```
is as same as doing:
```
@repository_ref = repository_ref
```
Refactor web editor
* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fixes#1761
See merge request !773
Order commit comments in API chronologically
When fetching commit comments via API, the comments were not ordered,
but just returned in the order Postgresql finds them. Now the API always
returns comments in chronological order.
Same as !628 but with CI
See merge request !768
Fix upgrader script
This is a fix for upgrader script not guessing the latest version correctly.
Upgrader now handles versions where a version part (major/minor/patch) can have multi-digit number, also ensures that the latest version is chosen from git tags by converting tag to Gitlab::VersionInfo and than selecting the latest/greatest version.
Fixes: #1476
See merge request !695
Make namespace API available to all users
### What does this MR do?
This MR makes it possible for a user to query namespaces to which he/she has access. Also, it adds documentation for the existing API.
### Why was this MR needed?
Even though the `groups` API exists, it might still be useful to have an endpoint that tells the namespace type (e.g. `user` vs. `group`), especially if a user has access to a number of different projects.
### What are the relevant issue numbers?
Closes https://github.com/gitlabhq/gitlabhq/issues/9328
See merge request !708
Group improvements
* remove projects before removing group
* execute all hooks/events from project destroy when group removed
* log group create/remove
* delay remove of namespace directory (to prevent NFS issues)
Inspired by !759
See merge request !761
Remove gitlab:env:check task.
Rake task that checks for git user git settings is a leftover from early days.
It is not being used by the web editor(and web editor is also being redone atm) so this rake task just causes confusion.
Adresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2362
See merge request !758
Ths commit does next:
* When we remove project we move repository to path+deleted.git
* Then we schedule removal of path+deleted with sidekiq
* If repository move failed we abort project removal
This should help us with NFS issue when project get removed but
repository stayed. The full explanation of problem is below:
* rm -rf project.git
* rm -rf removes project.git/objects/foo
* NFS server renames foo to foo.nfsXXXX because some NFS client (think
* Unicorn) still has the file open
* rm -rf exits, but project.git/objects/foo.nfsXXX still exists
* Unicorn closes the file, the NFS client closes the file (foo), and the
* NFS server removes foo.nfsXXX
* the directory project.git/objects/ still exists => problem
So now we move repository and even if repository removal failed
Repository directory is moved so no bugs with project removed but
repository directory taken. User still able to create new project with
same name. From administrator perspective you can easily find stalled
repositories by searching `*+deleted.git`
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Until now, a user needed to first sign in with his LDAP identity and then manually
link his/her account with an omniauth identity from their profile.
Only when this is done can the user authenticate with the omniauth provider and at
the same time benefit from the LDAP integration (HTTPS authentication with LDAP
username/password and in EE: LDAP groups, SSH keys etc.).
This feature automates the process by looking up a corresponding LDAP person when a
user connects with omniauth for the first time and then automatically linking the LDAP
and omniauth identities (of course, like the existing allow_single_sign_on setting,
this is meant to be used with trusted omniauth providers).
The result is identical to a manual account link.
Add config initializers for other omniauth settings.
You can not remove user if he/she is an only owner of group
To prevent loose of group data you need to transfer or remove group
first before you can remove user
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !730
To prevent loose of group data you need to transfer or remove group
first before you can remove user
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Remove Rack Attack monkey patches and bump to version 4.3.0
I finally got these monkey patches into Rack Attack v4.3.0, so GitLab no longer needs them. Hooray!
See: https://github.com/kickstarter/rack-attack/pull/128
See merge request !693
Fix reference links in dashboard activity and ATOM feeds.
References like `@user` were not linked on the dashboard activity feed and in Atom feeds, because the reference parser depends on `@project` which isn't set in those situations.
This MR passes the project in question to the reference parsers in an option.
cc @rspeicher
See merge request !653
This makes the memory growth-triggered Sidekiq restarts more reliable by
reducing the chance that Sidekiq ends up in a state where it is not
accepting new jobs but also not shutting down: SIGKILL is more likely to
work than SIGTERM.
Batch 1 of text improvements
Batch 1 of changes from my effort at !635 to walk through every piece of text in GitLab and see if it can be improved.
This batch includes:
- Improve text on error pages.
- Improve Git access error messages.
- Improve description of branch protection levels.
- Improve OAuth signup error message.
- Improve OAuth application flash messages.
cc @rspeicher
See merge request !642
There is no real issue here because the shell command is completely
static, but it is still nicer to just follow the guidelines in
doc/development/shell_commands.md .
When fetching commit comments via API, the comments were not ordered,
but just returned in the order Postgresql finds them. Now the API always
returns comments in chronological order.
It looks like SIGTERM may not be enough to shut down a Sidekiq process
when its RSS has gotten too big. This change will allow us to experiment
with sending SIGKILL instead of SIGTERM to Sidekiq processes on
gitlab.com.
jasmine-rails still requires it as a dependency, but for some reason
running `rake jasmine:ci` produced test failures but
`rake spec:javascript` didn't.
While `escape_once` will create this HTML entity, Nokogiri always
translates it back before it gets to IssueReferenceFilter, so there
should be no danger of erroneous issue links.
Importing a JSON file with only one Subversion project lead to confusion
over whether the system was working. Provide status why these projects
could not be imported directly.
Closes#1531
Minor design change grab-bag 🎉
I started with one simple change and found a few more, so here they are.
### Simplify icon style selectors
All FontAwesome icons have an `fa` class, so just use that.
### Don't override color of code blocks in notes
This was a pet peeve of mine.
| Before | After |
|:------:|:-----:|
|  |  |
### Items with tooltips don't need a 'data-original-title' attribute
This attribute gets added dynamically by Bootstrap's tooltip JS based on the `title` attribute
### Fix Profile > Design live-updating
`ui_blue` wasn't added to the list of classes to remove, so if a user changed to that theme, any subsequent changes wouldn't be live-updated.
This change refactors Gitlab::Theme a bit to make it harder for this to happen in the future with new themes.
### Remove the `has_bottom_tooltip` class
Bootstrap's tooltip JS can read the placement from a `data-placement` attribute.
Further, when we supply the `selector` option to `tooltip`, tooltips will be added to any dynamically-added elements matching the selector, without us having to re-call the `tooltip` method.
See merge request !569
`ui_blue` wasn't added to the list of classes to remove, so if a user
changed to that theme, any subsequent changes wouldn't be live-updated.
This change refactors Gitlab::Theme a bit to make it harder for this to
happen in the future with new themes.
When using MySQL as database backend in GitLab, ``date`` in ``date(created_at), count(id) as total_amount``
won't return the ``date`` column (should be ``date(created_at)``), as a result, there's no contribution in the user
profile page.
Adding an ``as date`` can solve this problem.
Convert GFM reference handling to html-pipeline filters
- `Gitlab::Markdown` is now much cleaner
- Better separation of concerns
- Cleaner, less brittle, more maintainable specs for each reference type.
- Label references actually work!
See merge request !1753
Parse GFM references after sanitizing
Parse GFM references - labels, issues, MRs, etc. - after calling the HTML Pipeline `SanitizationFilter` so that we can use non-whitelisted attributes like `style`. See #2188.
See merge request !1745