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

Allow php8 #18

Merged
merged 18 commits into from
Feb 18, 2021
Merged

Allow php8 #18

merged 18 commits into from
Feb 18, 2021

Conversation

snapshotpl
Copy link
Contributor

No description provided.

@Nexucis
Copy link
Owner

Nexucis commented Nov 3, 2020

I'm not sure it's ok to merge it since the lib elasticsearch/elasticsearch doesn't support it currently.

@snapshotpl
Copy link
Contributor Author

You have right

@snapshotpl
Copy link
Contributor Author

Looks like PR for es lib for PHP8 already exists elastic/elasticsearch-php#1063

@Nexucis
Copy link
Owner

Nexucis commented Nov 4, 2020

yeah it doesn't look it's a top priority on elasticsearch side :/. Maybe if more people are complaining about this issue, it will go faster.

In the meantime, I was looking to the CI status to see what it is failing. It looks like the code / the tests are a bit outdated. Do you want to refresh it ? (Would suggest to do it in another PR)

@snapshotpl
Copy link
Contributor Author

I'm not familiar with Circle CI so I can help with test too much. Looks like now CI run only on PHP 7.2, right?

@Nexucis
Copy link
Owner

Nexucis commented Nov 4, 2020

yes that's right.

But that's something you can try on your own environment I believe. After looking at the different issue, it seems it's because of the new version of PHP and also because of the new version of PHPUnit that causes the trouble.

The setup of circleci is not really important at this point. I believe this is something quite easy to reproduce on a local environment :)

@Nexucis
Copy link
Owner

Nexucis commented Jan 10, 2021

ah looks like elasticsearch is supporting now php8.

@Nexucis
Copy link
Owner

Nexucis commented Feb 1, 2021

I will wait that elasticsearch is releasing a new version that supports php 8. And after I think we will be good

@snapshotpl
Copy link
Contributor Author

@Nexucis
Copy link
Owner

Nexucis commented Feb 13, 2021

\o/ nice. Do you want to finish this PR ?
On my side I won't be able to work on it before a couple of weeks I think.

@codecov-io
Copy link

codecov-io commented Feb 17, 2021

Codecov Report

Merging #18 (4a93ae5) into master (add8501) will increase coverage by 0.43%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #18      +/-   ##
============================================
+ Coverage     98.43%   98.86%   +0.43%     
+ Complexity      195      192       -3     
============================================
  Files             4        4              
  Lines           510      527      +17     
============================================
+ Hits            502      521      +19     
+ Misses            8        6       -2     
Impacted Files Coverage Δ Complexity Δ
...downtime/Exceptions/IndexAlreadyExistException.php 100.00% <ø> (ø) 1.00 <0.00> (ø)
...r/Nodowntime/Exceptions/IndexNotFoundException.php 100.00% <ø> (ø) 1.00 <0.00> (ø)
...ch/Helper/Nodowntime/Parameter/SearchParameter.php 100.00% <ø> (ø) 84.00 <0.00> (ø)
...is/Elasticsearch/Helper/Nodowntime/IndexHelper.php 98.03% <100.00%> (+0.80%) 106.00 <0.00> (-3.00) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update add8501...4a93ae5. Read the comment docs.

@snapshotpl
Copy link
Contributor Author

@Nexucis finally works! :-)

Copy link
Owner

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the changes @snapshotpl !
I just added some comments, there are more questions that actually required changes.

@@ -700,20 +702,14 @@ protected function existsAlias($alias)
'name' => urlencode($alias)
);

$response = $this->client->indices()->existsAlias($params);

if (is_array($response) && array_key_exists('status', $response)) {
Copy link
Owner

Choose a reason for hiding this comment

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

a bit weird you removed this code and it is still working. Was it a dead code ? Or am I missing something new in ElasticSearch ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

existsAlias always return bool, so it was a dead code

{
// load static data
self::$documents = json_decode(file_get_contents('http://data.consumerfinance.gov/api/views.json'));
self::$documents = self::$documents === null
Copy link
Owner

Choose a reason for hiding this comment

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

definitely better like that indeed. Thanks for changed that !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Faster and stable! :-)

class IndexActionTest extends AbstractIndexHelperTest
{
use AssertionRenames;
Copy link
Owner

Choose a reason for hiding this comment

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

just for my knowledge, what does it do or why is it needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To support old phpunit for php 7.1 and 7.2

Copy link
Owner

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

all good, thanks @snapshotpl !

@Nexucis Nexucis merged commit 5c6e48e into Nexucis:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants