open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
752 stars 186 forks source link

check for readable host id files before read #1400

Closed brettmc closed 1 month ago

brettmc commented 1 month ago

Check if files are readable before trying to read them. Also check whether kenv exists before executing it, since it complains when I run it locally on a non-BSD system.

Closes: #1397

netlify[bot] commented 1 month ago

Deploy Preview for opentelemetry-php canceled.

Name Link
Latest commit 8578505961f23d2f7567f6163c615228e69aa3bc
Latest deploy log https://app.netlify.com/sites/opentelemetry-php/deploys/670c47eb3bff20000863cd19
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.92%. Comparing base (cd8c0e3) to head (8578505). Report is 3 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/graphs/tree.svg?width=650&height=150&src=pr&token=OE661REHqm&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #1400 +/- ## ============================================ + Coverage 73.85% 73.92% +0.07% - Complexity 2672 2674 +2 ============================================ Files 386 386 Lines 7650 7652 +2 ============================================ + Hits 5650 5657 +7 + Misses 2000 1995 -5 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Ξ” | | |---|---|---| | [8.1](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.60% <100.00%> (+0.10%)` | :arrow_up: | | [8.2](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.70% <100.00%> (-0.12%)` | :arrow_down: | | [8.3](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.75% <100.00%> (+0.10%)` | :arrow_up: | | [8.4](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.77% <100.00%> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Ξ” | | |---|---|---| | [src/SDK/Resource/Detectors/Host.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400?src=pr&el=tree&filepath=src%2FSDK%2FResource%2FDetectors%2FHost.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL1NESy9SZXNvdXJjZS9EZXRlY3RvcnMvSG9zdC5waHA=) | `68.29% <100.00%> (+9.31%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) > `Ξ” = absolute (impact)`, `ΓΈ = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). Last update [cd8c0e3...8578505](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1400?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry).