# HG changeset patch # User Marcin Kuzminski # Date 2017-11-14 15:14:28 # Node ID e110c80e1044800823bddc384e79020e20f4676c # Parent 33e1a76f36f2a7b28854c1e59013091175dd30e3 # Parent 5b5f1dca6b45b023fd394e6df2c844fd76a64a85 release: merge back stable branch into default diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -25,3 +25,4 @@ 4ba4d74981cec5d6b28b158f875a2540952c2f74 0a6821cbd6b0b3c21503002f88800679fa35ab63 v4.10.1 434ad90ec8d621f4416074b84f6e9ce03964defb v4.10.2 68baee10e698da2724c6e0f698c03a6abb993bf2 v4.10.3 +00821d3afd1dce3f4767cc353f84a17f7d5218a1 v4.10.4 diff --git a/docs/release-notes/release-notes-4.10.4.rst b/docs/release-notes/release-notes-4.10.4.rst new file mode 100644 --- /dev/null +++ b/docs/release-notes/release-notes-4.10.4.rst @@ -0,0 +1,41 @@ +|RCE| 4.10.4 |RNS| +------------------ + +Release Date +^^^^^^^^^^^^ + +- 2017-11-14 + + +New Features +^^^^^^^^^^^^ + + + +General +^^^^^^^ + + + +Security +^^^^^^^^ + + + +Performance +^^^^^^^^^^^ + + + +Fixes +^^^^^ + + +- repository groups: fixed a regressions in update of nested repository groups. + + +Upgrade notes +^^^^^^^^^^^^^ + +- Fixes regression in nested repository groups update. No upgrade problems should + be expected diff --git a/docs/release-notes/release-notes.rst b/docs/release-notes/release-notes.rst --- a/docs/release-notes/release-notes.rst +++ b/docs/release-notes/release-notes.rst @@ -9,6 +9,7 @@ Release Notes .. toctree:: :maxdepth: 1 + release-notes-4.10.4.rst release-notes-4.10.3.rst release-notes-4.10.2.rst release-notes-4.10.1.rst diff --git a/rhodecode/apps/repo_group/views/repo_group_settings.py b/rhodecode/apps/repo_group/views/repo_group_settings.py --- a/rhodecode/apps/repo_group/views/repo_group_settings.py +++ b/rhodecode/apps/repo_group/views/repo_group_settings.py @@ -169,7 +169,7 @@ class RepoGroupSettingsView(RepoGroupApp # use the new full name for redirect once we know we updated # the name on filesystem and in DB - new_repo_group_name = schema_data['repo_group_name'] + new_repo_group_name = schema_data['repo_group']['repo_group_name_with_group'] h.flash(_('Repository Group `{}` updated successfully').format( old_repo_group_name), category='success') diff --git a/rhodecode/model/validation_schema/schemas/repo_group_schema.py b/rhodecode/model/validation_schema/schemas/repo_group_schema.py --- a/rhodecode/model/validation_schema/schemas/repo_group_schema.py +++ b/rhodecode/model/validation_schema/schemas/repo_group_schema.py @@ -32,6 +32,11 @@ def get_group_and_repo(repo_name): repo_name, get_object=True) +def get_repo_group(repo_group_id): + from rhodecode.model.repo_group import RepoGroup + return RepoGroup.get(repo_group_id), RepoGroup.CHOICES_SEPARATOR + + @colander.deferred def deferred_can_write_to_group_validator(node, kw): old_values = kw.get('old_values') or {} @@ -178,6 +183,7 @@ class GroupType(colander.Mapping): parent_group_name, parent_group) = get_group_and_repo(validated_name) + appstruct['repo_group_name_with_group'] = validated_name appstruct['repo_group_name_without_group'] = repo_group_name_without_group appstruct['repo_group_name'] = parent_group_name or types.RootLocation if parent_group: @@ -271,6 +277,14 @@ class RepoGroupSettingsSchema(RepoGroupS appstruct = super(RepoGroupSchema, self).deserialize(cstruct) validated_name = appstruct['repo_group_name'] + # because of repoSchema adds repo-group as an ID, we inject it as + # full name here because validators require it, it's unwrapped later + # so it's safe to use and final name is going to be without group anyway + + group, separator = get_repo_group(appstruct['repo_group']) + if group: + validated_name = separator.join([group.group_name, validated_name]) + # second pass to validate permissions to repo_group second = RepoGroupAccessSchema().bind(**self.bindings) appstruct_second = second.deserialize({'repo_group': validated_name}) diff --git a/rhodecode/tests/models/schemas/test_repo_group_schema.py b/rhodecode/tests/models/schemas/test_repo_group_schema.py --- a/rhodecode/tests/models/schemas/test_repo_group_schema.py +++ b/rhodecode/tests/models/schemas/test_repo_group_schema.py @@ -60,6 +60,7 @@ class TestRepoGroupSchema(object): assert schema_data['repo_group'] == { 'repo_group_id': None, 'repo_group_name': types.RootLocation, + 'repo_group_name_with_group': u'my_schema_group', 'repo_group_name_without_group': u'my_schema_group'} @pytest.mark.parametrize('given, err_key, expected_exc', [ @@ -96,6 +97,7 @@ class TestRepoGroupSchema(object): assert schema_data['repo_group'] == { 'repo_group_id': test_repo_group.group_id, 'repo_group_name': test_repo_group.group_name, + 'repo_group_name_with_group': full_name, 'repo_group_name_without_group': u'my_schema_group'} def test_deserialize_with_group_name_regular_user_no_perms(