Repository navigation
Require --name when updating metadata instances - #3448
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
'elyra-metadata update' needs the name of the instance to update, but the CLI declared '--name' as optional, as it is for 'create', where the name can be derived from the display name. When the option was missing, the metadata service rejected the request and the CLI reported an unexpected exception: The following exception occurred saving metadata instance for schema 'runtime-image': The 'name' parameter requires a value. Declare '--name' as required for 'update', so the CLI reports the missing parameter and displays the usage, like it does for other required parameters: ERROR: '--name' is a required parameter. Fixes elyra-ai#2577 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3448 +/- ##
==========================================
+ Coverage 84.81% 84.92% +0.11%
==========================================
Files 159 159
Lines 19296 19302 +6
Branches 503 503
==========================================
+ Hits 16365 16392 +27
+ Misses 2891 2871 -20
+ Partials 40 39 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Member
|
@NopeCharon I have a local pr I am still working on it to replace #1379 and I this change would probably be misplaced with those changes. Let's maybe wait a bit for this one? Hopefully i can get it in by next week. |
Contributor
Author
|
Sure, happy to wait. Once your CLI rework is in I can rebase this or close it if it's no longer needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
elyra-metadata update(formerlyinstall --replace) needs--nameto identify the instance to update, but the option was declared as optional, as it is forcreate, where the name can be derived from the display name. When--namewas omitted, the request reached the metadata service, which rejected it, and the CLI reported an unexpected exception:This PR declares
--nameas required for theupdatesubcommand only (SchemaspaceUpdate.name_option), so the CLI reports the missing parameter and displays the usage, like it does for other required parameters:A name provided through
--jsonor--file(or derived from the display name in that payload) still satisfies the requirement, because those values are transferred to the command-line options before the required options are checked.createis unchanged.How was this pull request tested?
test_update_no_schema_singleandtest_update_no_nameinelyra/tests/metadata/test_metadata_app.py, which asserted the old exception message. They now check for the CLI error, the absence of the exception message, theRequiredmarker in the usage, and that--name=without a value reportsParameter '--name' requires a value.pytest elyra/tests/metadata/test_metadata_app.py: allupdateandcreatetests pass. The remaining failures in my environment (11list/remove/export/importtests) fail identically onmain.elyra-metadata update runtime-imageswithout--name(output above), and updated an existing runtime image with--jsonthat containsname(or onlydisplay_name, from which the name is derived) and no--nameoption; the instance was updated as before.flake8andblack --checkare clean on the changed files.Fixes #2577
Developer's Certificate of Origin 1.1