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

[one-cmds] Revise one-codegen #14120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[one-cmds] Revise one-codegen #14120

wants to merge 2 commits into from

Conversation

mhs4670go
Copy link
Contributor

This commit revises one-codegen.

  • Revise the overall logic to make it easy to maintain.
  • Rename confusing variables.
  • Add missing checks for input validation.

Draft: #14005
ONE-DCO-1.0-Signed-off-by: seongwoo [email protected]

@mhs4670go mhs4670go requested a review from a team September 27, 2024 10:25
@@ -5,7 +5,6 @@ one-codegen=True
target=onecc_066

[one-codegen]
invalid_option=onecc_066
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From now, non-registered options in command schema raises an error.

This commit revises one-codegen.

- Revise the overall logic to make it easy to maintain.
- Rename confusing variables.
- Add missing checks for input validation.

ONE-DCO-1.0-Signed-off-by: seongwoo <[email protected]>
if grep -q "error: 'command' key is missing in the configuration file" "${filename}.log"; then
if grep -q "error: Not found the command for given backend" "${filename}.log"; then
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before and after the commit of this test catches the same negative case.

Comment on lines +78 to +95
[1] one-codegen -h
[2] one-codegen -v
[3] one-codegen -C ${cfg} (backend, command key in cfg)
[4] one-codegen -C ${cfg} (backends key in cfg)
[5] one-codegen -b ${backend} ${command}
[6] one-codegen -b ${backend} -- ${command}
[7] one-codegen -b ${backend} -C {cfg} (backend, command key in cfg)
[8] one-codegen -b ${backend} -C {cfg} (backends key in cfg) (Only 'backend' is invoked,
even though cfg file has multiple backends)
[9] one-codegen -b ${backend} -C ${cfg} -- ${command} (backend, command key in cfg)
[10] one-codegen -b ${backend} -C ${cfg} -- ${command} (backends key in cfg) (Only 'backend' is invoked,
even though cfg file has multiple backends)
[11] one-codegen -C {cfg} (w/ target, w/ command schema)
[12] one-codegen -C {cfg} (w/ target, w/o command schema)
[13] one-codegen -C {cfg} -T {target} (w/ command schema)
[14] one-codegen -C {cfg} -T {target} (w/o command schema)
[15] one-codegen -T {target} ${command} (ignore command schema)
[16] one-codegen -T {target} -- ${command} (ignore command schema)
Copy link
Contributor Author

@mhs4670go mhs4670go Sep 27, 2024

Choose a reason for hiding this comment

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

This comments has been just pulled up from below L175.

@seanshpark
Copy link
Contributor

@mhs4670go , change is a bit huge to concentrate and review.
If you can't split this change, I still can confirm the changes but you have to be sure about the changes.

Copy link
Contributor

@seanshpark seanshpark left a comment

Choose a reason for hiding this comment

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

LGTM

@mhs4670go
Copy link
Contributor Author

@seanshpark

I still can confirm the changes but you have to be sure about the changes.

I'm also worried about whether the change doesn't have any bugs.. At least, this change passed all the current tests. So, I can say it is okay.

@seanshpark
Copy link
Contributor

@lemmaa PTAL

1 similar comment
@seanshpark
Copy link
Contributor

@lemmaa PTAL

@lemmaa
Copy link
Member

lemmaa commented Oct 17, 2024

@lemmaa PTAL

Sorry. I'll look into it as soon as possible.

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.

3 participants