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

Use exception in OCI8 driver, instead of relying on assert #6596

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Use exception in OCI8 driver, instead of relying on assert #6596

merged 1 commit into from
Nov 22, 2024

Conversation

segrax
Copy link
Contributor

@segrax segrax commented Nov 13, 2024

Fixes a bug where disabled asserts in production left oci_parse() errors unchecked. Now uses explicit checks and exceptions

Fixes #6595

Q A
Type bug
Fixed issues #6595

Summary

Fixes a bug where disabled asserts in production left oci_parse()
errors unchecked. Now uses explicit checks and exceptions

@segrax segrax changed the title Replace assert with exception in OCI8 driver Use exception in OCI8 driver, instead of relying on assert Nov 13, 2024
Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Thank you. Can we cover this change with a test?

@segrax
Copy link
Contributor Author

segrax commented Nov 14, 2024

Thank you. Can we cover this change with a test?

yeah, test has just been added

@segrax
Copy link
Contributor Author

segrax commented Nov 14, 2024

@derrabus should be all good, the last failing test seems to be unrelated (and has happened a couple of times now)

Failures
 - sqlite (exited 1) - sqlite not installed. An error occurred during installation:
 The remote server returned an error: (503) Server Unavailable. Service Unavailable: Back-end server is at capacity
Sorry, we tried running command for 3 times and all attempts were unsuccessful!

Get-ChildItem : Cannot find path 'C:\tools\php' because it does not exist.
At line:6 char:3
+   Get-ChildItem -Path c:\tools\php
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\tools\php:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
 
cd : Cannot find path 'C:\tools\php' because it does not exist

@morozov
Copy link
Member

morozov commented Nov 14, 2024

The AppVeyor build failure is tracked in #6601.

@segrax
Copy link
Contributor Author

segrax commented Nov 19, 2024

hey @derrabus and @morozov,
Is there anything else needed here?

Copy link
Member

@morozov morozov left a comment

Choose a reason for hiding this comment

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

Logic wise, looks good. Just nits.

@segrax
Copy link
Contributor Author

segrax commented Nov 21, 2024

@morozov its not clear why the last test failed, seems something in the setup of php extensions failed, but theres no log of it

/usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh

==> Setup PHP
✓ PHP Installed PHP 8.3.13

==> Setup Extensions
Error: The process '/usr/bin/bash' failed with exit code 1

@morozov morozov dismissed derrabus’s stale review November 21, 2024 18:46

A test has been added.

@morozov morozov added this to the 4.2.2 milestone Nov 21, 2024
@morozov
Copy link
Member

morozov commented Nov 21, 2024

@greg0ire here's another anomaly where the the modified code is reported as not covered. If you have a minute, could you analyze the coverage reports? I will run the test locally before merging.

@morozov
Copy link
Member

morozov commented Nov 21, 2024

@segrax it's an intermittent setup failure which sometimes happen in our CI environment. I've restarted the build. Once we figure out what's wrong with test coverage, we will merge the PR. Thank you.

@greg0ire
Copy link
Member

I'm on my phone but from what I can see, only the appveyor files were processed. I'll reopen the codecov issue

Fixes a bug where disabled asserts in production left oci_parse()
errors unchecked. Now uses explicit checks and exceptions

Add test for exception on oci_parse failure

Fixes #6595
@morozov morozov merged commit 5800d08 into doctrine:4.2.x Nov 22, 2024
91 checks passed
@morozov
Copy link
Member

morozov commented Nov 22, 2024

Thanks, @segrax.

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.

OCI8 driver does not check result from oci_parse, relies on disabled assert in production
4 participants