WordPress / gutenberg.run

Gutenberg live branch preview provisioning service
https://playground.wordpress.net/gutenberg.html.
MIT License
25 stars 6 forks source link

Tested PR and then a few hours later tested again. Showing the same version 1 PR build. #11

Closed paaljoachim closed 3 years ago

paaljoachim commented 3 years ago

Hey Andrew

I have been testing this PR: https://github.com/WordPress/gutenberg/pull/21859 Then a few hours later I tested it again and expected the changes the developer made to the PR to be reflected in gutenberg.run. But I was not able to see the changes that were made.

Example version one contained showing 10 tags. The next version I tested were to show 20 tags, but I only noticed the 10 tags listed.

Thank you Andrew! Have a great weekend!

aduth commented 3 years ago

I think the issue is that the branch had merge conflicts with master. The commit it was using (https://github.com/wordpress/gutenberg/commit/1ed9407bd295a58288f3336b1989c8a6cb238650) was indeed outdated and did not contain the updated 20 tags. I manually resolved the conflicts on the branch and it appears it's using the corrected commit now (https://github.com/wordpress/gutenberg/commit/617f4fdbc3bc1d8d130a5c8a321f28eb61083a2e).

For context, Gutenberg Run tries to use the merge_commit_sha property from the GitHub API's payload response for the given pull request:

https://github.com/aduth/gutenberg.run/blob/8788d5fde446dde76e11c1be5057568e4e4a3fff/web/static/run.js#L193-L199

Relevant API docs: https://developer.github.com/v3/pulls/#get-a-pull-request

I suppose when there's a merge conflict like this, the merge commit is not possible, so may not accurately reflect the current state of the branch.

A better alternative may be to use the head.sha property, but this is pinned to the repository at which the branch is created. This is a bit trickier to handle in the case of forks, since currently Gutenberg Run is set up to check out from the main repository.

In the meantime, I think it could be a rule of thumb that Gutenberg Run will only reflect the changes which can be merged to master without conflict.

And in this case, I believe the pull request in question should be working again.

paaljoachim commented 3 years ago

Thank you very much, Andrew! It is very much appreciated!

paaljoachim commented 3 years ago

Btw I went to test the PR 21859 at gutenberg.run but I am noticing that it goes very slow and multiple times just stops up and goes back to start. I will try again later on and see if it works better then.