Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(management,merge_attributes): allow target attributes with descendants #1127

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

MyPyDavid
Copy link
Member

@MyPyDavid MyPyDavid commented Aug 20, 2024

  • minor fix for the cli command merge_attributes, add allow_descendants=True for the target attribute
  • added a test test_command_merge_attributes_fails_correctly
  • and refactor

Description

Related issue: #990

Motivation and Context

How has this been tested?

Screenshots (if appropriate)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -55,14 +55,15 @@ def handle(self, *args, **options):
verbosity = options.get('verbosity', 1)

source = get_valid_attribute(source, message_name='Source')
target = get_valid_attribute(target, message_name='Target')
target = get_valid_attribute(target, message_name='Target', allow_descendants=True)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is main part of the change

@@ -121,16 +124,65 @@ def _create_new_merge_attributes_and_views(db, settings):
create_copy_of_view_that_uses_new_attribute(db, NEW_MERGE_URI_PREFIXES)


@pytest.mark.usefixtures("_create_new_merge_attributes_and_views")
def test_command_merge_attributes_fails_correctly(db, settings):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some test for when it should fail because the input source or target was wrong

@MyPyDavid MyPyDavid marked this pull request as ready for review August 20, 2024 12:55
@MyPyDavid MyPyDavid added this to the RDMO 2.2.0 milestone Aug 20, 2024
@MyPyDavid
Copy link
Member Author

Ive updated the style and tests have passed. This can be merged right?

@jochenklar
Copy link
Member

Go for it. I think I approved before you asked for it.

@MyPyDavid
Copy link
Member Author

MyPyDavid commented Aug 20, 2024

yes ;) , thanks for review!

@MyPyDavid MyPyDavid merged commit 4afc797 into dev-2.2.0 Aug 20, 2024
18 checks passed
@MyPyDavid MyPyDavid deleted the fix-merge-attributes branch August 20, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants