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

Refactor: refactor contextProvider get to reduce re-fetch #365

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

raintygao
Copy link
Collaborator

Description

refactor contextProvider get to reduce re-fetch

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test.
  • New functionality has user manual doc added.
  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
@raintygao raintygao added backport 2.x Trigger the backport flow to 2.x backport 2.18 labels Oct 29, 2024
const context = await incontextInsight.contextProvider?.();
const monitorType = context?.additionalInfo?.monitorType;
const dsl = context?.additionalInfo?.dsl;
if (!contextObject) return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: The contextObject was initialized in onGenerateSummary below and was only executed once. The displayDiscoverButton won't be true if contextObject is undefined. I'm not sure if it matches the business logic.

@raintygao raintygao merged commit 5ac419e into opensearch-project:main Oct 29, 2024
13 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 29, 2024
* refactor: refacotr contextProvider get to reduce re-fetch

Signed-off-by: tygao <tygao@amazon.com>

* doc: add changelog

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
(cherry picked from commit 5ac419e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 29, 2024
* refactor: refacotr contextProvider get to reduce re-fetch

Signed-off-by: tygao <tygao@amazon.com>

* doc: add changelog

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
(cherry picked from commit 5ac419e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
raintygao pushed a commit that referenced this pull request Oct 29, 2024
* refactor: refacotr contextProvider get to reduce re-fetch

Signed-off-by: tygao <tygao@amazon.com>

* doc: add changelog

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
(cherry picked from commit 5ac419e)
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>
raintygao pushed a commit that referenced this pull request Oct 29, 2024
* refactor: refacotr contextProvider get to reduce re-fetch

Signed-off-by: tygao <tygao@amazon.com>

* doc: add changelog

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
(cherry picked from commit 5ac419e)
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>
@ruanyl ruanyl added the v2.18.0 label Nov 11, 2024
raintygao added a commit to raintygao/dashboards-assistant that referenced this pull request Jan 22, 2025
…-project#365)

* refactor: refacotr contextProvider get to reduce re-fetch

Signed-off-by: tygao <tygao@amazon.com>

* doc: add changelog

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Trigger the backport flow to 2.x backport 2.18 v2.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants