bonitasoft / bonita-documentation-site

The sources of the Bonita Documentation site
https://documentation.bonitasoft.com/
GNU General Public License v2.0
9 stars 5 forks source link

The PR preview on surge is displaying the content of another PR #741

Closed tbouffard closed 18 hours ago

tbouffard commented 2 days ago

I have recently discovered at least in 2 repositories that the preview of a PR may not be accurate.

bpi-doc

https://github.com/bonitasoft/bonita-process-insights-doc/pull/7

preview content

bpi-doc_pr-7_surge_content_pr-8_redacted

PR list

bpi-doc_pull_requests_list

bonita-doc

https://github.com/bonitasoft/bonita-doc/pull/2753

preview content

content of PR 2752 content of PR 2758
bonita-doc_pr-2753_surge_content-pr-2752_redacted bonita-doc_pr-2753_surge_content-pr-2758_redacted

PR list

bonita-doc_pull_requests_list

tbouffard commented 2 days ago

After having merged #742, I have been able to retrieve the site preview we deployed to surge.

In https://github.com/bonitasoft/bonita-process-insights-doc/actions/runs/9764393540, the uploaded content is site_bpi-doc_preview_deployed_PR-7_202407021811.zip which corresponds to the content of https://github.com/bonitasoft/bonita-process-insights-doc/pull/8 instead of the content of https://github.com/bonitasoft/bonita-process-insights-doc/pull/7

So, the artifact we download is wrong. The problem is probably in 👇đŸŋ We can try to change the configuration in the https://github.com/process-analytics/github-actions-playground/ (which is where we implement and test the reusable workflow)

https://github.com/bonitasoft/bonita-documentation-site/blob/422e1d1b6ccc09acd7a6913294dbde43858f63ba/.github/workflows/_reusable_surge-deploy-preview.yml#L17-L22

tbouffard commented 2 days ago

ℹī¸ This is a part of the investigation

The dawidd6/action-download-artifact currently only retrieve artifact from PR not created from fork, so for the 2 prs that are mentioned in the description of this issue, there is no change that the correct artifact is used.

This is confirmed by the execution run below and what is described in the issue The deployed content is always the content of a PR whose the branch is not from a fork

https://github.com/bonitasoft/bonita-process-insights-doc/actions/runs/9764393540/job/26952628097

Run dawidd6/action-download-artifact@v6
  with:
    workflow: 101287324
    name: site
    path: build/site
    github_token: ***
    workflow_search: false
    workflow_conclusion: success
    repo: bonitasoft/bonita-process-insights-doc
    name_is_regexp: false
    allow_forks: false
    check_artifacts: false
    search_artifacts: false
    skip_unpack: false
    if_no_artifact_found: fail
==> Repository: bonitasoft/bonita-process-insights-doc
==> Artifact name: site
==> Local path: build/site
==> Workflow name: 101287324
==> Workflow conclusion: success
==> Allow forks: false
==> Skipping run from fork: Yves-Jacq/bonita-process-insights-doc
==> Skipping run from fork: Yves-Jacq/bonita-process-insights-doc
==> Skipping run from fork: Yves-Jacq/bonita-process-insights-doc
==> Skipping run from fork: Yves-Jacq/bonita-process-insights-doc
==> Skipping run from fork: redfish4ktc/bonita-process-insights-doc
==> (found) Run ID: 9595444023
==> (found) Run date: 2024-06-20T09:59:30Z
==> Artifact: 1620147138
tbouffard commented 2 days ago

🎉 https://github.com/process-analytics/github-actions-playground/pull/363 shows how to fix the problem