Skip to content

IBX-9904: Workflow to build API refs into new PR #2723

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adriendupuis
Copy link
Contributor

Question Answer
JIRA Ticket IBX-9904
Versions 5.0, 4.6
Edition Commerce

Create a workflow that can be triggered to build

  • PHP API Reference on 4.6 and 5.0
  • REST API Reference on 5.0

On ibexa/commerce-skeletonhttps://github.com/ibexa/commerce-skeleton/blob/master/.github/workflows/ can then be added a workflow like the following:

name: 'PHP & REST API References'

on:
    push:
        tags:
            - 'v*'

jobs:
    trigger-api-refs-build:
        name: 'Build API references'
        runs-on: ubuntu-latest
        steps:
          - uses: octokit/[email protected]
            name: "Trigger API references' build"
            with:
                repository: ibexa/documentation-developer
                workflow: 'api_refs.yaml'
                ref: ${{ github.ref_name }}
                route: POST /repos/{repository}/actions/workflows/{workflow}/dispatches
                inputs: '{ "version": "${{ github.ref_name }}" }'
            env:
                GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }}

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Copy link

Preview of modified files: no change to preview.

Comment on lines +6 to +9
version:
description: 'Released version'
required: true
type: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not used to build the references, only to create the branch.

  • The script could evolve to receive version as an argument instead of alway building for the latest version (Is there a need for building old references?).
  • Or just rename the inputs being renamed to avoid ambiguity (my favorite).
Suggested change
version:
description: 'Released version'
required: true
type: string
branch_suffix:
description: "Used in branch name to open PR for the latest version's references"
required: true
type: string

@adriendupuis adriendupuis changed the title Draft workflow to open API refs PR IBX-9904: Workflow to build API refs into new PR Apr 30, 2025
uses: actions/checkout@v4

- name: Build API Refs
# TODO: On 5.0, update tool to handle both PHP & REST APIs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To do this, few lines can be added to the 5.0 version of phpdoc.sh:

$PHP_BINARY bin/console ibexa:openapi --yaml > openapi.yaml
redocly build-docs openapi.yaml --output $(realpath $OUTPUT_DIR/../../rest_api/rest_api_reference/rest_api_reference.html)

Anyway, the tool should be renamed and reworked to reflect its new task of building both references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant