Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-01-27Add the rspec_profiling gem and documentation to the GitLab development ↵Nick Thomas
environment
2017-01-25Merge branch 'refresh-authorizations-fork-join' into 'master' Douwe Maan
Fix race conditions for AuthorizedProjectsWorker Closes #26194 and #26310 See merge request !8701
2017-01-25Fix race conditions for AuthorizedProjectsWorkerYorick Peterse
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-23Revert "Merge branch 'revert-9cac0317' into 'master' "Grzegorz Bizon
This reverts commit c20934869f7dc8cfbdbafb6ecb7b1305452c9e8a, reversing changes made to 4b7ec44b91e0571d209c790d54947ba1756dac0e.
2017-01-22Revert "Merge branch 'dont-persist-application-settings-in-test-env' into ↵Grzegorz Bizon
'master'" This reverts merge request !8573
2017-01-15Don't persist ApplicationSetting in test envRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-01Pass commit data to ProcessCommitWorkerYorick Peterse
By passing commit data to this worker we remove the need for querying the Git repository for every job. This in turn reduces the time spent processing each job. The migration included migrates jobs from the old format to the new format. For this to work properly it requires downtime as otherwise workers may start producing errors until they're using a newer version of the worker code.
2016-12-01Only include EmailHelpers in mailer specs and specs using themRobert Speicher
2016-11-09Refine specs for build show page with environmentsGrzegorz Bizon
2016-11-08Fix broken commits searchValery Sizov
2016-10-28Replace static issue fixtures by script (!6059)winniehell
2016-10-25Don't schedule ProjectCacheWorker unless neededYorick Peterse
This changes ProjectCacheWorker.perform_async so it only schedules a job when no lease for the given project is present. This ensures we don't end up scheduling hundreds of jobs when they won't be executed anyway.
2016-10-12Revert "Merge branch 'tests-use-tmpfs' into 'master'"Yorick Peterse
This reverts merge request !6730
2016-10-06Try tmpfs for repository storage, etcNick Thomas
2016-09-28Upgrade Devise from 4.1.1 to 4.2.0.Connor Shea
This fixes an issue with Rails 5 and brings us up-to-date with the latest Devise release. This also replaces the deprecated Devise::TestHelpers with Devise::Test::ControllerHelpers. Changelog: https://github.com/plataformatec/devise/blob/v4.2.0/CHANGELOG.md#420---2016-07-01
2016-08-24Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin
artifacts-from-ref-and-build-name * upstream/master: (192 commits) Added CHANGELOG Added unfold test to parallel and added 'diff discussion' context Fix Spinach branches spec Better first match on this MR also Change merge_error column from string to text type Fix typo in gitlab_flow.md entities: make Environment inherit EnvironmentBasic Updated to optimized specs from !5864 Added 'with an unfolded line should not allow commenting' scenario (line 125) Added addtional 'renderable' validator to check 'data-note-type' attr exists Allow passing an index to selectRowAtIndex Fixed enter key in search input not working Fix file links on project page Files view Fix incorrect "stopped impersonation" log message 8.11 is released, long live 8.12 Also check if Akismet is enabled, before showing the `Submit as spam` button. fix location of markdown help location Fix for update 8.10-to-8.11.md doc. Appease the linter. Add Ruby 2.3 upgrade notes. ...
2016-08-19Use travel_to instead of dependency injection, feedback:Lin Jen-Shin
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5734#note_14056642
2016-08-10Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin
artifacts-from-ref-and-build-name * upstream/master: (516 commits) Rename `run` task helper method to prevent conflict with StateMachine Add a method in Project to return a cached value of total count of projects Add Changelog entry for Grape upgrade [ci skip] Fix Grape tests. Retain old behavior Update Grape from 0.13.0 to 0.15.0. adds second batch of tests changed to active tense fixes part1 of files to start using active tense Clarify the features for generating default label sets Update tree view to sort folders with submodules Memoize CI config node validator to prevent leaks fix MR source project assignment remove offending empty line Rails prefers require_dependency so that it won't require twice: use Unix line endings for API documentation use long options for curl examples in API documentation (!5703) Prefixes removed branches name with PR number when importing PR from GH Update CHANGELOG Remove SHA suffix for removed branches name when importing PR from GH add linting script for documentation ...
2016-08-10Add a method in Project to return a cached value of total count of projectsStan Hu
This is in preparation to address the DB load caused by the counting in gitlab-com/infrastructure#303.
2016-07-21Introduce SimpleCovEnv singleton helper and use itGrzegorz Bizon
2016-07-21Update configuration of SimpleCovKamil Trzcinski
2016-07-21Store all simplecov configuration in one fileKamil Trzcinski
2016-07-21Remove unused simplecov-rcovKamil Trzcinski
2016-07-21Merge coverage reportKamil Trzcinski
2016-07-18Merge branch 'master' into artifacts-from-ref-and-build-nameLin Jen-Shin
* master: (335 commits) Disable transaction when adding index for Ci::Pipeline added changelog allow empty repos on import/export Modify test for Build tabs Add tests to project builds for pending tab Remove unused .js-running-count class Add test for new pending tab and update tests for running tab Add Pending Tab to Admin Builds added changelog limit project expor retry to only 3 use method in validates statement Fix spec to set import_url before attempting to create import_data Allow a project import URL to be blank to prevent false positives preventing settings from being saved Refactor gitlab_ci_yaml_processor variables tests Fix CI yaml example Align cancel and retry buttons Remove deploy to production button Remove irrelevant comments Fix gitlab_ci_yaml_processor_spec.rb Fix AddWhenAndYamlVariablesToCiBuilds migration ...
2016-07-12Add all the tests and fix stuffs along the way:Lin Jen-Shin
It turns out they are different: builds.success.latest.first and builds.latest.success.first If we put success first, that latest would also filter via success, and which is what we want here.
2016-07-12We're not using them (and look at the typo)Lin Jen-Shin
2016-06-30Remove coveralls linesZ.J. van de Weg
2016-06-08Enable Knapsack only in CI environmentKamil Trzcinski
2016-06-07Remove knapsack_merger since we don't use it anywayKamil Trzcinski
2016-06-03Use knapsack everywhereKamil Trzcinski
2016-06-03Use own version of knapsack which supports spinach testsKamil Trzcinski
2016-06-03Try to use knapsackKamil Trzcinski
2016-05-01Update rspec-rails from 3.3.3 to 3.4.2.Connor Shea
This allows the removal of the monkey patch from this commit: 47ff1c56089b3df9c36b77c02f0f3db54fea1d54 It'll also make it slightly easier to upgrade to 3.5.0 later. Changelog: https://github.com/rspec/rspec-rails/blob/master/Changelog.md#340--2015-11-11
2016-03-15Original implementation to allow users to subscribe to labelsTimothy Andrew
1. Allow subscribing (the current user) to a label - Refactor the `Subscription` coffeescript class - The main change is that it accepts a container, and conducts all DOM queries within its scope. We need this because the labels page has multiple instances of `Subscription` on the same page. 2. Creating an issue or MR with labels notifies users subscribed to those labels - Label `has_many` subscribers through subscriptions. 3. Adding a label to an issue or MR notifies users subscribed to those labels - This only applies to subscribers of the label that has just been added, not all labels for the issue.
2016-03-10Removed benchmark suite and its documentationYorick Peterse
The rationale for this can be found in https://gitlab.com/gitlab-org/gitlab-ce/issues/13718 but in short the benchmark suite no longer serves a good purpose now that we have proper production monitoring in place. Fixes gitlab-org/gitlab-ce#13718
2016-03-09Retry failed testsKamil Trzcinski
2016-01-26Add temporary monkey patch to get specs passing on 4.2.5.1Robert Speicher
2015-11-30fix notification_service specsValery Sizov
2015-10-05Merge branch 'refactor-build-service' into 'master' Kamil Trzciński
Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page This makes Ci::Commit to have only :sha and simplifies routing to have only :sha in path. The :ref and :push_data is now parameter of Ci::Build. All commit related data (git author, message and .gitlab-ci.yml) is read directly from repository. All code related for creating builds is moved to CreateBuildsService. Status deduction is rewritten to make if more efficient and easier to integrate with Commit Status API. This is partially working, tests are not yet touched. This slightly changes view of Commit: ![Screen_Shot_2015-10-02_at_15.21.47](https://gitlab.com/gitlab-org/gitlab-ce/uploads/ad3f1ccdcc87659ea437d8db6c5b9f94/Screen_Shot_2015-10-02_at_15.21.47.png) @dzaporozhets What do you think? See merge request !1502
2015-10-05Make commit_spec runKamil Trzcinski
2015-10-02Basic setup for an RSpec based benchmark suiteYorick Peterse
This benchmark suite uses benchmark-ips (https://github.com/evanphx/benchmark-ips) behind the scenes. Specs can be turned into benchmark specs by setting "benchmark" to "true" in the top-level describe block like so: describe SomeClass, benchmark: true do end Writing benchmarks can be done using custom RSpec matchers, for example: describe MaruTheCat, benchmark: true do describe '#jump_in_box' do it 'should run 1000 iterations per second' do maru = described_class.new expect { maru.jump_in_box }.to iterate_per_second(1000) end end end By default the "iterate_per_second" expectation requires a standard deviation under 30% (this is just an arbitrary default for now). You can change this by chaining "with_maximum_stddev" on the expectation: expect { maru.jump_in_box }.to iterate_per_second(1000) .with_maximum_stddev(10) This will change the expectation to require a maximum deviation of 10%. Alternatively you can use the it block style to write specs: describe MaruTheCat, benchmark: true do describe '#jump_in_box' do subject { -> { described_class.new } } it { is_expected.to iterate_per_second(1000) } end end Because "iterate_per_second" operates on a block, opposed to a static value, the "subject" method must return a Proc. This looks a bit goofy but I have been unable to find a nice way around this.
2015-09-11Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-gDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-09Merge CI factories and CI spec/support with GitLabDmitriy Zaporozhets
2015-09-06Fix emoji URLs in Markdown when relative_url_root is usedStan Hu
Also adds the ability to run rspecs with relative_url_defined on the enviornment. For example: RELATIVE_URL_ROOT=/gitlab rspec Closes #1728
2015-07-14Move coverage-related setup back to spec_helperRobert Speicher
These tools must be loaded before our regular Rails environment.
2015-07-01Fix ApplicationHelper specsRobert Speicher
There were several specs that were failing when run by themselves. - Use the `helper` object, as per RSpec 3 standards - Use `assign` to assign instance variables that helpers expect - Add `StubConfiguration` support module
2015-07-01Add spec/support/factory_girlRobert Speicher
Just for consistency with our Capybara, DatabaseCleaner, WebMock, etc. setups.
2015-06-22Update email_spec gemRobert Speicher
This fixes spec/mailers/notify_spec Also only require email_spec in the one place it's used
2015-06-10Fix shoulda-matchers requireRobert Speicher