ocean icon indicating copy to clipboard operation
ocean copied to clipboard

[Docs] Add GitHub Actions workflow to trigger documentation sync on changes to port-app-config.yaml

Open kodjomiles opened this issue 7 months ago โ€ข 16 comments

User description

Description

What - Added GitHub Actions workflow to trigger documentation synchronization when integration configuration files change

Why - Automate the documentation sync process to ensure integration documentation stays up-to-date with configuration changes

How - Created a workflow that detects changes to port-app-config.yaml files in integrations and dispatches an event to the port-docs-sync repository

Type of change

  • [x] New feature (non-breaking change which adds functionality)
  • [x] Documentation (added/updated documentation)

Core testing checklist

N/A - This PR adds a GitHub Actions workflow for documentation synchronization

Integration testing checklist

N/A - This PR adds a GitHub Actions workflow for documentation synchronization

Preflight checklist

N/A - This PR adds a GitHub Actions workflow for documentation synchronization

Screenshots

N/A - GitHub Actions workflow addition

API Documentation

N/A - Uses GitHub Actions and repository dispatch events


PR Type

enhancement, documentation


Description

  • Add GitHub Actions workflow to trigger documentation sync.

  • Detect changes to port-app-config.yaml in integrations.

  • Dispatch event to port-docs repository on changes.


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
trigger-doc-sync.yml
Add GitHub Actions workflow for documentation sync trigger

.github/workflows/trigger-doc-sync.yml

  • Introduces a new GitHub Actions workflow.
  • Triggers on changes to
    integrations/**/.port/resources/port-app-config.yaml in main.
  • Uses tj-actions/changed-files to detect changed config files.
  • Dispatches a repository event to port-docs with relevant payload.
  • +32/-0ย  ย 

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • kodjomiles avatar May 21 '25 15:05 kodjomiles

    PR Reviewer Guide ๐Ÿ”

    Here are some key observations to aid the review process:

    โฑ๏ธย Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงชย No relevant tests
    ๐Ÿ”’ย Security concerns

    Sensitive information exposure:
    The workflow uses ${{ secrets.PORT_DOCS_SYNC_TOKEN }} which requires a GitHub token with appropriate permissions to trigger events in another repository. Ensure this token has the minimum required permissions and is properly secured. If this token has excessive permissions, it could potentially be misused if the workflow is compromised.

    โšกย Recommended focus areas for review

    Secret Exposure

    The workflow uses a secret token (PORT_DOCS_SYNC_TOKEN) for repository dispatch. Ensure this secret is properly configured in the repository settings and has appropriate permissions.

    token: ${{ secrets.PORT_DOCS_SYNC_TOKEN }}
    repository: ${{ github.repository_owner }}/port-docs-sync
    
    Error Handling

    The workflow lacks error handling for cases where the repository dispatch might fail or when the changed files detection doesn't work as expected.

    - name: Trigger docs sync
      uses: peter-evans/repository-dispatch@v2
      with:
        token: ${{ secrets.PORT_DOCS_SYNC_TOKEN }}
        repository: ${{ github.repository_owner }}/port-docs-sync
        event-type: sync-docs
        client-payload: '{"repository": "${{ github.repository }}", "commit_url": "${{ github.event.head_commit.url }}", "changed_files": ${{ toJSON(steps.changed-files.outputs.all_changed_files) }}}' 
    

    qodo-code-review[bot] avatar May 21 '25 15:05 qodo-code-review[bot]

    CI Feedback ๐Ÿง

    (Feedback updated until commit https://github.com/port-labs/ocean/commit/4ca9732302d8b1b4e7d5a4100fbb5496237e2d24)

    A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

    Action: check-title

    Failed stage: Check PR title convention [โŒ]

    Failure summary:

    The action failed because the PR title does not match the required convention. The PR title
    "[Workflow] Add GitHub Actions workflow to trigger documentation sync on changes to
    port-app-config.yaml" does not follow the expected format.

    The action expects PR titles to start with specific prefixes in square brackets, such as:

  • [Integration]
  • [Core]
  • [Docs]

    The prefix "[Workflow]" used in the current PR title is not among the accepted prefixes.
  • Relevant error logs:
    1:  ##[group]Runner Image Provisioner
    2:  Hosted Compute Agent
    ...
    
    47:  [36;1m  exit 1[0m
    48:  [36;1melse[0m
    49:  [36;1m  echo "PR title matches the required convention."[0m
    50:  [36;1mfi[0m
    51:  shell: /usr/bin/bash -e {0}
    52:  env:
    53:  PR_TITLE: [Workflow] Add GitHub Actions workflow to trigger documentation sync on changes to port-app-config.yaml
    54:  ##[endgroup]
    55:  PR title does not match the required convention.
    56:  Examples of acceptable titles:
    57:  [Integration] Resolve missing team context in board ingestion for non-default teams
    58:  [Core] Ensure ingestion of integration logs
    59:  [Core] Upgrade FastAPI version to improve performance and compatibility
    60:  [Docs] Correct documentation on Ocean's denial-of-service vulnerability in http-proxy-middleware
    61:  [Integration] Enable region-specific resource querying support
    62:  ##[error]Process completed with exit code 1.
    63:  Cleaning up orphan processes
    
    

    qodo-code-review[bot] avatar May 21 '25 15:05 qodo-code-review[bot]

    PR Code Suggestions โœจ

    No code suggestions found for the PR.

    qodo-code-review[bot] avatar May 21 '25 15:05 qodo-code-review[bot]

    This pull request is automatically being deployed by Amplify Hosting (learn more).

    Access this pull request here: https://pr-1675.d1ftd8v2gowp8w.amplifyapp.com

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15165706477/artifacts/3169688503

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15165780964/artifacts/3169707294

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15165768610/artifacts/3169715286

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15165975790/artifacts/3169778356

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15166118949/artifacts/3169833434

    Code Coverage Total Percentage: 80.64%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15166353775/artifacts/3169921032

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15166407082/artifacts/3169947627

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15166467651/artifacts/3169957644

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15166455451/artifacts/3169960909

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 15:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15173516557/artifacts/3172667165

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 22:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15173514542/artifacts/3172670479

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 22:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15173597578/artifacts/3172699102

    Code Coverage Total Percentage: 80.65%

    github-actions[bot] avatar May 21 '25 22:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15300660525/artifacts/3212623766

    Code Coverage Total Percentage: 80.67%

    github-actions[bot] avatar May 28 '25 13:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15302813994/artifacts/3213431849

    Code Coverage Total Percentage: 80.67%

    github-actions[bot] avatar May 28 '25 14:05 github-actions[bot]

    Code Coverage Artifact ๐Ÿ“ˆ: https://github.com/port-labs/ocean/actions/runs/15325113630/artifacts/3221014342

    Code Coverage Total Percentage: 81.29%

    github-actions[bot] avatar May 29 '25 13:05 github-actions[bot]