Commit Graph

81 Commits

Author SHA1 Message Date
Sean McGivern 4ebbfe5d3e Remove serialised diff and commit columns
The st_commits and st_diffs columns on merge_request_diffs historically held the
YAML-serialised data for a merge request diff, in a variety of formats.

Since 9.5, these have been migrated in the background to two new tables:
merge_request_diff_commits and merge_request_diff_files. That has the advantage
that we can actually query the data (for instance, to find out how many commits
we've stored), and that it can't be in a variety of formats, but must match the
new schema.

This is the final step of that journey, where we drop those columns and remove
all references to them. This is a breaking change to the importer, because we
can no longer import diffs created in the old format, and we cannot guarantee
the export will be in the new format unless it was generated after this commit.
2017-11-28 16:13:40 +00:00
Shinya Maeda b982a44abb Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce into 38464-k8s-apps 2017-11-07 21:24:28 +09:00
Shinya Maeda bbdb0cf051 Merge branch 'master' into 38464-k8s-apps 2017-11-07 21:23:54 +09:00
Rémy Coutable 31e3ef93e5 Merge branch 'feature/custom-attributes-on-projects-and-groups' into 'master'
Support custom attributes on groups and projects

See merge request gitlab-org/gitlab-ce!14593
2017-11-07 10:59:38 +00:00
Alessio Caiazza d6134709cb
Remove Project#clusters export 2017-11-07 11:20:02 +01:00
Alessio Caiazza 2b4fccb720
Add Helm import/export 2017-11-06 18:06:02 +01:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Shinya Maeda 6571efb6c3 Fix spec. Fix usage ping. Fix warnings by adding new models and attributes. 2017-11-01 16:12:44 +09:00
Sean McGivern 565a2d7303 Merge branch '35580-cannot-import-project-with-milestones' into 'master'
fix the import :milestone from adding the group_id

Closes #35580

See merge request gitlab-org/gitlab-ce!14657
2017-10-11 10:46:05 +00:00
micael.bergeron de025ad2db fixing group label import 2017-10-06 09:11:29 -04:00
micael.bergeron a8d9dbc1a6 fix the project import when an issue has a group milestone 2017-10-05 12:05:55 -04:00
Shinya Maeda 982c2b83ed Fix static anlysys. Added safe_model_attributes. 2017-10-04 18:21:01 +09:00
Shinya Maeda 20abcbffae Add google_api to TOP_LEVEL_ROUTES. Import/Export model failure fix. Fix static analysys. 2017-10-04 16:04:45 +09:00
Kamil Trzcinski 12ddc28f84 Merge remote-tracking branch 'origin/master' into zj/gitlab-ce-zj-auto-devops-table 2017-09-07 18:03:20 +02:00
Yorick Peterse 235b105c91
Finish migration to the new events setup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.

While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
2017-09-06 16:40:31 +02:00
Zeger-Jan van de Weg bcd70c4c46
Incorporate review 2017-09-04 15:44:46 +02:00
Zeger-Jan van de Weg 78dad4cf32
Fix tests 2017-09-04 09:27:09 +02:00
Sean McGivern 9a73b634ab Add table for files in merge request diffs
This adds an ID-less table containing one row per file, per merge request
diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised
currently, with the advantage that we can easily query the attributes of this
new table.

It does not migrate existing data, so we have fallback code when the legacy
st_diffs column is present instead. For a merge request diff to be valid, it
should have at most one of:

* Rows in this new table, with the correct merge_request_diff_id.
* A non-NULL st_diffs column.

It may have neither, if the diff is empty.
2017-06-16 18:30:01 +01:00
Grzegorz Bizon 3801a0df80 Export pipeline stages in import/export feature 2017-06-05 12:46:57 +02:00
Zeger-Jan van de Weg 8df3997a92 Add Pipeline Schedules that supersedes experimental Trigger Schedule 2017-05-07 22:35:56 +00:00
blackst0ne cca09bbb18 Update Import/Export files 2017-05-05 16:39:26 +11:00
blackst0ne 11aff97d88 Remove the User#is_admin? method 2017-04-09 13:20:57 +11:00
Kushal Pandya 8a5ca1121b Merge branch 'master' into '18471-restrict-tag-pushes-protected-tags'
# Conflicts:
#   spec/lib/gitlab/import_export/all_models.yml
2017-04-06 21:12:16 +00:00
Shinya Maeda a67aff6d39 Add Import/Export Setting for trigger_schedule. Remove ref validation. 2017-04-06 23:46:58 +09:00
Kushal Pandya 18506d4b8b Merge branch 'master' into '18471-restrict-tag-pushes-protected-tags'
# Conflicts:
#   app/assets/javascripts/dispatcher.js
#   app/assets/stylesheets/pages/projects.scss
2017-04-06 09:46:50 +00:00
James Lopez 22d7ae8002 Fix issues importing forked projects 2017-04-04 16:34:19 +00:00
James Edwards-Jones 07d7d8e659 Renamed ProtectedTag push_access_levels to create_access_levels 2017-04-04 03:38:58 +01:00
James Edwards-Jones 3bb3a6886f Attempt to fix import/export of push_access_levels for protected tags 2017-04-04 02:19:04 +01:00
James Edwards-Jones 9f4b8dba80 Clean up non TODO rubocop errors 2017-04-03 20:06:06 +01:00
Kamil Trzciński 12dd5ac221 All CI offline migrations 2017-03-17 23:06:11 +00:00
James Lopez 8409340b3b Add missing group members to export for I/E 2017-02-07 11:06:05 +01:00
James Lopez 017a5068f6 fix spec failure 2017-01-30 14:26:32 +01:00
James Lopez 1a2d13c821 programmatically remove encrypted attributes. Added relevant spec. 2017-01-30 12:34:32 +01:00
James Lopez eeb13c16d1 rename method and added note to export file spec about new encrypted attributes 2017-01-30 12:34:32 +01:00
James Lopez 6a2b976c66 fix typo 2017-01-30 12:34:32 +01:00
James Lopez e589c7e848 Ignore encrypted attributes in Import/Export
* Regenerates tokens for all models that have them
* Remove variables, since they are basically just storing encrypted data
* Bumped version up to 0.1.6
* Updated related docs
2017-01-30 12:34:32 +01:00
James Lopez e8a9682bc9 fix typo 2017-01-19 09:44:20 +01:00
James Lopez 17c099161e fix and refactor note user mapping 2017-01-18 17:40:24 +01:00
James Lopez b3bb8dc46f added spec replicating the problem 2017-01-18 15:46:54 +01:00
James Lopez 5452747729 Fix error importing label priorities and added relevant spec 2016-12-21 10:33:20 +01:00
Rémy Coutable 8c8c4f8c5a Merge branch 'fix/import-export-mr-error' into 'master'
Fix import/export merge requests error

When MWBS is set and the MR exported/imported an error gets thrown. We should ignore this so it can succeed as the merge user may no longer exist in the target instance.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24009 and https://gitlab.com/gitlab-com/support-forum/issues/1345

See merge request !8134
2016-12-19 18:03:06 +00:00
James Lopez 0631c7bcdc Fix MR issue to do with merge user 2016-12-19 16:52:38 +01:00
James Lopez 786457ca3e
Fix for missing service when importing from EE to CE
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19 16:32:26 +01:00
James Lopez d6edecdeec Fix duplicated build token problem and added relevant spec 2016-12-19 11:26:57 +01:00
Douwe Maan cfb511ea69 Merge branch 'fix/import-projectmember-security' into 'security'
Fix Import/Export foreign key issue to do with project members

Cleans-up any foreign keys in `ProjectMember` - same as we do with the rest of the models when importing.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23837 and https://gitlab.com/gitlab-org/gitlab-ce/issues/23739

See merge request !2020

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-03 16:04:18 +01:00
James Lopez 891e5f4851 Update specs to cope with new label types and priorities
Fixed all related specs and also changed the logic to handle edge cases. This includes exporting and exporting of group labels, which will get associated with the new group (if any) or they will become normal project labels otherwise.

Found other issues to do with not being able to import all labels at once in the beginning of the JSON - code was much simpler when we import all labels and milestones associated to a project first, then the associations will find the already created labels instead of creating them from the associations themselves.
2016-10-19 14:58:28 -02:00
James Lopez 77b7bfd463 Fix import/export labels to cope with project and group labels. Added relevant specs. 2016-10-19 14:58:25 -02:00
James Lopez 848a146fc3 Fix import test 2016-10-19 14:58:25 -02:00
James Lopez 4c480be39b Prevent claiming associated model IDs via import and added relevant specs 2016-09-27 15:48:10 +02:00
James Lopez 3c7feaf3b1 Fixed label color issue and added Import/Export versioning table 2016-09-19 09:18:37 +02:00