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

Fixes broken app when management is turned off #4891

Merged

Conversation

ashwin-pc
Copy link
Member

Description

Then management.enabled: false is set in the config, the app now correctly loads without breaking.

Issues Resolved

fixes #4671

Screenshot

Testing the changes

set management.enabled: false in the config file and startup OSD. All the pages should be working while the management pages are disabled.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
@ashwin-pc ashwin-pc changed the title fixes broken app when management is turned off Fixes broken app when management is turned off Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #4891 (06e58bc) into main (9d7f576) will decrease coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #4891      +/-   ##
==========================================
- Coverage   66.39%   66.39%   -0.01%     
==========================================
  Files        3397     3397              
  Lines       64804    64806       +2     
  Branches    10360    10361       +1     
==========================================
+ Hits        43026    43027       +1     
- Misses      19218    19219       +1     
  Partials     2560     2560              
Flag Coverage Δ
Linux_1 34.85% <0.00%> (-0.01%) ⬇️
Linux_2 55.15% <ø> (ø)
Linux_3 44.24% <0.00%> (+<0.01%) ⬆️
Linux_4 34.92% <0.00%> (-0.01%) ⬇️
Windows_1 34.87% <0.00%> (-0.01%) ⬇️
Windows_2 55.12% <ø> (ø)
Windows_3 44.24% <0.00%> (+<0.01%) ⬆️
Windows_4 34.92% <0.00%> (-0.01%) ⬇️

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

Files Changed Coverage Δ
...page/overview_page_footer/overview_page_footer.tsx 50.00% <0.00%> (-10.00%) ⬇️
...ugins/vis_augmenter/public/ui_actions_bootstrap.ts 5.88% <0.00%> (-0.79%) ⬇️

... and 1 file with indirect coverage changes

Comment on lines +78 to +80
try {
uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, viewEventsOptionAction);
uiActions.addTriggerAction(SAVED_OBJECT_DELETE_TRIGGER, savedObjectDeleteAction);
Copy link
Collaborator

@AMoo-Miki AMoo-Miki Sep 1, 2023

Choose a reason for hiding this comment

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

wouldn't it be safer to wrap them individually? That way, a failure, due to one plugin being disabled, will not prevent other listeners from being added. Maybe even throw the triggers and the callbacks into an array and then loop through them and add the trigger, wrapped in a try-catch.

Copy link
Member

Choose a reason for hiding this comment

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

I think I agree, but this may be fine for the current state of the augmenter feature. @ohltyler @lezzago , what's the intended behavior in the case were only management is disabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah with the current behaviour this is fine. The context menu trigger comes from the embeddables plugin which is not something we disable (Dashboards would not work without it). So in theory the only real action that cannot be registered is the savedObject Management trigger, which is already the second action in the try block.

uiActions.addTriggerAction(PLUGIN_RESOURCE_DELETE_TRIGGER, pluginResourceDeleteAction);
uiActions.addTriggerAction(EXTERNAL_ACTION_TRIGGER, openEventsFlyoutAction);

// These triggers are registered by other plugins. If they are disabled can throw an error.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// These triggers are registered by other plugins. If they are disabled can throw an error.
// These triggers are registered by other plugins. If they are disabled, adding an action can throw an error.

Comment on lines +78 to +80
try {
uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, viewEventsOptionAction);
uiActions.addTriggerAction(SAVED_OBJECT_DELETE_TRIGGER, savedObjectDeleteAction);
Copy link
Member

Choose a reason for hiding this comment

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

I think I agree, but this may be fine for the current state of the augmenter feature. @ohltyler @lezzago , what's the intended behavior in the case were only management is disabled?

@ashwin-pc ashwin-pc merged commit 1068939 into opensearch-project:main Sep 1, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 1, 2023
* fixes broken app when management is turned off

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* updates changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 1068939)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
AMoo-Miki pushed a commit that referenced this pull request Sep 5, 2023
* fixes broken app when management is turned off

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* updates changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 1068939)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

[BUG] visAugmenter requiring savedObjectsManagement puts other features at jeopardy
5 participants