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
2018-04-29[Rails5] Fix Arel::UpdateManagerblackst0ne
In Arel 7.0.0 (Arel 7.1.4 is used in Rails 5.0) the `engine` parameter of `Arel::UpdateManager#initializer` was removed. This commit makes the gitlab database helpers work both in rails 4 and rails 5. Fixes errors like this one: ``` 1) Gitlab::Database::MigrationHelpers#update_column_in_batches when running outside of a transaction updates all the rows in a table Failure/Error: update_arel = Arel::UpdateManager.new(ActiveRecord::Base) .table(table) .set([[table[column], value]]) .where(table[:id].gteq(start_id)) ArgumentError: wrong number of arguments (given 1, expected 0) # ./lib/gitlab/database/migration_helpers.rb:317:in `new' # ./lib/gitlab/database/migration_helpers.rb:317:in `block in update_column_in_batches' # ./lib/gitlab/database/migration_helpers.rb:307:in `loop' # ./lib/gitlab/database/migration_helpers.rb:307:in `update_column_in_batches' # ./spec/lib/gitlab/database/migration_helpers_spec.rb:367:in `block (4 levels) in <top (required)>' ```
2018-04-25Gitlab::Shell works on shard name, not pathZeger-Jan van de Weg
Direct disk access is done through Gitaly now, so the legacy path was deprecated. This path was used in Gitlab::Shell however. This required the refactoring in this commit. Added is the removal of direct path access on the project model, as that lookup wasn't needed anymore is most cases. Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
2018-04-06[Rails5] Update `type_cast_*_database` methodsblackst0ne
2018-04-05Merge branch 'jej/mattermost-notification-confidentiality-10-6' into ↵Douwe Maan
'security-10-6' [10.6] Prevent notes on confidential issues from being sent to chat See merge request gitlab/gitlabhq!2366 # Conflicts: # app/helpers/services_helper.rb
2018-03-28New migration helper for finding custom indexesBob Van Landuyt
This will use the same query as `\di` to find an index on postgresql.
2018-03-23Merge branch 'mark-legacy-git-access' into 'master'Sean McGivern
Route path lookups through legacy_disk_path See merge request gitlab-org/gitlab-ce!17743
2018-03-21Route path lookups through legacy_disk_pathJacob Vosmaer
2018-03-20Shortcut concurrent foreign key creation if already exists.Andreas Brandl
Closes #43887.
2018-03-20Shortcut concurrent index creation/removal if no effect.Andreas Brandl
Index creation does not have an effect if the index is present already. Index removal does not have an affect if the index is not present. This helps to avoid patterns like this in migrations: ``` if index_exists?(...) remove_concurrent_index(...) end ```
2018-03-14Fix concurrency issue with migration for user_interacted_projects table.Andreas Brandl
The concurrency issue originates from inserts on `user_interacted_projects` from the app while running the post-deploy migration. This change comes with a strategy to lock the table while removing duplicates and creating the unique index (and similar for FK constraints). Also, we'll have a non-unique index until the post-deploy migration is finished to speed up queries during that time. Closes #44205.
2018-03-01Adapt cycle analytics spec helper and cycle analytics usage data specTiago Botelho
2018-02-28Refactors median code to work with both single and multiple projectsTiago Botelho
2018-02-28Add BatchLoader as a way to refactor the base stage codeTiago Botelho
2018-02-28Adds get all medians to Cycle Analytics modelTiago Botelho
2018-01-22Use has_table_privilege for TRIGGER on PostgreSQLYorick Peterse
This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38634.
2018-01-18Reduce UPDATEs for background column type changesYorick Peterse
Prior to this commit we would essentially update all rows in a table, even those where the source column (e.g. `issues.closed_at`) was NULL. This in turn could lead to statement timeouts when using the default batch size of 10 000 rows per job. To work around this we don't schedule jobs for rows where the source value is NULL. We also don't update rows where the source column is NULL (as an extra precaution) or the target column already has a non-NULL value. Using this approach it should be possible to update 10 000 rows in the "issues" table in about 7.5 - 8 seconds. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
2018-01-11Adds Rubocop rule for line break around conditionals🙈 jacopo beschi 🙉
2018-01-05Run background migrations with a minimum intervalYorick Peterse
This adds a minimum interval to BackgroundMigrationWorker, ensuring background migrations of the same class only run once every 5 minutes. This prevents a thundering herd problem where scheduled migrations all run at once due to their delays having been expired (e.g. as the result of a queue being paused for a long time). If a job was recently executed it's rescheduled with a delay that equals the remaining time of the job's lease. This means that if the lease expires in two minutes we only need to wait two minutes, instead of five. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
2018-01-03Use a background migration for issues.closed_atYorick Peterse
In a previous attempt (rolled back in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16021) we tried to migrate `issues.closed_at` from timestamp to timestamptz using a regular migration. This has a bad impact on GitLab.com and as such was rolled back. This commit re-implements the original migrations using generic background migrations, allowing us to still migrate the data in a single release but without a negative impact on availability. To ensure the database schema is up to date the background migrations are performed inline in development and test environments. We also make sure to not migrate that that doesn't need migrating in the first place or has already been migrated.
2017-12-15Merge remote-tracking branch 'upstream/master' into no-ivar-in-modulesLin Jen-Shin
* upstream/master: (671 commits) Make rubocop happy Use guard clause Improve language Prettify Use temp branch Pass info about who started the job and which job triggered it Docs: add indexes for monitoring and performance monitoring clearer-documentation-on-inline-diffs Add docs for commit diff discussion in merge requests sorting for tags api Clear BatchLoader after each spec to prevent holding onto records longer than necessary Include project in BatchLoader key to prevent returning blobs for the wrong project moved lfs_blob_ids method into ExtractsPath module Converted JS modules into exported modules spec fixes Bump gitlab-shell version to 5.10.3 Clear caches before updating MR diffs Use new Ruby version 2.4 in GitLab QA images moved lfs blob fetch from extractspath file Update GitLab QA dependencies ...
2017-12-05Consistently schedule Sidekiq jobsDouwe Maan
2017-11-22Merge remote-tracking branch 'upstream/master' into no-ivar-in-modulesLin Jen-Shin
* upstream/master: (126 commits) Update VERSION to 10.3.0-pre Update CHANGELOG.md for 10.2.0 default fill color for SVGs ignore hashed repos (for now) when using `rake gitlab:cleanup:repos` Use Redis cache for branch existence checks Update CONTRIBUTING.md: Link definition of done to criteria Use `make install` for Gitaly setups in non-test environments FileUploader should check for hashed_storage?(:attachments) to use disk_path Set the default gitlab-shell timeout to 3 hours Update composite pipelines index to include "id" Use arrays in Pipeline#latest_builds_with_artifacts Fix blank states using old css Skip confirmation user api Custom issue tracker Revert "check for `read_only?` first before seeing if request is disallowed" add `#with_metadata` scope to remove a N+1 from the notes' API Fix promoting milestone updating all issuables without milestone Batchload blobs for diff generation check for `read_only?` first before seeing if request is disallowed use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers` ...
2017-11-22Move ModuleWithInstanceVariables to Gitlab namespaceLin Jen-Shin
And use .rubocop.yml to exclude paths we don't care, rather than using the cop itself to exclude.
2017-11-20Don't move project repository/attachments when using hashed storageBob Van Landuyt
When a project is using hashed storage, the repositories and attachments wouldn't be saved on disk using the `full_path`. So the migration would not do anything. However: best to just skip moving when hashed storage is enabled.
2017-11-17Use StrongMemoize and enable/disable cops properlyLin Jen-Shin
2017-11-17Add computed update docs for update_column_in_batchesSean McGivern
2017-11-17Merge remote-tracking branch 'upstream/master' into no-ivar-in-modulesLin Jen-Shin
* upstream/master: (507 commits) Add dropdowns documentation Convert migration to populate latest merge request ID into a background migration Set 0.69.0 instead of latest for codeclimate image De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb Update database_debugging.md Update database_debugging.md Move installation of apps higher Change to Google Kubernetes Cluster and add internal links Add Ingress description from official docs Add info on creating your own k8s cluster from the cluster page Add info about the installed apps in the Cluster docs Resolve "lock/confidential issuable sidebar custom svg icons iteration" Update HA README.md to clarify GitLab support does not troubleshoot DRBD. Update license_finder to 3.1.1 Make sure NotesActions#noteable returns a Noteable in the update action Cache the number of user SSH keys Adjust openid_connect_spec to use `raise_error` Resolve "Clicking on GPG verification badge jumps to top of the page" Add changelog for container repository path update Update container repository path reference ...
2017-11-07Fix TRIGGER checks for MySQLYorick Peterse
This ensures we can check if the user has TRIGGER permissions without querying restricted tables. Thanks to Steve Norman (https://gitlab.com/stevenorman) for helping out with this merge request. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38372
2017-09-18Add cop to make sure we don't use ivar in a moduleLin Jen-Shin
2017-09-18Merge branch 'mk-delete-conflicting-redirects-mysql' into 'master'Douwe Maan
Clean up redirect routes that conflict with regular routes Closes #36229 See merge request gitlab-org/gitlab-ce!13783
2017-09-15Fix setting share_with_group_lockYorick Peterse
Prior to this commit running Namespace#force_share_with_group_lock_on_descendants would result in updating _all_ namespaces in the namespaces table, not just the descendants. This is the result of ActiveRecord::Relation#update_all not taking into account the CTE. To work around this we use the CTE query as a sub-query instead of directly calling #update_all. To prevent this from happening the relations returned by Gitlab::GroupHierarchy are now marked as read-only, resulting in an error being raised when methods such as #update_all are used. Fortunately on GitLab.com our statement timeouts appear to have prevented this query from actually doing any damage other than causing a very large amount of dead tuples. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37916
2017-09-15Spread out the work a littleMichael Kozono
2017-09-15Extract helper for queuing background jobsMichael Kozono
2017-08-29Improve migrations using triggersYorick Peterse
This adds a bunch of checks to migrations that may create or drop triggers. Dropping triggers/functions is done using "IF EXISTS" so we don't throw an error if the object in question has already been dropped. We now also raise a custom error (message) when the user does not have TRIGGER privileges. This should prevent the schema from entering an inconsistent state while also providing the user with enough information on how to solve the problem. The recommendation of using SUPERUSER permissions is a bit extreme but we require this anyway (Omnibus also configures users with this permission). Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
2017-08-23Fix invalid default argument in migration helpersGrzegorz Bizon
2017-08-22Add Sidekiq migration helpers for migrating queuesGrzegorz Bizon
2017-08-20Fix Error 500s when attempting to destroy a protected tagStan Hu
Due to a missing `on_delete: :cascade`, users would hit the error that looked like: ``` PG::ForeignKeyViolation: ERROR: update or delete on table "protected_tags" violates foreign key constraint "fk_rails_f7dfda8c51" on table "protected_tag_create_access_levels" DETAIL: Key (id)=(1385) is still referenced from table "protected_tag_create_access_levels". : DELETE FROM "protected_tags" WHERE "protected_tags"."id" = 1385 ``` Closes #36013
2017-07-18Add a foreign key to `merge_requests.head_pipeline_id`Grzegorz Bizon
2017-07-11Support multiple Redis instances based on queue typePaul Charlton
2017-06-29Added code for defining SHA attributesYorick Peterse
These attributes are stored in binary in the database, but exposed as strings. This allows one to query/create data using plain SHA1 hashes as Strings, while storing them more efficiently as binary.
2017-06-27Adjust for new static-analysis failuresBob Van Landuyt
2017-06-27Only do one query for updating routesBob Van Landuyt
2017-06-26Update routes directly by ID instead of filtering by pathBob Van Landuyt
2017-06-26Clear the cache for projects one-by-oneBob Van Landuyt
2017-06-26Add punctuation to log messagesBob Van Landuyt
2017-06-26Keep failed renames in redisBob Van Landuyt
2017-06-26Use the migration name as a key in redisBob Van Landuyt
2017-06-26Don't break rolling back when a namespace or project was renamedBob Van Landuyt
2017-06-26More logging so we know we have the rename in redisBob Van Landuyt
2017-06-26Revert renames from a migrationBob Van Landuyt