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

[CCI] Revert changes to chart themes #831

Conversation

andreymyssak
Copy link
Collaborator

Description

2086980 and e9a63af have been reverted to not break integrations with OpenSearch Dashboards.

Issues Resolved

#810

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • All tests pass
    • yarn lint
    • yarn test-unit
  • 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.

@BSFishy
Copy link
Contributor

BSFishy commented Jun 20, 2023

@AMoo-Miki do we still want this? If it's not merged, OSD builds will be broken on main. I suppose I'm not super opposed to merging it, but we still don't officially support Elastic Charts, so having this code in the repo feels kinda wrong

@AMoo-Miki
Copy link
Collaborator

Logically, these changes should be reverted in 1.x branches only since they are breaking changes in the 1.x releases. By that logic, we shouldn't revert these in main.

@BSFishy
Copy link
Contributor

BSFishy commented Jun 20, 2023

Logically, these changes should be reverted in 1.x branches only since they are breaking changes in the 1.x releases. By that logic, we shouldn't revert these in main.

These were never backported to 1.x, so we should be fine. Good to close?

@AMoo-Miki
Copy link
Collaborator

These were never backported to 1.x, so we should be fine. Good to close?

I want to hear @joshuarrrr on this as it will impact his work the most.

@joshuarrrr
Copy link
Member

I suppose I'm not super opposed to merging it, but we still don't officially support Elastic Charts, so having this code in the repo feels kinda wrong

In OpenSearch Dashboards today, we actually do still have a dependency on Elastic Charts - it's the charting library used by TSVB visualizations and a couple OpenSearch project dashboard plugins: https://github.com/search?q=repo%3Aopensearch-project%2FOpenSearch-Dashboards%20%40elastic%2Fcharts&type=code

As for these chart themes, they get loaded as part of OpenSearch Dashboards _base.scss:
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/b337bea2d13cc6c8330ba6f0326c51b53baad7f3/src/core/public/styles/_base.scss#L14

So it's not really safe to remove these until the "Migrate Elastic Chart-rendered components to Vega-Lite" section of opensearch-project/OpenSearch-Dashboards#2819 is completed

Copy link
Member

@joshuarrrr joshuarrrr left a comment

Choose a reason for hiding this comment

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

This all looks good - note that some of the theme files were renamed (such as https://github.com/AMoo-Miki/oui/blob/c7f7c70c0f106e88c8e322962bb21bb601104320/src/themes/oui-next/oui_next_colors_dark.scss) in #835 - we'll want to make sure each theme file currently existing in main has the

import '../../src/themes/charts/theme'; 

line after the elastic charts theme import

@@ -246,7 +248,7 @@ const ChartMarkdownRenderer = ({ palette, categories }) => {
return (
<Chart size={{ height: 320 }}>
<Settings
theme={[customColors]}
theme={[customColors, OUI_CHARTS_THEME_LIGHT]}
Copy link
Member

Choose a reason for hiding this comment

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

Note to self - open issue to look into migrating/removing elastic chart usage from OUI itself.

andreymyssak and others added 2 commits June 21, 2023 22:49
This reverts commit e9a63af.

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
This reverts commit 2086980.

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
@andreymyssak andreymyssak force-pushed the 810-revert-chart-themes-changes branch from 1c44f3d to 73fefe1 Compare June 23, 2023 04:39
@andreymyssak
Copy link
Collaborator Author

Once #855 is merged, this PR will be ready for review

@andreymyssak
Copy link
Collaborator Author

@BSFishy, can you advise me in which section of CHANGELOG.md I should put this change?

@BSFishy
Copy link
Contributor

BSFishy commented Jun 29, 2023

@BSFishy, can you advise me in which section of CHANGELOG.md I should put this change?

I think if the original ones had changelog entries, we'd have put them in Breaking Changes and then in this one, we'd just remove those entries because this is just meant to revert those. I'll add skip-changelog because it doesn't make sense to have a changelog for this one

@joshuarrrr joshuarrrr merged commit f8d56ba into opensearch-project:main Jul 5, 2023
@opensearch-trigger-bot
Copy link

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/oui/backport-1.x 1.x
# Navigate to the new working tree
pushd ../.worktrees/oui/backport-1.x
# Create a new branch
git switch --create backport/backport-831-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f8d56ba11811d600eb74de9d6b71e8ab9d16a1d8
# Push it to GitHub
git push --set-upstream origin backport/backport-831-to-1.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/oui/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-831-to-1.x.

@joshuarrrr
Copy link
Member

No need for backports, as, to the best of my understanding, the original changes were never backported.

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.

5 participants