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

chore(nms): Improve generic commands functionality #14014

Merged
merged 6 commits into from
Sep 29, 2022

Conversation

voisey
Copy link
Contributor

@voisey voisey commented Sep 26, 2022

Summary

Builds on top of #13911. Closes #13894.

This PR:

  • Adds text to NMS to instruct the user how to use the generic command functionality and points the user to magmad.yml for configuration of the commands.
  • Adapts the parameters field in NMS so that the field is valid without user modification.
  • Gives a more helpful error message when a command is not configured.

This functionality could do with further improvements, so this is seen as a first step to make the current set-up more usable. An issue will be opened with further suggested improvements.

Test Plan

  • Running this locally (see screenshots below)
  • NMS workflow in the CI

Command that is configured fails when no parameters specified
Screenshot from 2022-09-27 11-34-13

New default look
Screenshot from 2022-09-27 11-35-12

Command now works without modifying parameters field
Screenshot from 2022-09-27 11-35-47

A more helpful error is returned when a non-configured command is used
Screenshot from 2022-09-27 11-36-42

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines. label Sep 26, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added component: nms NMS-related issue component: orc8r Orchestrator-related issue labels Sep 26, 2022
@voisey voisey force-pushed the nms-generic-commands-improvements branch from e5eed3c to 499f929 Compare September 26, 2022 14:08
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
nms/app/components/GatewayCommandFields.tsx Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

feg-workflow

    2 files  203 suites   40s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit 2e7e71c.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

nms-workflow

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit 2e7e71c.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

dp-workflow

14 tests   14 ✔️  2m 39s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit 8eef16b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

cloud-workflow

1 135 tests   1 135 ✔️  2m 17s ⏱️
   365 suites         0 💤
       7 files           0

Results for commit 2e7e71c.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

agw-workflow

615 tests   611 ✔️  5m 10s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit 2e7e71c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@sebathomas sebathomas left a comment

Choose a reason for hiding this comment

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

Looking good to me but hard to review with the linter noise. ;)

Some screenshots of the frontend help text and error message would be helpful.

@voisey voisey force-pushed the nms-generic-commands-improvements branch 2 times, most recently from c61d0ca to 6aa86c4 Compare September 27, 2022 09:20
@voisey voisey marked this pull request as ready for review September 27, 2022 09:38
@voisey voisey requested a review from a team as a code owner September 27, 2022 09:38
@voisey voisey requested review from a team September 27, 2022 09:38
@voisey
Copy link
Contributor Author

voisey commented Sep 27, 2022

Looking good to me but hard to review with the linter noise. ;)

Some screenshots of the frontend help text and error message would be helpful.

I've addressed the linting noise and added some screenshots to the PR description. Let me know if there's anything else you'd like to see.

Copy link
Contributor

@sebathomas sebathomas left a comment

Choose a reason for hiding this comment

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

Looking good. If there's no easy way to handle the parameter error, I think it's fine to merge.

(You had a response interceptor in the code at some point. Is it not needed to show the correct error or did it get lost during rebase?)

@voisey voisey force-pushed the nms-generic-commands-improvements branch from 6aa86c4 to a3cf7dc Compare September 28, 2022 13:05
@voisey voisey force-pushed the nms-generic-commands-improvements branch 2 times, most recently from 8e7eeb0 to bc94e1f Compare September 28, 2022 15:42
@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2022

Oops! Looks like you failed the Python Format Check.

Howto

♻️ Updated: ✅ The check is passing the Python Format Check after the last commit.

@voisey voisey force-pushed the nms-generic-commands-improvements branch from bc94e1f to 8eef16b Compare September 28, 2022 15:51
sebathomas and others added 4 commits September 29, 2022 10:32
Work in progress, orc8r (and possibly NMS) needs to be adapted.

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
@voisey voisey force-pushed the nms-generic-commands-improvements branch 2 times, most recently from 3305a0b to e24d592 Compare September 29, 2022 08:54
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
@voisey voisey force-pushed the nms-generic-commands-improvements branch from e24d592 to 2e7e71c Compare September 29, 2022 09:15
@voisey voisey merged commit 1bd2b73 into magma:master Sep 29, 2022
pruthvihebbani pushed a commit to pruthvihebbani/magma that referenced this pull request Oct 10, 2022
* chore(magmad): Improve error handling of generic commands

Work in progress, orc8r (and possibly NMS) needs to be adapted.

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>

* Propagate Not Found error to orc8r

Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>

* Add information about configuration of generic commands

Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>

* Change default value of parameters field to use shell_params

Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>

* Handle further error cases

Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>

* Allow generic command to run with parameters `{"shell_params": []}`

Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: nms NMS-related issue component: orc8r Orchestrator-related issue size/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic command is not functional to run gateway commands via NMS.
2 participants