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-07-28Ensure Gitlab::Application.routes.default_url_options are set correctly in ↵Rémy Coutable
Capybara + :js specs Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-24Update shoulda-matchers gem to 3.1.2Dmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-07-19Update Prometheus gem to version that explicitly calls `munmap`Paweł Chojnacki
2017-07-13Enable all feature flags by default in specsBob Van Landuyt
Otherwise some features would go untested in non-specific contexts I did need to disable the `gitlab_git_diff_size_limit_increase`-feature in some specs since we depend on diffs being expandable while the file we are testing on is smaller than the increased limit.
2017-07-12Replace 'browse_files.feature' spinach test with an rspec analogblackst0ne
2017-07-11Support multiple Redis instances based on queue typePaul Charlton
2017-07-07Include new URL helpers retroactively into includers of Gitlab::RoutingDouwe Maan
2017-07-05Create and use project path helpers that only need a project, no namespaceDouwe Maan
2017-06-20Include Devise::Test::IntegrationHelpers for all feature specsRobert Speicher
2017-06-15Make spec/spec_helper consistent with EE by including a :routing typeStan Hu
2017-06-13Fix migrations testing support RSpec hooks orderGrzegorz Bizon
2017-06-12Merge branch 'retry-specs' into 'master'Robert Speicher
Attempts to run RSpec tests twice (1 retry) See merge request !12066
2017-06-12Attempts to run RSpec tests twice (1 retry)Rémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-10Use :request_store hooks on specsOswaldo Ferreira
2017-06-07Merge branch 'feature/gb/migrate-pipeline-stages' into 'master'Kamil Trzciński
Migrate pipeline stages in the database See merge request !11714
2017-06-05Merge branch 'master' into feature/gb/migrate-pipeline-stagesGrzegorz Bizon
* master: (524 commits) Improve user experience around slash commands in instant comments Fix LFS timeouts when trying to save large files retryable? is now available for CommitStatus Resolve "Documentation of `.gitlab-ci.yml` states incorrect example for variables" Fix test failures Add slugify project path to CI enviroment variables Fixed typo: craeted -> created 32118 Make New environment empty state btn lowercase Expose import_status in Projects API 32832 Remove overflow from comment form for confidential issues and vertically aligns confidential issue icon Fix test failures Allow manual bypass of auto_sign_in_with_provider Fix keys seed Allow users to be hard-deleted from the API fixup some classnames and media queries Enable the Style/PreferredHashMethods cop Lint our factories creation in addition to their build Don’t schedule workers from inside transactions Allow scheduling from after_commit hooks Forbid Sidekiq scheduling in transactions ... Conflicts: db/schema.rb spec/spec_helper.rb
2017-06-05Calculate previous migration version in specs supportGrzegorz Bizon
This makes it possible to test migration on the schema this migration was written for, without a need to specify a previous schema version manually.
2017-06-02Move Prometheus presentation logic to PrometheusTextPawel Chojnacki
+ Use NullMetrics to mock metrics when unused + Use method_missing in NullMetrics mocking + Update prometheus gem to version that correctly uses transitive dependencies + Ensure correct folders are used in Multiprocess prometheus client tests. + rename Sessions controller's metric
2017-05-31Move rainbow monkey patch to String to spec_helperGabriel Mazetto
2017-05-29Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan
Rework project authorizations and nested groups for better performance See merge request !10885
2017-05-26Reorder pipeline stages-related migrationsGrzegorz Bizon
2017-05-26Add pipeline stages post deployment migrationGrzegorz Bizon
2017-05-26Add migrations helpers to simplify writing migration specsGrzegorz Bizon
2017-05-26Make migration specs by using migrator in around hookGrzegorz Bizon
2017-05-25Simplify migrations for specific database schemaGrzegorz Bizon
2017-05-23Use wait_for_requests to wait all JS requestOswaldo Ferreira
2017-05-19Enable RSpec profiling only if RSPEC_PROFILING_POSTGRES_URL is not emptyRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-17Hide nested group UI/API support for MySQLYorick Peterse
This hides/disables some UI elements and API parameters related to nested groups when MySQL is used, since nested groups are not supported for MySQL.
2017-05-17Use CTEs for nested groups and authorizationsYorick Peterse
This commit introduces the usage of Common Table Expressions (CTEs) to efficiently retrieve nested group hierarchies, without having to rely on the "routes" table (which is an _incredibly_ inefficient way of getting the data). This requires a patch to ActiveRecord (found in the added initializer) to work properly as ActiveRecord doesn't support WITH statements properly out of the box. Unfortunately MySQL provides no efficient way of getting nested groups. For example, the old routes setup could easily take 5-10 seconds depending on the amount of "routes" in a database. Providing vastly different logic for both MySQL and PostgreSQL will negatively impact the development process. Because of this the various nested groups related methods return empty relations when used in combination with MySQL. For project authorizations the logic is split up into two classes: * Gitlab::ProjectAuthorizations::WithNestedGroups * Gitlab::ProjectAuthorizations::WithoutNestedGroups Both classes get the fresh project authorizations (= as they should be in the "project_authorizations" table), including nested groups if PostgreSQL is used. The logic of these two classes is quite different apart from their public interface. This complicates development a bit, but unfortunately there is no way around this. This commit also introduces Gitlab::GroupHierarchy. This class can be used to get the ancestors and descendants of a base relation, or both by using a UNION. This in turn is used by methods such as: * Namespace#ancestors * Namespace#descendants * User#all_expanded_groups Again this class relies on CTEs and thus only works on PostgreSQL. The Namespace methods will return an empty relation when MySQL is used, while User#all_expanded_groups will return only the groups a user is a direct member of. Performance wise the impact is quite large. For example, on GitLab.com Namespace#descendants used to take around 580 ms to retrieve data for a particular user. Using CTEs we are able to reduce this down to roughly 1 millisecond, returning the exact same data. == On The Fly Refreshing Refreshing of authorizations on the fly (= when users.authorized_projects_populated was not set) is removed with this commit. This simplifies the code, and ensures any queries used for authorizations are not mutated because they are executed in a Rails scope (e.g. Project.visible_to_user). This commit includes a migration to schedule refreshing authorizations for all users, ensuring all of them have their authorizations in place. Said migration schedules users in batches of 5000, with 5 minutes between every batch to smear the load around a bit. == Spec Changes This commit also introduces some changes to various specs. For example, some specs for ProjectTeam assumed that creating a personal project would _not_ lead to the owner having access, which is incorrect. Because we also no longer refresh authorizations on the fly for new users some code had to be added to the "empty_project" factory. This chunk of code ensures that the owner's permissions are refreshed after creating the project, something that is normally done in Projects::CreateService.
2017-04-28Resolve "rspec_profiling is enabled for MySQL"Rémy Coutable
2017-04-13Allow to enable `rspec_profiling` for a branch on the CIRémy Coutable
`rspec_profiling` will be enabled if the branch name includes `rspec-profile`. Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-11Setup and run a Gitaly server for testing if GitalyClient is enabledAlejandro Rodríguez
2017-03-24When on CI, enable RSpec profiling for `master` onlyRémy Coutable
We don't actually need to monitor RSpec for all our branches. Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-22Only include WaitForAjax for :js specsRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-22Introduce a new middleware for the test environment that can block requestsRémy Coutable
The idea is that after each feature spec example, we block all incoming requests at the Rack level, go to the 'about:blank' page, and wait until the current requests reach 0. This should solve the problem where a request would end after database cleaner performed the database truncation. The problem was that a GET request can still lead to records creation (e.g. namespaces or routes). Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-13Retry only on feature specs that use JS, on CIRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-13Implement `json_response` as a `let` variableRémy Coutable
This is not a good idea to memoize `json_response` using an instance variable because `rspec-retry` doesn't clear instance variables on retries, only `let` variables. This will avoid issues where retries would fail on a different line that the original failure, blurrying what's the real failure. Also, automatically add api: true to specs under /spec/requests/(ci/)?api/, and include JsonHelpers in controller, request and API specs. Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-02-03Shave spec/features/issues/filtered_search/dropdown_label_spec.rb from 10 ↵Rémy Coutable
minutes to 1.5 minutes - Don't use `sleep` (most of the time was wasted by that) - Expect some elements to be visible instead: capybara is smart enough to retry a few times if it cannot find an element - See https://github.com/teamcapybara/capybara#asynchronous-javascript-ajax-and-friends - Don't create unneccessary DB records - Group some examples together to shave some setup time (where it makes sense) Signed-off-by: Rémy Coutable <remy@rymai.me>
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.