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

Automate docs generation #6188

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from
Open

Conversation

pierlon
Copy link
Contributor

@pierlon pierlon commented May 8, 2021

Summary

See #5520

This PR allows one to manually trigger generating the documentation for any branch (that has this workflow file) on demand. Once merged, you will be able to do so by going to the Actions page and clicking on the "Plugin Documentation" workflow on the left. You should then see a notice informing you the workflow can be manually dispatched, with a "Run workflow" button on the right of the notice text. Clicking that button reveals a dropdown that allows one to choose the branch to run the workflow from. Here's an example of such a screen:

image

Once the workflow run is complete a PR will be created with the updated documentation changes. If there are no changes, no PR is created.

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@pierlon pierlon added the Infrastructure Changes impacting testing infrastructure or build tooling label May 8, 2021
@pierlon pierlon self-assigned this May 8, 2021
@pierlon pierlon force-pushed the enhancement/5520-docs-generation branch from 3c25c1b to 4cd77d6 Compare May 10, 2021 07:48
@@ -87,7 +87,6 @@ public function parse_files( $files, $root ) {
$out = [
'file' => $this->export_docblock( $file ),
'path' => str_replace( DIRECTORY_SEPARATOR, '/', $file->getFilename() ),
'root' => $root,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if this key is used anywhere.

With this change the the root key for each file object in the generated JSON file would no longer exist, preventing any unnecessary change to the JSON if it were generated in a different environment from where the docs command was previously run.

Comment on lines +79 to +80
git config user.email "[email protected]"
git config user.name "Pierre Gordon"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The github-actions bot isn't on the CLA allowlist so I'm using myself for now to make commits.

@pierlon pierlon marked this pull request as ready for review May 10, 2021 08:06
@pierlon pierlon added this to the v2.2 milestone May 10, 2021
@pierlon pierlon linked an issue May 10, 2021 that may be closed by this pull request
@pierlon
Copy link
Contributor Author

pierlon commented May 10, 2021

Examples of the PRs this workflow would generate: pierlon#11, pierlon#12.

@pierlon pierlon requested a review from westonruter June 14, 2021 20:12
@github-actions
Copy link
Contributor

github-actions bot commented Jun 14, 2021

Plugin builds for 68eb9ed are ready 🛎️!%0A- Download development build%0A- Download production build

if: steps.changes.outputs.changed == 1 && steps.remote-branch.outputs.exists == 0
run: |
git push -u origin "$HEAD_BRANCH"
gh pr create --base "$BASE_BRANCH" --title "Update documentation for \`$BASE_BRANCH\` branch" --body "" --label Documentation
Copy link
Member

Choose a reason for hiding this comment

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

Do the backticks not get evaluated? I guess not as seen in pierlon#12.

Copy link
Contributor Author

@pierlon pierlon Jun 16, 2021

Choose a reason for hiding this comment

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

Yes.

@westonruter westonruter self-assigned this Dec 2, 2021
@westonruter westonruter modified the milestones: v2.2, v2.3 Dec 3, 2021
@westonruter westonruter modified the milestones: v2.3, v2.4 Dec 23, 2021
@westonruter westonruter removed this from the v2.4 milestone Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Changes impacting testing infrastructure or build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants