open-telemetry / opentelemetry-php

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

Workflow to publish phpdoc to github pages #1418

Closed svrnm closed 3 weeks ago

svrnm commented 4 weeks ago

Follow-up to #1378 and #1385:

I did some investigation how to best publish the API documentation for PHP. Initially I was hoping that we can serve these pages through netlify (the service we use to publish opentelemetry.io), unfrotunately I ran into some limitations in my experiment, that I could not resolve, see: https://github.com/open-telemetry/opentelemetry.io/pull/5413

Therefore I suggest to publish the pages to github via the workflow in this PR. This will create a page similar to

https://svrnm.github.io/opentelemetry-php/

(it will then be named https://open-telemetry.github.io/opentelemetry-php/)

We can then link this page from the website here: https://opentelemetry.io/docs/languages/#api-references and from within the navigation tree of the PHP language specific documentation.

Workflow run example:

https://github.com/svrnm/opentelemetry-php/actions/runs/11512969202/job/32048846572

cc @open-telemetry/docs-approvers

netlify[bot] commented 4 weeks ago

Deploy Preview for opentelemetry-php canceled.

Name Link
Latest commit 1b5a0b3312e28b64861c7d8969ed7a01064d7f3d
Latest deploy log https://app.netlify.com/sites/opentelemetry-php/deploys/671b3b96504491000823112e
codecov[bot] commented 4 weeks ago

Codecov Report

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

Project coverage is 73.55%. Comparing base (93f2068) to head (1b5a0b3). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418/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/1418?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 #1418 +/- ## ============================================ - Coverage 73.63% 73.55% -0.08% Complexity 2683 2683 ============================================ Files 387 387 Lines 7975 7975 ============================================ - Hits 5872 5866 -6 - Misses 2103 2109 +6 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418/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/1418/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.24% <ø> (-0.14%)` | :arrow_down: | | [8.2](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.50% <ø> (+0.02%)` | :arrow_up: | | [8.3](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.42% <ø> (-0.05%)` | :arrow_down: | | [8.4](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `73.45% <ø> (-0.01%)` | :arrow_down: | 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. [see 9 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418/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/1418?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/1418?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 [93f2068...1b5a0b3](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1418?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).
brettmc commented 3 weeks ago

@svrnm merged. The workflow looks to have completed successfully, but I don't see any generated pages.... https://github.com/open-telemetry/opentelemetry-php/actions/runs/11543950343

svrnm commented 3 weeks ago

@brettmc have you enabled GitHub pages in the repo settings?

brettmc commented 3 weeks ago

Screenshot from 2024-10-29 09-38-57 @svrnm yes, and it indicates that something was deployed there. But now that I'm looking more closely at the job output it looks like we've got a competing job which might be publishing junk and clobbering the output you've created. I can't find any evidence in our repo of what that job might be or where it's defined though :thinking:

brettmc commented 3 weeks ago

Oh, I think I found it. Pages are configured to auto-generate: Screenshot from 2024-10-29 10-10-46 I'll turn that off and see what happens...

brettmc commented 3 weeks ago

I also notice now that the new workflow file doesn't have an extension. I think .yaml or .yml extension is required?

svrnm commented 3 weeks ago

Thanks for investigating what the issue is!

I also notice now that the new workflow file doesn't have an extension. I think .yaml or .yml extension is required?

Oh yes, my bad! The issue is that I had to test the workflow on the main branch of my fork so I copied and pasted the final version into a branch but forgot the .yml 🤦‍♂️