Commit Graph

3388 Commits

Author SHA1 Message Date
Kamil Trzciński 5ac590677f Merge branch '25910-convert-manual-action-icons-to-svg-to-propperly-position-them' into 'master'
Convert pipeline action icons to svg to have them propperly positioned

Closes #25910

See merge request !8766
2017-01-31 11:42:06 +00:00
Rémy Coutable 211f728ad2 Merge branch 'feature/gb/expose-commit-and-mr-pipelines-api' into 'master'
Expose pipelines API for commits and merge requests

See merge request !8837
2017-01-31 07:48:40 +00:00
James Lopez 017a5068f6 fix spec failure 2017-01-30 14:26:32 +01:00
James Lopez 1a2d13c821 programmatically remove encrypted attributes. Added relevant spec. 2017-01-30 12:34:32 +01:00
James Lopez eeb13c16d1 rename method and added note to export file spec about new encrypted attributes 2017-01-30 12:34:32 +01:00
James Lopez 6a2b976c66 fix typo 2017-01-30 12:34:32 +01:00
James Lopez e589c7e848 Ignore encrypted attributes in Import/Export
* Regenerates tokens for all models that have them
* Remove variables, since they are basically just storing encrypted data
* Bumped version up to 0.1.6
* Updated related docs
2017-01-30 12:34:32 +01:00
Mike Greiling 7e51cd32d3 update scripts and docs to reference the newly namespaced rake task 2017-01-27 15:23:09 -06:00
Rémy Coutable f575fe46a7 Move Gitlab::Shell and Gitlab::ShellAdapter files to lib/
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-27 16:16:55 +01:00
Rémy Coutable c446cfcbae Move ApplicationSetting DEFAULTS to `.defaults` instead
This will avoid autoloading issues in the long term.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-27 16:16:55 +01:00
Grzegorz Bizon 6b3f52b46c Fix cycle analytics code after improving serializers 2017-01-27 14:37:14 +01:00
Robert Speicher b9ff4656a8 Merge branch '26943-fix-user-in-build-presenter' into 'master'
Don't override Ci::Build#user when presenting a build

Closes #26943

See merge request !8668
2017-01-27 11:30:57 +00:00
Filipa Lacerda 7db05c4da1 Removed unused method 2017-01-26 19:56:07 +00:00
Lin Jen-Shin 050103f209 Make sure TraceReader uses Encoding.default_external
Encoding.default_external was chosen over
Encoding.default_internal because File.read is
returning Encoding.default_external, therefore
we should align with it. Alternatively, we could
force both of them to be Encoding.default_internal.

However, ideally this should be determined by different
projects. For example, some projects might want to use
an encoding different to what GitLab is using.

This might not happen soon though.

Closes #27052
2017-01-26 18:29:44 +08:00
Douwe Maan e74c6ae6b6 Merge branch 'refresh-authorizations-fork-join' into 'master'
Fix race conditions for AuthorizedProjectsWorker

Closes #26194 and #26310

See merge request !8701
2017-01-25 20:30:29 +00:00
Grzegorz Bizon 6cfe60df22 Merge branch 'backport-ee-changes-for-build-minutes' into 'master'
Backport changes introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1078

See merge request !8657
2017-01-25 17:50:09 +00:00
Filipa Lacerda 4983fbaaf4 Remove unneeded 'borderless' from icons name 2017-01-25 15:44:45 +00:00
dimitrieh 066155704d added icons and fixed mini pipeline action dropdown icons 2017-01-25 15:44:44 +00:00
Yorick Peterse 88e627cf14
Fix race conditions for AuthorizedProjectsWorker
There were two cases that could be problematic:

1. Because sometimes AuthorizedProjectsWorker would be scheduled in a
   transaction it was possible for a job to run/complete before a
   COMMIT; resulting in it either producing an error, or producing no
   new data.

2. When scheduling jobs the code would not wait until completion. This
   could lead to a user creating a project and then immediately trying
   to push to it. Usually this will work fine, but given enough load it
   might take a few seconds before a user has access.

The first one is problematic, the second one is mostly just annoying
(but annoying enough to warrant a solution).

This commit changes two things to deal with this:

1. Sidekiq scheduling now takes places after a COMMIT, this is ensured
   by scheduling using Rails' after_commit hook instead of doing so in
   an arbitrary method.

2. When scheduling jobs the calling thread now waits for all jobs to
   complete.

Solution 2 requires tracking of job completions. Sidekiq provides a way
to find a job by its ID, but this involves scanning over the entire
queue; something that is very in-efficient for large queues. As such a
more efficient solution is necessary. There are two main Gems that can
do this in a more efficient manner:

* sidekiq-status
* sidekiq_status

No, this is not a joke. Both Gems do a similar thing (but slightly
different), and the only difference in their name is a dash vs an
underscore. Both Gems however provide far more than just checking if a
job has been completed, and both have their problems. sidekiq-status
does not appear to be actively maintained, with the last release being
in 2015. It also has some issues during testing as API calls are not
stubbed in any way. sidekiq_status on the other hand does not appear to
be very popular, and introduces a similar amount of code.

Because of this I opted to write a simple home grown solution. After
all, all we need is storing a job ID somewhere so we can efficiently
look it up; we don't need extra web UIs (as provided by sidekiq-status)
or complex APIs to update progress, etc.

This is where Gitlab::SidekiqStatus comes in handy. This namespace
contains some code used for tracking, removing, and looking up job IDs;
all without having to scan over an entire queue. Data is removed
explicitly, but also expires automatically just in case.

Using this API we can now schedule jobs in a fork-join like manner: we
schedule the jobs in Sidekiq, process them in parallel, then wait for
completion. By using Sidekiq we can leverage all the benefits such as
being able to scale across multiple cores and hosts, retrying failed
jobs, etc.

The one downside is that we need to make sure we can deal with
unexpected increases in job processing timings. To deal with this the
class Gitlab::JobWaiter (used for waiting for jobs to complete) will
only wait a number of seconds (30 by default). Once this timeout is
reached it will simply return.

For GitLab.com almost all AuthorizedProjectWorker jobs complete in
seconds, only very rarely do we spike to job timings of around a minute.
These in turn seem to be the result of external factors (e.g. deploys),
in which case a user is most likely not able to use the system anyway.

In short, this new solution should ensure that jobs are processed
properly and that in almost all cases a user has access to their
resources whenever they need to have access.
2017-01-25 13:22:15 +01:00
Rémy Coutable 68e94450a0
Raise Gitlab::View::Presenter::CannotOverrideMethodError if presentee already respond to method
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-25 12:14:02 +01:00
Kamil Trzcinski ac92554dfc
Merge remote-tracking branch 'origin/master' into backport-ee-changes-for-build-minutes 2017-01-24 21:52:54 +01:00
Robert Speicher 94cc7cfad2 Merge branch 'dont-persist-application-settings-in-test-env-bis' into 'master'
Dont persist application settings in test env

See merge request !8715
2017-01-24 19:14:14 +00:00
Sean McGivern 65bf7e0d92 Merge branch '24833-Allow-to-search-by-commit-hash-within-project' into 'master'
Allows to search within project by commit's hash #24833

Closes #24833

See merge request !8028
2017-01-24 13:48:33 +00:00
YarNayar 99404a5851 Search feature: redirects to commit page if query is commit sha and only commit found
See !8028 and #24833
2017-01-24 14:58:00 +03:00
YarNayar dd3ddcd72b Allows to search within project by commit's hash
Was proposed in #24833
2017-01-24 14:56:00 +03:00
Rémy Coutable 0ac65b6cc3 Don't override presentee methods for Gitlab::View::Presenter::Delegated
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-24 10:24:47 +01:00
Douwe Maan c24a2d3298 Merge branch '22619-add-an-email-address-to-unsubscribe-list-header-in-email' into 'master'
Handle unsubscribe notification via email

Closes #22619

See merge request !6597
2017-01-23 20:39:16 +00:00
Douwe Maan 0d77b99cdd Merge branch '22638-creating-a-branch-matching-a-wildcard-fails' into 'master'
Allow creating protected branches when user can merge to such branch

Closes #22638

See merge request !8458
2017-01-23 20:36:28 +00:00
Rémy Coutable 765d57d650
Rescue from ActiveRecord::UnknownAttributeError and fallback to fake settings
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-23 16:58:13 +01:00
Grzegorz Bizon 632c2939bb Revert "Merge branch 'revert-9cac0317' into 'master' "
This reverts commit c20934869f, reversing
changes made to 4b7ec44b91.
2017-01-23 16:35:24 +01:00
Kamil Trzciński 7446c2f5cf Merge branch 'feature/success-warning-icons-in-stages-builds' into 'master'
Use a warning icon for a stage with allowed to fail builds

Closes #21948

See merge request !8503
2017-01-23 14:32:06 +00:00
Grzegorz Bizon baeaa97ef4 Revert "Merge branch 'dont-persist-application-settings-in-test-env' into 'master'"
This reverts merge request !8573
2017-01-21 22:55:35 +00:00
Stan Hu 8dbac708dc Revert "Merge branch 'backport-fix-load-error' into 'master'"
This reverts merge request !8671
2017-01-21 00:37:04 +00:00
Rémy Coutable aaa986c0d2
Don't define ApplicationSetting defaults in a constant
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-20 20:10:15 +01:00
Rémy Coutable 4af1f18639 Merge branch 'fix/import-users' into 'master'
Fix import no longer mapping users as admin

Closes #25346

See merge request !8625
2017-01-20 16:03:44 +00:00
Robert Speicher 9cac031769 Merge branch 'dont-persist-application-settings-in-test-env' into 'master'
Don't persist application settings in test env

See merge request !8573
2017-01-20 15:42:54 +00:00
James Lopez e8396d8e73 fix member mapper spec 2017-01-20 14:37:52 +01:00
Kamil Trzcinski b7f4553e3e
Backport changes introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1083 2017-01-20 12:25:53 +01:00
Robert Speicher c84272dc9a Merge branch 'feature/gitaly-feature-flag' into 'master'
Gitaly feature flag

See merge request !8440
2017-01-19 17:39:44 +00:00
Dmitriy Zaporozhets 9a985f6ec3 Merge branch '23563-document-presenters' into 'master'
Document presenters

Closes #23563

See merge request !8480
2017-01-19 14:51:25 +00:00
Kamil Trzciński 046e0bd6e7 Merge branch 'fix/external-status-badge-links' into 'master'
Link external commit status badges to target URLs

Closes #25662

See merge request !8611
2017-01-19 11:37:38 +00:00
James Lopez e8a9682bc9 fix typo 2017-01-19 09:44:20 +01:00
Douwe Maan 1cc6d206b5 Merge branch 'fix/refactor-cycle-analytics-stages' into 'master'
Refactor cycle analytics stages (1st iteration)

See merge request !7647
2017-01-18 18:22:35 +00:00
Sean McGivern cc1e43da39 Merge branch 'time-tracking-api' into 'master'
Time tracking API

Closes #25861

See merge request !8483
2017-01-18 18:18:13 +00:00
Ahmad Sherif 0a1c8bb37c Pass Gitaly resource path to gitlab-workhorse if Gitaly is enabled 2017-01-18 19:43:17 +02:00
Ruben Davila 0f3c9355c1 Add some API endpoints for time tracking.
New endpoints are:

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/time_estimate"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/reset_time_estimate"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/add_spent_time"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/reset_spent_time"

GET  :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/time_stats"
2017-01-18 10:48:16 -06:00
James Lopez 17c099161e fix and refactor note user mapping 2017-01-18 17:40:24 +01:00
Douwe Maan f208897ccb Merge branch 'backport-time-tracking-ce' into 'master'
Backport timetracking to CE

See merge request !8195
2017-01-18 15:49:22 +00:00
Rémy Coutable 061bb6eb6e More improvements to presenters
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-18 16:38:35 +01:00
Rémy Coutable e5a29b4514 Improve presenter factory
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-18 16:38:34 +01:00