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

Resolves broken tests on local and adds GH actions pipeline #63

Merged
merged 33 commits into from
Sep 11, 2023

Conversation

cnizzardini
Copy link
Collaborator

@cnizzardini cnizzardini commented May 19, 2023

This PR adds github actions pipeline so the library can be tested in all supported versions of CakePHP and PHP. It also resolves a number of errors, typos and inaccurate comments.

Resolves #62

Looking at the last PR some users @swiffer @gildonei and others may take issue with removing the mixed return type, but it seems as though that PR may have broken installs running 7.2 - 7.4.

If this PR is approved I suggest forcing PRs to pass checks, updating build image on readme, and ideally adding coveralls.io so we can see coverage statics.

*
* @return string
*/
public function __serialize()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is throwing a type error in tests on 7.4

@@ -14,6 +14,7 @@
<testsuites>
<testsuite name="AuditStash Test Suite">
<directory>./tests/TestCase</directory>
<exclude>./tests/TestCase/Persister/ElasticSearchPersisterIntegrationTest.php</exclude>
Copy link
Collaborator Author

@cnizzardini cnizzardini May 20, 2023

Choose a reason for hiding this comment

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

This will be run in github action now: cnizzardini#1

Comment on lines +80 to +83
* @return mixed
*/
public function jsonSerialize(): mixed
#[\ReturnTypeWillChange]
public function jsonSerialize()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is proper way to deal with deprecation notices in php 8 while maintaining BC.

Comment on lines -83 to 90
$client = $this->getConnection();
$documents = $this->transformToDocuments($auditLogs);

$connection = $this->getConnection();
$client = $connection->getDriver();
$client->addDocuments($documents);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This might need someone who is actually using elastic to look at it, but it passes the pipeline.

->method('log')
->with(
'[AuditStash\Persister\TablePersister] Persisting audit log failed. Data:' . PHP_EOL .
Debugger::exportVar($logged, 4)
);
->method('log');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Issue with created datetime zone on the logged entity in some php versions so I removed the full arg check.

@cnizzardini
Copy link
Collaborator Author

@lorenzo is this no longer maintained?

@lorenzo
Copy link
Owner

lorenzo commented Sep 11, 2023

@cnizzardini not using this anymore, but I try to be a good open source citizen and merge things whenever I find the time. Thanks for your contribution!

@lorenzo lorenzo merged commit c03812d into lorenzo:master Sep 11, 2023
@lorenzo
Copy link
Owner

lorenzo commented Sep 11, 2023

@cnizzardini let me know if you would like to become a maintainer and I can give you commit bits

@cnizzardini
Copy link
Collaborator Author

Not sure I have the time or the deeper knowledge of all bits of this library to fully maintain it. I'd be fine maintaining it with a group of people though. Are there are any other contributors you can think of to add as well @lorenzo ?

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.

Tests fail on my local
2 participants