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
path: root/db
AgeCommit message (Collapse)Author
2016-08-20Merge branch 'fix-diff-note-discussion-id' into 'master' Rubén Dávila Santos
Call `set_discussion_id` again in DiffNote `before_validation` because the order is important See merge request !5913
2016-08-19Merge branch 'gokmengoksel/gitlab-ce-koding' into 'master' Stan Hu
Koding Integration ## What does this MR do? Will provide Koding integration with GitLab services. Forked from !4914. ## Are there points in the code the reviewer needs to double check? I've introduced new layouts which might not be necessary, first time contributor. ## Why was this MR needed? We're planning to ship Koding with GitLab. ## What are the relevant issue numbers? #12759 #14698 ## Screenshots (if relevant) ### Screencasts http://recordit.co/BDMbhwgxPD http://recordit.co/By0qiz1ClC ### Enable Koding in Application Settings ![image](/uploads/73a69421105c03aa2b0b47e2617d3fbc/image.png) ### Koding Dashboard ![image](/uploads/6c7dda34792280c0e4791e36af4eba11/image.png) ### Set up Koding Stack 1 - ![image](/uploads/d5c2b93f8e61b5cbffdb06f0267d485f/image.png) 2 - ![image](/uploads/44d9a9b574b8ac0c5eb553fb9653d5da/image.png) ### Run on Koding on Project Page ![image](/uploads/7d2b46221009074ffff75d66d5a1a555/image.png) ### Run in IDE on Merge Requests ![image](/uploads/65eed90c34c34b5fe7ad29ef9c717640/image.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] Tests - [x] Added for this feature/bug - [x] All builds are passing - [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 you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5909
2016-08-19Merge branch 'pipeline-hooks-without-slack' into 'master' Robert Speicher
Implement pipeline hooks, extracted from !5525 Closes #20115 See merge request !5620
2016-08-19Merge branch 'expiration-date-on-memberships' into 'master' Douwe Maan
Expiration date on memberships Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/17495 See merge request !5876
2016-08-19Merge branch 'diff-line-comment-vuejs' into 'master' Douwe Maan
Diff line comments resolve ## What does this MR do? Diff line comments can be resolved. Part of #10325 To do: - [x] Backend (@DouweM) - [x] Fix https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_13319326. Will be made easier by https://gitlab.com/gitlab-org/gitlab-ce/issues/17237#note_13370331 - [x] System note when all discussions are resolved - [x] Notification when all discussions are resolved - [x] Write unit tests - [x] Look at resolve time https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_13912743 - Fixed by 4a13aa9 - [x] Frontend (@iamphill) - [x] Fix bugs - [x] Write more feature tests - [x] Frontend (@connorshea) - [x] Address frontend feedback - [x] Feature specs for Jump feature - [x] Documentation - [x] Add Vue.js in a standard way See merge request !5022
2016-08-19Merge branch '17334-u2f-device-identifiers' into 'master' Robert Speicher
Allow naming (and deleting) U2F devices. ## What does this MR do? - Allow giving each U2F device a name (at the time of registration). - Allow deleting individual U2F devices. - Display a list of registered U2F devices. ## What are the relevant issue numbers? - Closes #17334 - Closes #17335 See merge request !5833
2016-08-18Merge branch '18141-pipeline-graph' into 'master' Jacob Schatz
Add pipeline graph ## What does this MR do? Adds pipeline visualization ## What are the relevant issue numbers? Closes #18141 Part of #19982 ## Screenshots (if relevant) ![Screen_Shot_2016-08-16_at_7.59.52_PM](/uploads/c9dd695d2ddbd2a85e98a5b4e500d52c/Screen_Shot_2016-08-16_at_7.59.52_PM.png) ![Screen_Shot_2016-08-16_at_7.55.49_PM](/uploads/5ab548cc5fc8a42371d3b54108798c02/Screen_Shot_2016-08-16_at_7.55.49_PM.png) See merge request !5742
2016-08-17Merge branch '18681-pipelines-merge-request' into 'master' Jacob Schatz
Resolve "Pipelines for merge request" ## What does this MR do? Adds `Pipelines` tab in merge request view ## What are the relevant issue numbers? Closes #18681 ## Screenshots (if relevant) ![Screen_Shot_2016-08-16_at_3.22.41_PM](/uploads/c04febab3765b1fac2bf3bbfb9882f9f/Screen_Shot_2016-08-16_at_3.22.41_PM.png) See merge request !5485
2016-08-17Merge branch 'issue-boards' into 'master'Douwe Maan
Issue boards - Issue: #17907 - Issue backend: #20335 - Backend MR: !5548 - Frontend MR: !5554 - Documentation !5713 - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [X] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [X] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [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 you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5548
2016-08-16Merge branch 'akismet-submittable' into 'master' Robert Speicher
Submit to Akismet Part 1 (Issues) Related to #5932 #5573 gitlab-com/infrastructure#14 See merge request !5538
2016-08-16Further refactor and syntax fixes.Patricio Cano
2016-08-15Merge branch 'fix/build-seeds-in-development-environment' into 'master' Grzegorz Bizon
Fix pipeline and build seeds in development environment ## What does this MR do? 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 ## Why was this MR needed? Pipeline and build seeds were broken in development environment. ## What are the relevant issue numbers? Closes #20933 See merge request !5810
2016-08-15Fix pipeline and build seeds in development environmentGrzegorz Bizon
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.
2016-08-15Refactored AkismetHelper into AkismetService and cleaned up `Spammable`Patricio Cano
- Refactored SpamCheckService into SpamService
2016-08-15Allow `Issue` to be submitted as spamPatricio Cano
- Added controller actions as reusable concerns - Added controller tests
2016-08-15Allow `SpamLog` to be submitted as hamPatricio Cano
- Added `submitted_as_ham` to `SpamLog` to mark which logs have been submitted to Akismet. - Added routes and controller action.
2016-08-15Refactored spam related code even furtherPatricio Cano
- Removed unnecessary column from `SpamLog` - Moved creation of SpamLogs out of its own service and into SpamCheckService - Simplified code in SpamCheckService. - Moved move spam related code into Spammable concern
2016-08-15Lay the ground works to submit information to AkismetPatricio Cano
- New concern `AkismetSubmittable` to allow issues and other `Spammable` models to be submitted to Akismet. - New model `UserAgentDetail` to store information needed for Akismet. - Services needed for their creation and tests.
2016-08-15Merge branch 'zj-deployment-status-on-mr' into 'master' Douwe Maan
Show deployment status on a MR view ## What are the relevant issue numbers? Resolves #19571, one in the list of #19992 ## Screenshots (if relevant) external_url = nil ![Screen_Shot_2016-08-02_at_13.57.03](/uploads/20ea1587eea556c7a1acd0ff726a5bfb/Screen_Shot_2016-08-02_at_13.57.03.png) external_url != nil ![Screen_Shot_2016-08-02_at_13.59.59](/uploads/0094b9ddece3f4bf76c83988840c096d/Screen_Shot_2016-08-02_at_13.59.59.png) Note, the timings are weird between merging and deploying, that is because I did it in the wrong order. ## Does this MR meet the acceptance criteria? - [X] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug - [x] All builds are passing See merge request !5622
2016-08-12Method names changed to #includes_commit?Z.J. van de Weg
2016-08-12Fix bug where destroying a namespace would not always destroy projectsStan Hu
There is a race condition in DestroyGroupService now that projects are deleted asynchronously: 1. User attempts to delete group 2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project 3. DestroyGroupService destroys the Group, leaving all its projects without a namespace 4. Projects::DestroyService runs later but the can?(current_user, :remove_project) is `false` because the user no longer has permission to destroy projects with no namespace. 5. This leaves the project in pending_delete state with no namespace/group. Projects without a namespace or group also adds another problem: it's not possible to destroy the container registry tags, since container_registry_path_with_namespace is the wrong value. The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService. Closes #17893
2016-08-11Merge branch 'refactor-builds-creation-service' into 'master' Rémy Coutable
Refactor pipeline creation service ## What does this MR do? This refactors GitLab CI build processing: all builds for pipeline are pre-created when a pipeline object is created. The builds are created with a new introduced status `created`. The builds are then automatically promoted to `pending` when a previous stage do succeed. This significantly simplifies pipeline processing code solving a lot of problems of lazily initialisation of previous approach (builds were created on-demand). ## Why was this MR needed? The previous mechanism had a lot of flows (shown in related issues) in how it work, but also in code design. Removing cross model-service-library dependencies. The current approach moves a build creation to single place `CreatePipelineService` and removes a dynamic dependency on `config_processor` significantly simplifying a build creation and pipeline processing. Pipeline processing is implemented in `ProcessPipelineService`. This also allows to easily extend GitLab with Manual Actions which is part of 8.10 direction issue. ## Migration problem ~~This MR removes the a on-demand creation of builds in pipelines. Pipelines that are running and are in mid-stage (some stages started, but not all) will not be fully evaluated after application restart. This happens, because the code responsible for on-demand creation is removed. There's no easy way to migrate existing pipelines, other than doing offline migration and putting pipeline processing in migration code (which seems to be a really bad idea).~~ To support old pipelines I added a lazy initialization of builds if none is found. ## What are the relevant issue numbers? Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/12839 Solves: https://gitlab.com/gitlab-org/gitlab-ce/issues/18644 https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/289 Allows to easily implement: https://gitlab.com/gitlab-org/gitlab-ce/issues/17010 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [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 you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5295
2016-08-11Pre-create all builds for Pipeline when a trigger is receivedKamil Trzcinski
This change simplifies a Pipeline processing by introducing a special new status: created. This status is used for all builds that are created for a pipeline. We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped). This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled. This also allows us to visualise a full pipeline (with created builds). This also removes an after_touch used for updating a pipeline state parameters. Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
2016-08-11Remove various redundant indexesYorick Peterse
One can see which indexes are used in PostgreSQL by running the following query: SELECT relname as table_name, indexrelname as index_name, idx_scan, idx_tup_read, idx_tup_fetch, pg_size_pretty(pg_relation_size(indexrelname::regclass)) FROM pg_stat_all_indexes WHERE schemaname = 'public' AND "idx_scan" = 0 ORDER BY pg_relation_size(indexrelname::regclass) desc; Using this query I built a list of indexes that could be potentially removed. After checking every single one by hand to make sure they really aren't used I only found 1 index that _would_ be used. This was a GitLab GEO index (EE) specific that's currently not used simply because the table is empty. Apart from this one index all indexes could be removed. The migration also takes care of 6 composite indexes that can be replaced with a single column index, which in most cases was already present. For more information see gitlab-org/gitlab-ce#20767.
2016-08-10Remove trigram indexes for "ci_runners"Yorick Peterse
These indexes are only used when you search for runners in the admin interface. This operation is so rarely used that it does not make sense to slow down every update in order to update the GIN trigram indexes. Removing these indexes should speed up queries such as those used for updating the last contact time of CI runners. Locally the timings of this query were reduced from ~50 ms to ~25 ms: UPDATE ci_runners SET updated_at = now(), contacted_at = now();
2016-08-04Merge branch '20568-fix-member-data-again' into 'master' Douwe Maan
Add a data migration to fix some missing timestamps in the members table (again) ## What does this MR do? Repeats an earlier migration to fix historic bad data in the members table (missing created_at and updated_at fields) ## Are there points in the code the reviewer needs to double check? I'm expecting the WHERE clauses to be fast enough, and to return few enough rows, that the migration doesn't need to use batches, but I'm not too familiar with the size of these tables in the wild, so perhaps that's a poor assumption. ## Why was this MR needed? 8.10 introduced a dependency on the `members.created_at` field in the project and namespace member view. If bad data is present, viewing the list of members now results in an NoMethodError and a 500 response from GitLab. Although the previous migration should have fixed all bad rows, we have evidence that it didn't in at least one case, despite the migration claiming to have run in the past. ## What are the relevant issue numbers? #20568 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [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 - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) Closes #20568 See merge request !5670
2016-08-04Add missing DOWNTIME constant to the AddTimestampsToMembersAgain migrationNick Thomas
2016-08-04Merge branch '20609-fix-protected-branch-access-levels-migration' into 'master' Douwe Maan
Migrate protected branch access levels to match constants in `Gitlab::Access` Closes #20606 Context: https://gitlab.com/gitlab-org/gitlab-ce/issues/20606#note_13561628 See merge request !5658
2016-08-04Merge branch 'fix-add-column-with-default-null' into 'master' Douwe Maan
Fix `#down` for two protected branches-related migrations. - The migrations called `add_column_with_default` with a `null` option, which the Rails `add_column` method accepts. This fails because `add_column_with_default` expects an `allow_null` option instead. - The migrations have been fixed to use `allow_null`. See merge request !5660
2016-08-04Add a data migration to fix some missing timestamps in the members table (again)Nick Thomas
2016-08-04Merge branch 'fixtures-improvements' into 'master' Kamil Trzciński
Improve CI fixtures cc @ayufan See merge request !5645
2016-08-04Fix `#down` for two protected branches-related migrations.Timothy Andrew
- The migrations called `add_column_with_default` with a `null` option, which the Rails `add_column` method accepts. This fails because `add_column_with_default` expects an `allow_null` option instead. - The migrations have been fixed to use `allow_null`.
2016-08-04Migrate protected branch access levels to match constants in `Gitlab::Access`Timothy Andrew
- In the final round of review (!5081), we moved the protected branch access levels from Rails enums to constants from Gitlab::Access. - The migrations that moved us from the old data model (a single protected_branches table with developers_can_push and developers_can_merge flags) to the new one (separate tables for push_access_levels and merge_access_levels) was not updated. - These migrations still used 0 to mean "Masters" and 1 to mean "Developers" (matching the previous Rails enum), while Gitlab::Access uses 40 and 30 for these, respectively. - Once the migrations run, our data gets into a broken state. - We fix this by migrating all `0`s to `40` and all `1`s to `30`. - https://gitlab.com/gitlab-org/gitlab-ce/issues/20606#note_13561628 = Caveats = - In Gitlab::Access, 0 represents NO_ACCESS. When we run this migration, all protected branches with "No one" as an access level will be changed to "Masters"
2016-08-03Remove unnecessary index_projects_on_builds_enabled index from the projects ↵Alejandro Rodríguez
table
2016-08-03Improve CI fixturesZ.J. van de Weg
2016-07-29Incorporate feedbackZ.J. van de Weg
2016-07-29Add an URL field to EnvironmentsZ.J. van de Weg
This MR adds a string (thus max 255 chars) field to the enviroments table to expose it later in other features.
2016-07-29Implement final review comments from @rymai.Timothy Andrew
1. Instantiate `ProtectedBranchesAccessSelect` from `dispatcher` 2. Use `can?(user, ...)` instead of `user.can?(...)` 3. Add `DOWNTIME` notes to all migrations added in !5081. 4. Add an explicit `down` method for migrations removing the `developers_can_push` and `developers_can_merge` columns, ensuring that the columns created (on rollback) have the appropriate defaults. 5. Remove duplicate CHANGELOG entries. 6. Blank lines after guard clauses.
2016-07-29Use `Gitlab::Access` to protected branch access levels.Timothy Andrew
1. It makes sense to reuse these constants since we had them duplicated in the previous enum implementation. This also simplifies our `check_access` implementation, because we can use `project.team.max_member_access` directly. 2. Use `accepts_nested_attributes_for` to create push/merge access levels. This was a bit fiddly to set up, but this simplifies our code by quite a large amount. We can even get rid of `ProtectedBranches::BaseService`. 3. Move API handling back into the API (previously in `ProtectedBranches::BaseService#translate_api_params`. 4. The protected branch services now return a `ProtectedBranch` rather than `true/false`. 5. Run `load_protected_branches` on-demand in the `create` action, to prevent it being called unneccessarily. 6. "Masters" is pre-selected as the default option for "Allowed to Push" and "Allowed to Merge". 7. These changes were based on a review from @rymai in !5081.
2016-07-29Implement review comments from @dbalexandre.Timothy Andrew
1. Remove `master_or_greater?` and `developer_or_greater?` in favor of `max_member_access`, which is a lot nicer. 2. Remove a number of instances of `include Gitlab::Database::MigrationHelpers` in migrations that don't need this module. Also remove comments where not necessary. 3. Remove duplicate entry in CHANGELOG. 4. Move `ProtectedBranchAccessSelect` from Coffeescript to ES6. 5. Split the `set_access_levels!` method in two - one each for `merge` and `push` access levels.
2016-07-29Add seeds for protected branches.Timothy Andrew
2016-07-29Add a series of migrations changing the model-level design of protected ↵Timothy Andrew
branch access levels. 1. Remove the `developers_can_push` and `developers_can_merge` boolean columns. 2. Add two new tables, `protected_branches_push_access`, and `protected_branches_merge_access`. Each row of these 'access' tables is linked to a protected branch, and uses a `access_level` column to figure out settings for the protected branch. 3. The `access_level` column is intended to be used with rails' `enum`, with `:masters` at index 0 and `:developers` at index 1. 4. Doing it this way has a few advantages: - Cleaner path to planned EE features where a protected branch is accessible only by certain users or groups. - Rails' `enum` doesn't allow a declaration like this due to the duplicates. This approach doesn't have this problem. enum can_be_pushed_by: [:masters, :developers] enum can_be_merged_by: [:masters, :developers]
2016-07-28Remove project which can't be pulled while seedingZ.J. van de Weg
[ci skip]
2016-07-27Fix missing schema update for 20160722221922Stan Hu
2016-07-25Merge branch 'filter-branch-by-name' into 'master' Douwe Maan
Users can filter branches by name on project branches page This MR aims to solve #18674 by adding the possibility to filter project branches by name ![Screen_Shot_2016-07-07_at_17.21.25](/uploads/b674765d2b1cb8a121c2101715a4568b/Screen_Shot_2016-07-07_at_17.21.25.png) See merge request !5144
2016-07-23Fix bug where replies to commit notes displayed in the MR discussion tab ↵Douwe Maan
wouldn't show up on the commit page
2016-07-22Merge branch 'master' of gitlab.com:gitlab-org/gitlab-cetiagonbotelho
2016-07-21Don't drop in DropAndReaddHasExternalWikiInProjectsYorick Peterse
Dropping a column and then re-adding it can lead to the application throwing errors as the column may temporarily not exist. To work around this we'll reset the various project rows in batches _without_ removing any columns.
2016-07-21Merge branch 'master' of gitlab.com:gitlab-org/gitlab-cetiagonbotelho
2016-07-21Fix migration to make it fastRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>