Description
While reviewing update-docs-in-website.yml, I noticed that the workflow automatically creates a PR in the asyncapi/website repository whenever generator documentation changes on master.
The workflow currently:
Checks out the Generator repository.
Checks out the Website repository.
Creates a new branch using the Generator commit SHA.
Copies the latest Generator documentation into the Website repository.
Pushes the branch.
Creates a PR in the Website repository.
This raises a potential issue when multiple documentation changes are pushed to master in a short period of time.
For example:
Generator commit A
↓
Workflow A starts
Generator commit B
↓
Workflow B starts
Both workflows can potentially create
separate Website PRs
The PR created from commit A could become outdated once commit B is available.
Discussion
Would it make sense to add a mechanism to prevent redundant or outdated documentation update runs/PRs?
Possible approaches could include:
workflow-level concurrency to cancel outdated runs;
detecting and updating an existing documentation PR instead of creating a new one;
another mechanism for ensuring that only the latest Generator documentation update is proposed to the Website repository.
I haven't implemented a solution yet because this workflow performs changes in another repository, so I think the expected behavior should be agreed upon before choosing the implementation.
I'd appreciate feedback on the preferred approach.
Description
While reviewing update-docs-in-website.yml, I noticed that the workflow automatically creates a PR in the asyncapi/website repository whenever generator documentation changes on master.
The workflow currently:
Checks out the Generator repository.
Checks out the Website repository.
Creates a new branch using the Generator commit SHA.
Copies the latest Generator documentation into the Website repository.
Pushes the branch.
Creates a PR in the Website repository.
This raises a potential issue when multiple documentation changes are pushed to master in a short period of time.
For example:
Generator commit A
↓
Workflow A starts
Generator commit B
↓
Workflow B starts
Both workflows can potentially create
separate Website PRs
The PR created from commit A could become outdated once commit B is available.
Discussion
Would it make sense to add a mechanism to prevent redundant or outdated documentation update runs/PRs?
Possible approaches could include:
workflow-level concurrency to cancel outdated runs;
detecting and updating an existing documentation PR instead of creating a new one;
another mechanism for ensuring that only the latest Generator documentation update is proposed to the Website repository.
I haven't implemented a solution yet because this workflow performs changes in another repository, so I think the expected behavior should be agreed upon before choosing the implementation.
I'd appreciate feedback on the preferred approach.