summaryrefslogtreecommitdiff
path: root/db/fixtures
Commit message (Collapse)AuthorAgeFilesLines
* Refresh project authorizations using a Redis leaserefresh-authorizations-with-leaseYorick Peterse2016-11-254-12/+0
| | | | | | | | | | | | | | | | | When I proposed using serializable transactions I was hoping we would be able to refresh data of individual users concurrently. Unfortunately upon closer inspection it was revealed this was not the case. This could result in a lot of queries failing due to serialization errors, overloading the database in the process (given enough workers trying to update the target table). To work around this we're now using a Redis lease that is cancelled upon completion. This ensures we can update the data of different users concurrently without overloading the database. The code will try to obtain the lease until it succeeds, waiting at least 1 second between retries. This is necessary as we may otherwise end up _not_ updating the data which is not an option.
* Update ProjectTeam#fetch_members to use project authorizationsfix/drop-project-authorized-for-userAhmad Sherif2016-11-231-14/+19
|
* Merge branch 'feature/precalculate-authorized-projects' into 'master' Douwe Maan2016-11-183-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Precalculate authorized projects in database ## What does this MR do? It caches user's authorized projects in database instead of using multiple unions, which should simplify and speed-up things since this operation (getting authorized projects) is used a lot. ## Are there points in the code the reviewer needs to double check? Did we miss a scenario where we need to refresh the list of projects? ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? #23150 See merge request !6839
| * Precalculate user's authorized projects in databaseAhmad Sherif2016-11-183-0/+11
| | | | | | | | Closes #23150
* | Merge branch 'feature/cycle-analytics-events' into 'master' Douwe Maan2016-11-181-0/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cycle Analytics: Events per stage Adds list of events to each stage: - Issue: list of issues created in the last XX days, that have been labeled or added to a milestone. - Plan: list of commits that reference for the fist time an issue from the last stage. - Code: list of MR created in this stage - Test: List of unique builds triggered by the commits. - Review: List of MR merged - Staging: List of deployed builds - Production: list of issues with the time from idea to production Fixes #23449 - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !6859
| * run pipeline worker in cycle analytics dev setupJames Lopez2016-11-181-0/+2
| |
* | Remove empty db fixtures fileSemyon Pupkov2016-11-171-0/+0
|/
* Refactor code to use available and stopped statuses and refactor views to ↵Kamil Trzcinski2016-10-171-2/+2
| | | | use separate renders
* Allow to close environmentsKamil Trzcinski2016-10-061-0/+1
|
* Fix pipeline fixtures and calls to removed methodGrzegorz Bizon2016-10-041-1/+1
|
* Allow Member.add_user to handle access requestersRémy Coutable2016-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Changes include: - Ensure Member.add_user is not called directly when not necessary - New GroupMember.add_users_to_group to have the same abstraction level as for Project - Refactor Member.add_user to take a source instead of an array of members - Fix Rubocop offenses - Always use Project#add_user instead of project.team.add_user - Factorize users addition as members in Member.add_users_to_source - Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects - Destroy any requester before adding them as a member - Improve the way we handle access requesters in Member.add_user Instead of removing the requester and creating a new member, we now simply accepts their access request. This way, they will receive a "access request granted" email. - Fix error that was previously silently ignored - Stop raising when access level is invalid in Member, let Rails validation do their work Signed-off-by: Rémy Coutable <remy@rymai.me>
* Limit test environment size to one project in CIGrzegorz Bizon2016-09-231-8/+3
|
* Implement review comments from @yorickpeterseTimothy Andrew2016-09-201-1/+1
| | | | | | | | | | | | | | 1. Change multiple updates to a single `update_all` 2. Use cascading deletes 3. Extract an average function for the database median. 4. Move database median to `lib/gitlab/database` 5. Use `delete_all` instead of `destroy_all` 6. Minor refactoring
* Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-201-3/+7
|\
| * Group similar buildsKamil Trzcinski2016-09-071-3/+7
| |
* | Add a "populate metrics directly" option to the cycle analytics seed.Timothy Andrew2016-09-171-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - The normal seed creates all the data for cycle analytics the "right" way. It creates issues, merge requests, commits, branches, deployments, etc. This is good, but too slow for perf testing. Generating a 1000 sets of records this way takes more than an hour. - When the `CYCLE_ANALYTICS_POPULATE_METRICS_DIRECTLY` environment variable is passed in, the seed only creates issues and merge requests. It then adds the `metrics` for each issue and merge request directly, to save time. - The seed now takes about 4 minutes to run for 1000 sets of records.
* | Improve performance of the cycle analytics page.Timothy Andrew2016-09-151-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. These changes bring down page load time for 100 issues from more than a minute to about 1.5 seconds. 2. This entire commit is composed of these types of performance enhancements: - Cache relevant data in `IssueMetrics` wherever possible. - Cache relevant data in `MergeRequestMetrics` wherever possible. - Preload metrics 3. Given these improvements, we now only need to make 4 SQL calls: - Load all issues - Load all merge requests - Load all metrics for the issues - Load all metrics for the merge requests 4. A list of all the data points that are now being pre-calculated: a. The first time an issue is mentioned in a commit - In `GitPushService`, find all issues mentioned by the given commit using `ReferenceExtractor`. Set the `first_mentioned_in_commit_at` flag for each of them. - There seems to be a (pre-existing) bug here - files (and therefore commits) created using the Web CI don't have cross-references created, and issues are not closed even when the commit title is "Fixes #xx". b. The first time a merge request is deployed to production When a `Deployment` is created, find all merge requests that were merged in before the deployment, and set the `first_deployed_to_production_at` flag for each of them. c. The start / end time for a merge request pipeline Hook into the `Pipeline` state machine. When the `status` moves to `running`, find the merge requests whose tip commit matches the pipeline, and record the `latest_build_started_at` time for each of them. When the `status` moves to `success`, record the `latest_build_finished_at` time. d. The merge requests that close an issue - This was a big cause of the performance problems we were having with Cycle Analytics. We need to use `ReferenceExtractor` to make this calculation, which is slow when we have to run it on a large number of merge requests. - When a merge request is created, updated, or refreshed, find the issues it closes, and create an instance of `MergeRequestsClosingIssues`, which acts as a join model between merge requests and issues. - If a `MergeRequestsClosingIssues` instance links a merge request and an issue, that issue closes that merge request. 5. The `Queries` module was changed into a class, so we can cache the results of `issues` and `merge_requests_closing_issues` across various cycle analytics stages. 6. The code added in this commit is untested. Tests will be added in the next commit.
* | wip: perfTimothy Andrew2016-09-141-15/+15
| |
* | Add a `seed_fu` fixture to generate data for cycle analytics.Timothy Andrew2016-09-141-0/+173
|/ | | | | | | | | - The fixture generates data for every stage in the cycle analytics dashboard. Once this fixture has run, you shouldn't be seeing any "<not enough data>" messages for cycle analytics. - This is probably not necessary for every fixture run, so it might be moved behind an env var in the future.
* Move and improvement comment in pipeline fixturesfix/pipeline-seeds-in-dev-envGrzegorz Bizon2016-08-191-5/+4
|
* Change name of the class that with pipeline seedsGrzegorz Bizon2016-08-181-2/+2
|
* Rename file that holds pipeline fixtures in dev envGrzegorz Bizon2016-08-181-0/+0
|
* Reduce the number of build fixtures created in devGrzegorz Bizon2016-08-181-1/+1
|
* Reorder failed stages and improve build statusesGrzegorz Bizon2016-08-181-5/+6
|
* Fix build artifacts in fixtures in development envGrzegorz Bizon2016-08-181-24/+30
|
* Fix build logs in development environment fixturesGrzegorz Bizon2016-08-181-5/+9
|
* Refactor pipeline fixtures for dev env a littleGrzegorz Bizon2016-08-181-15/+20
|
* Update fixtures to add a created status to pipelineKamil Trzcinski2016-08-171-5/+4
|
* Merge remote-tracking branch 'origin/master' into 18141-pipeline-graphKamil Trzcinski2016-08-171-30/+29
|\
| * Fix pipeline and build seeds in development environmentGrzegorz Bizon2016-08-151-30/+29
| | | | | | | | | | | | When we depend on state machine events in seeds, it is likely that we will break fixtures from time to time because when transition rules change, using events most likely invalidates some objects in seeds.
* | Update fixtures to make development testing easierKamil Trzcinski2016-08-171-6/+26
|/
* Improve CI fixturesfixtures-improvementsZ.J. van de Weg2016-08-031-24/+21
|
* Add seeds for protected branches.Timothy Andrew2016-07-291-0/+12
|
* Remove project which can't be pulled while seedingZ.J. van de Weg2016-07-281-1/+0
| | | | [ci skip]
* Improve code designKamil Trzcinski2016-07-181-1/+1
|
* Update build fixtures to include manual actionsKamil Trzcinski2016-07-181-15/+48
|
* Random selection now also works for MySQLseed-fu-award-emojiZ.J. van de Weg2016-06-151-3/+3
|
* Near half of the Issues get Award Emoji when seedingZ.J. van de Weg2016-06-151-4/+4
|
* Skip system notes from receiving award emojiZ.J. van de Weg2016-06-151-4/+10
|
* Seed Award Emoji while seeding the databaseZ.J. van de Weg2016-06-151-0/+27
|
* Merge remote-tracking branch 'origin/master' into rename-ci-commit-phase-2Kamil Trzcinski2016-06-071-6/+6
|\
| * Fix missed colorize methods.Connor Shea2016-06-061-6/+6
| |
* | Use pipelines in context of ProjectKamil Trzcinski2016-06-031-1/+1
|/
* Limit the number of merge requests per project to avoid long seedsStan Hu2016-05-041-1/+4
| | | | | | | This step was taking a long time because seed_fu creates N / 2 merge requests for each repo, where N is the number of branches for that repo. At the time of this writing, there are 234 branches on the gitlab-ce repo, leading to 117 merge requests.
* Fix specsKamil Trzcinski2016-04-111-1/+1
|
* Fix seed_fu failure with inserting milestones into test DBStan Hu2016-04-101-1/+1
| | | | Milestones were not being saved due to "invalid state" validation errors
* Allow the initial admin to set a passwordrs-no-default-credentialsRobert Speicher2016-03-041-25/+30
| | | | Closes #1980
* Add second build for each commit in build seedsGrzegorz Bizon2016-02-111-14/+25
|
* Add an option to supply root email through an environmental variable.3kami3/gitlab-ce-root_email3kami32016-02-081-1/+3
|
* Seed db on development with artifacts metadata fixtureGrzegorz Bizon2016-01-141-5/+18
|