You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a potential race condition with the "'publish-pages" job I added to GitHub actions in #184.
The danger occurs when there are multiple pushes (i.e. merged PRs) to the "main" branch in close succession. I added concurrency to the publishing job to prevent overlapping deployments to the web site. I think this makes sense because overlapping deployments could interfere with one another, causing corruption to the deployed web content.
However, there is no guarantee that the latest push will be published. Consider the following scenario when two PRs are merged in close succession:
PR 1 is merged first, GitHub actions starts running
PR 2 is merged next, GitHub actions starts running
PR 2 happens to reach the "publish-pages" job first, and deploys
PR 1 waits for PR 2 to complete, and then it executes "publish-pages"
As a result, changes from PR 2 are not published to the web site.
It seems like this could be fixed by adding an if condition to the "publish-pages" job which skips the job unless the SHA of the "push" event that triggers the workflow is currently the head of the "main" branch.
I'm not much of an expert in GitHub actions. @oddhack or @outofcontrol do you happen to know this stuff better? Is the solution I suggest the right way to fix this?
The text was updated successfully, but these errors were encountered:
On Mon, Apr 01, 2024 at 10:09:33AM -0700, Greg Lueck wrote:
I'm not much of an expert in GitHub actions. @oddhack or @outofcontrol do you happen to know this stuff better? Is the solution I suggest the right way to fix this?
I do not know it better, but will be interested in what you learn.
I think there is a potential race condition with the "'publish-pages" job I added to GitHub actions in #184.
The danger occurs when there are multiple pushes (i.e. merged PRs) to the "main" branch in close succession. I added
concurrency
to the publishing job to prevent overlapping deployments to the web site. I think this makes sense because overlapping deployments could interfere with one another, causing corruption to the deployed web content.However, there is no guarantee that the latest push will be published. Consider the following scenario when two PRs are merged in close succession:
As a result, changes from PR 2 are not published to the web site.
It seems like this could be fixed by adding an
if
condition to the "publish-pages" job which skips the job unless the SHA of the "push" event that triggers the workflow is currently the head of the "main" branch.I'm not much of an expert in GitHub actions. @oddhack or @outofcontrol do you happen to know this stuff better? Is the solution I suggest the right way to fix this?
The text was updated successfully, but these errors were encountered: