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

Log HTTP requests/responses (only non-sensitive data) #211

Merged
merged 11 commits into from
Sep 19, 2022

Conversation

Ocramius
Copy link
Member

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA yes

This patch introduces general logging for:

  • HTTP requests sent to GitHub
  • HTTP responses received from GitHub

This can become a bit verbose, but verbosity could be adjusted later on, if needed: for now, we need this to figure out when/if things go wrong during a release, which is more important than clean output.

@Ocramius Ocramius added this to the 1.19.0 milestone Sep 19, 2022
@Ocramius Ocramius self-assigned this Sep 19, 2022
This failed with lowest PHPUnit versions, which
was correct: the test was not precise enough.
@cspray
Copy link

cspray commented Sep 19, 2022

LGTM 👍

As verified by a coverage report, phpdbg is not
reporting correct coverage for `array_map()` here,
and is skipping coverage for the closure inside
both log processors.

In turn, that leads to uncovered mutants being
reported, but that is not the case.
Squished some mutants in between: the reason why
mutants were uncovered is that closures were not
being covered at all. Replacing the closures with
PHP 8.1 short closure declarations fixes this,
working around the coverage issue.
@Ocramius Ocramius changed the title Feature/log http responses Log HTTP requests/responses (only non-sensitive data) Sep 19, 2022
@Ocramius
Copy link
Member Author

🚢 as per @cspray's feedback.

I applied some coverage improvements too, while I was at it :)

@Ocramius Ocramius merged commit 1b61a5f into 1.19.x Sep 19, 2022
@Ocramius Ocramius deleted the feature/log-http-responses branch September 19, 2022 18:21
@Ocramius
Copy link
Member Author

Hmm, the logger doesn't seem to be in use:


In AssertException.php line 32:
                                        
  [Psl\Type\Exception\AssertException]  
  Expected "200", got "int".  

Ref: https://github.com/Roave/DocbookTool/actions/runs/3084714475/jobs/4987180006#step:4:13

Seems like the logger output doesn't make it to GitHub's STDERR at all?

@Ocramius
Copy link
Member Author

Ah, LOG_LEVEL=DEBUG should be used there

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.

2 participants