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

Update psr/log #100

Merged
merged 5 commits into from
Jan 17, 2022
Merged

Update psr/log #100

merged 5 commits into from
Jan 17, 2022

Conversation

snapshotpl
Copy link
Contributor

No description provided.

@snapshotpl
Copy link
Contributor Author

@maciejlew when we can expect review, merge and release?

@ProteanCode
Copy link

We need this in newer Symfony-based frameworks

@maciejlew maciejlew self-requested a review January 10, 2022 13:52
@@ -18,7 +18,7 @@
"require": {
"php": "^7 || ^8.0",
"ext-json": "*",
"psr/log": "^1",
"psr/log": "^1 || ^2 || ^3",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Run make test-php8 and you will see:

Fatal error: Declaration of Smsapi\Client\Curl\SmsapiHttpClient::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void in /app/src/Curl/SmsapiHttpClient.php on line 33

To fix that you have to drop PHP 7.0 support. Do that and I will release next major version with your changes.

@snapshotpl
Copy link
Contributor Author

I have remove travis and added github actions config, but I need to enable it in repo config.

@maciejlew
Copy link
Collaborator

I'm not sure what action to be taken you expect from me. GitHub Actions are enabled as described here: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#about-github-actions-permissions-for-your-repository, however, I don't see any approve workflow run request as described here: https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks. Is that what you expect? Maybe that approve workflow run do not exist because there is no workflow yet?

@snapshotpl
Copy link
Contributor Author

Can you check if GH Actions are enabled here https://github.com/smsapi/smsapi-php-client/settings/actions ?

@snapshotpl
Copy link
Contributor Author

Oh, see now you have already check this. Strange, workflow should works now

@snapshotpl
Copy link
Contributor Author

Just added sample workflow from https://docs.github.com/en/actions/quickstart and still nothing. Probably something still need to be setting up.

@snapshotpl
Copy link
Contributor Author

Now working and all test pass!

@snapshotpl snapshotpl changed the title Update psr\log Update psr/log Jan 13, 2022
@maciejlew
Copy link
Collaborator

Glad to see that. I'm not sure what has helped, I haven't changed any setting. Maybe one of my PRs with workflow triggered something.

Anyway, despite that unit tests are passing, there is still problem with integration ones. HTTP client is being produced and error I've mentioned before occur only when running integration tests. Check out SmsapiClientIntegrationTestCase::prepare.

To run integration test you have to pass access token and that is the reason why we do not execute them here.

You can configure that tests locally, in your developement environment, even passing incorrect access token, and you will see the error.

@snapshotpl
Copy link
Contributor Author

Check now.

I think we should run integration test on CI, you can provide token by secret, so will be not shared.

@snapshotpl
Copy link
Contributor Author

snapshotpl commented Jan 14, 2022

LoggerAware is fixed, but found custom test logger now.

@snapshotpl
Copy link
Contributor Author

I think we should avoid current TestLogger - it's just echo debug information so looks like only for development proces. The same can be done by xdebug.

If we want to break version, then we need to release client 4 with log v2 and client 5 with log v3. So I prefer to drop TestLogger.

@maciejlew
Copy link
Collaborator

Running integration tests seems not to be a good decision for test stability and security reasons.

Test may fail and test cleanup may not execute. That will make impact on future test runs.

Someone may write malicious test code that, for example, may send spam using our test account. Test are now being executed on each pull request so code review will always happen after the fact. Even not accepted pull request may cause security breach.

@maciejlew
Copy link
Collaborator

Drop TestLogger.

@maciejlew maciejlew merged commit 8fdb0ef into smsapi:master Jan 17, 2022
maciejlew added a commit that referenced this pull request Jan 17, 2022
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.

None yet

5 participants