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

Update metadata API to require either name or display_name #629

Merged
merged 22 commits into from
Jun 12, 2020

Conversation

vabarbosa
Copy link
Contributor

@vabarbosa vabarbosa commented Jun 10, 2020

Update the /metadata/<namespace> POST endpoint to allow missing name field if the display_name is provided

Fixes #623
Fixes #632

FYI, the swagger docs continue to still indicate name is required. I did not update it because at the moment swagger does not provide a mechanism for specifying any one of a set of parameters is required.

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.

@vabarbosa vabarbosa changed the title Update metadata API to allow missing name if the display_name is provided Update metadata API to require either name or display_name Jun 10, 2020
@vabarbosa vabarbosa removed the request for review from ajbozarth June 10, 2020 23:42
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

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

Thanks Va - just a couple comments.

Regarding the swagger doc update, I guess I'm not following how removing 'name' as required from MetadataResourceBodyPost applies to the issue you list regarding query parameters. Once we support query parameters, I would expect them to apply to the various GET handlers anyway and I figured only the body for POST would require an update here. I'm sorry if I'm not understanding the issue.

elyra/metadata/handlers.py Outdated Show resolved Hide resolved
elyra/metadata/metadata.py Show resolved Hide resolved
elyra/metadata/schemas/code-snippet.json Show resolved Hide resolved
cleam up comment based on review comments
@vabarbosa
Copy link
Contributor Author

Thanks Va - just a couple comments.

Regarding the swagger doc update, I guess I'm not following how removing 'name' as required from MetadataResourceBodyPost applies to the issue you list regarding query parameters. Once we support query parameters, I would expect them to apply to the various GET handlers anyway and I figured only the body for POST would require an update here. I'm sorry if I'm not understanding the issue.

@kevin-bates my apologies, the misunderstanding was on my part. not sure how or why i was confusing the query parameters with the request body. you can ignore that comment!

@kevin-bates
Copy link
Member

No worries at all Va!

@kevin-bates
Copy link
Member

Hi Va - your particular branch is causing build errors. Not sure if its due to how you maintain your branches or not but I can't reproduce the build issue unless I pull and build your branch. My system uses an older version of yarn than what GH Actions are using, but the results are the same...

yarn run eslint
yarn run v1.17.3
$ eslint . --fix --ignore-path .gitignore --ext .ts,.tsx,.js
✨  Done in 2.95s.
export PATH=$(pwd)/node_modules/.bin:$PATH && lerna run build
lerna notice cli v3.22.1
lerna info Executing command in 6 packages: "yarn run build"
lerna ERR! yarn run build exited 1 in '@elyra/ui-components'
lerna ERR! yarn run build stdout:
yarn run v1.17.3
$ tsc
../../node_modules/@blueprintjs/core/lib/esm/components/divider/divider.d.ts(258,28): error TS2707: Generic type 'UIEvent<T>' requires between 0 and 1 type arguments.
../../node_modules/@blueprintjs/core/lib/esm/components/divider/divider.d.ts(259,35): error TS2707: Generic type 'UIEvent<T>' requires between 0 and 1 type arguments.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
error Command failed with exit code 1.

lerna ERR! yarn run build exited 1 in '@elyra/ui-components'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
make: *** [build-ui] Error 1

@vabarbosa
Copy link
Contributor Author

vabarbosa commented Jun 11, 2020

thank you @kevin-bates, i noticed that and am looking into it.

the failure is happening with the @blueprintjs components which @jupyterlab/ui-components depends on. and the @elyra/ui-components depends on @jupyterlab/ui-components.

there was a new release of @blueprintjs (right before i submitted the PR) which i believe is causing these errors. someone else has also reported this error to them.

i will continue to look into this further to make sure i am not missing anything, but i suspect you should see the same error in any new/clean build which ends up downloading the latest @blueprintjs components.

@kevin-bates
Copy link
Member

I see. Thank you for the explanation. I suppose this is just a way of life Dependency-land! Not quite the happiest place on earth.

Configure selective version resolution  for @blueprint components
@vabarbosa
Copy link
Contributor Author

i just pushed a change that should pin the @blueprintjs components version and resolve the build failures for now (until a fix/new version is available).

Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

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

Thanks Va - this is a nice enhancement for display names.

Does the update of the build-break change now need to be backed out of this PR or will it just get subsumed by git's conflict resolution stuff?

@vabarbosa
Copy link
Contributor Author

vabarbosa commented Jun 11, 2020

Thanks Va - this is a nice enhancement for display names.

Does the update of the build-break change now need to be backed out of this PR or will it just get subsumed by git's conflict resolution stuff?

it should be resolved by git but i will merge the update and confirm. if necessary will back it out

@vabarbosa vabarbosa mentioned this pull request Jun 11, 2020
2 tasks
Co-authored-by: Karla Spuldaro <karla.spuldaro@ibm.com>
Copy link
Member

@lresende lresende left a comment

Choose a reason for hiding this comment

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

LGTM

@lresende lresende merged commit 2f27049 into elyra-ai:master Jun 12, 2020
@vabarbosa vabarbosa deleted the vabarbosa-metadata branch June 30, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants