Skip to content

Require --name when updating metadata instances - #3448

Open
NopeCharon wants to merge 1 commit into
elyra-ai:mainfrom
NopeCharon:require-name-on-metadata-update
Open

NopeCharon wants to merge 1 commit into
elyra-ai:mainfrom
NopeCharon:require-name-on-metadata-update

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

elyra-metadata update (formerly install --replace) needs --name to identify the instance to update, but the option was declared as optional, as it is for create, where the name can be derived from the display name. When --name was omitted, the request reached the metadata service, which rejected it, and the CLI reported an unexpected exception:

$ elyra-metadata update runtime-images
The following exception occurred saving metadata instance for schema 'runtime-image': The 'name' parameter requires a value.

This PR declares --name as required for the update subcommand only (SchemaspaceUpdate.name_option), so the CLI reports the missing parameter and displays the usage, like it does for other required parameters:

$ elyra-metadata update runtime-images
ERROR: '--name' is a required parameter.

Update a metadata instance in schemaspace 'runtime-images'.

Options
-------
...
--name=<string> (Required. Format: sequence of characters)
	The name of the metadata instance to update.
...

A name provided through --json or --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. create is unchanged.

How was this pull request tested?

  • Updated test_update_no_schema_single and test_update_no_name in elyra/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, the Required marker in the usage, and that --name= without a value reports Parameter '--name' requires a value.
  • pytest elyra/tests/metadata/test_metadata_app.py: all update and create tests pass. The remaining failures in my environment (11 list/remove/export/import tests) fail identically on main.
  • Manually ran elyra-metadata update runtime-images without --name (output above), and updated an existing runtime image with --json that contains name (or only display_name, from which the name is derived) and no --name option; the instance was updated as before.
  • flake8 and black --check are clean on the changed files.

Fixes #2577

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

'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

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.92%. Comparing base (3b1af5f) to head (19725d5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
integration-editors 48.24% <ø> (+0.09%) ⬆️
integration-misc 25.66% <ø> (ø)
integration-pipeline 48.24% <ø> (+0.62%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
elyra/tests/metadata/test_metadata_app.py 99.22% <100.00%> (+<0.01%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lresende

lresende commented Nov 1, 2026

Copy link
Copy Markdown
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.

@lresende lresende added status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. status:Needs Discussion and removed status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. labels Nov 1, 2026
@NopeCharon

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

elyra-metadata 'install ... --replace' raises unexpected error message if the required '--name' property is missing

2 participants