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

[REMOVE] Remove from scripts the deprecated methods of JodaCompatibleZonedDateTime #1600

Open
reta opened this issue May 19, 2022 · 5 comments
Labels
enhancement New feature or request technical debt If not paid, jeapardizes long-term success and maintainability of the repository. ux / ui Improvements or additions to user experience, flows, components, UI elements

Comments

@reta
Copy link

reta commented May 19, 2022

Is your feature request related to a problem? Please describe.

There are number of deprecated methods in JodaCompatibleZonedDateTime which are still available in scripts. Those should be removed since in some cases they pose significant performance overhead (due to deprecation warnings).

Describe the solution you'd like
Remove from scripts the deprecated methods from JodaCompatibleZonedDateTime.

Describe alternatives you've considered

Leave the methods there.

Additional context

See please opensearch-project/OpenSearch#3156 and opensearch-project/OpenSearch#3345

@reta reta added the enhancement New feature or request label May 19, 2022
@reta
Copy link
Author

reta commented May 19, 2022

@kavilla fyi

@kavilla kavilla added bug Something isn't working and removed enhancement New feature or request labels May 19, 2022
@kavilla
Copy link
Member

kavilla commented May 19, 2022

Hello @reta ,

Thanks for opening. I have made it a bug.

Is there a documented list of instead of x please use y publicly available? This will help the community migrate to the proper scripts.

@reta
Copy link
Author

reta commented May 19, 2022

Hello @kavilla ,

Is there a documented list of instead of x please use y publicly available? This will help the community migrate to the proper scripts.

Absolutely, first of all, there are deprecation warnings in logs:

Use of the joda time method [getMillis()] is deprecated.  Use [toInstant().toEpochMilli()] instead.

Interestingly, there is nothing in the Elasticsearch documentation about that, just the pull request [1].
Also, there is an original issue on Elasticsearch [2].

[1] elastic/elasticsearch#33486
[2] elastic/elasticsearch#35754

kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this issue May 19, 2022
Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla
Copy link
Member

kavilla commented May 19, 2022

Absolutely, first of all, there are deprecation warnings in logs:

Yeah, unfortunately for end users that purely use OpenSearch Dashboards to build these scripts wouldn't be able to see these messages unless they look at their logs as you stated which might not be likely. And do we know if these warning messages are enabled by default in a release (production) environment? And if it has gotten removed then when 3.0 comes then might wonder why their painless scripts no longer work.

I think we we can flag the original PR with "needs-documentation" it will create an issue in the documentation website repo to add these details. I think we need painless scripts logs in general and we can include the this was removed in 3.0 sections or will be removed in 3.0

cc: @ahopp, @saratvemulapalli

kavilla added a commit that referenced this issue May 20, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
#1600

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla added enhancement New feature or request ux / ui Improvements or additions to user experience, flows, components, UI elements and removed bug Something isn't working untriaged labels May 20, 2022
@kavilla
Copy link
Member

kavilla commented May 20, 2022

With #1607, I have updated the stuff we utilized for sample data and tests so I have removed the bug label and re-added the enhancement to ensure end-users don't get left with just an error message.

Right now, we don't have a lot of control of the actual values within scripted fields and I wouldn't recommend changing this value. However, based on the above mention PR'd this is an example of the kind of impact end-users will have to do if they utilized scripted fields (which is a huge feature in the application) and they are using deprecated methods that were removed.

Since this is a breaking change on the OpenSearch side, and the deprecation message has been obfuscated by OpenSearch Dashboards not outputting it to the screen. Users would have had to check their logs to see they should have been using a different method, which isn't likely if everything is working properly.

I would prefer we give in application notification about the removal of deprecated methods in Painless Scripts and provide a link to some view that's like if using x then use y or something like that which is why I tagged @opensearch-project/opensearch-ux to see if they could provide some help with this.

@tmarkley tmarkley added the technical debt If not paid, jeapardizes long-term success and maintainability of the repository. label May 25, 2022
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this issue Jun 8, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <[email protected]>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this issue Jun 16, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <[email protected]>
pjfitzgibbons pushed a commit to pjfitzgibbons/OpenSearch-Dashboards that referenced this issue Aug 10, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical debt If not paid, jeapardizes long-term success and maintainability of the repository. ux / ui Improvements or additions to user experience, flows, components, UI elements
Projects
None yet
Development

No branches or pull requests

3 participants