Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected error when exporting to Github #1367

Closed
henriqueiamarino opened this issue May 7, 2024 · 14 comments · Fixed by #1392
Closed

Unexpected error when exporting to Github #1367

henriqueiamarino opened this issue May 7, 2024 · 14 comments · Fixed by #1392
Assignees

Comments

@henriqueiamarino
Copy link

I am having the following error while trying to export a theme update to Github:
"There was an unexpected error (Not Found); please try again. If the problem persists, please report it at https://github.com/WordPress/wordpress-playground/issues."

This is ultimately blocking my use of Playground for now.

Screenshot 2024-05-06 at 10 28 41
@brandonpayton brandonpayton self-assigned this May 8, 2024
@brandonpayton brandonpayton added [Type] Bug An existing feature does not function as intended [Feature] GitHub integration [Feature] Import Export labels May 8, 2024
@brandonpayton
Copy link
Member

brandonpayton commented May 8, 2024

Hi @henriqueiamarino, I am planning to look at this later today.

@brandonpayton
Copy link
Member

I have not yet been able to reproduce this issue. I was able to successfully create a PR for a readme change to upsidedown:
Automattic/themes#7791

@henriqueiamarino would it be possible for you to export a zip of your upsidedown changes within Playground and add it to this issue? That way, we can try creating a PR with your exact changes.

@henriqueiamarino
Copy link
Author

henriqueiamarino commented May 9, 2024

Hey @brandonpayton, thanks for your help.
Well, Playground is in very poor condition here. When I use the Browser on the Storage type, I get errors such as these.
Screenshot 2024-05-09 at 12 22 47

If I try Learn more about troubleshooting WordPress, I get this:
Screenshot 2024-05-09 at 12 23 20

If I choose to go default with Storage type: None, the page refreshes as I try to export to GitHub, and I lose all my work. I don't know if it is related to permissions or anything else, but I can't use it anymore.

@henriqueiamarino
Copy link
Author

Here is the zip file to replace the current theme on the PR if you would like to create it yourself.
upsidedown.zip

@adamziel
Copy link
Collaborator

adamziel commented May 9, 2024

Browser storage-wise, I'm very aware. Solving this problem will open a lot of doors for Playground and I want to get it going soon. It's the same conundrum as running Blueprints on an existing WordPress instance.

@brandonpayton
Copy link
Member

@henriqueiamarino, thank you for the zip of the theme changes. It's nice to have that. Unfortunately, I still haven't been able to reproduce the issue.

A couple things might help us move forward here:

  1. Would you be up for providing a full Playground zip with your changes, so we can import it into Playground and see exactly what you are seeing? That zip can be obtained using the same upper-right menu as the GitHub export.
Screenshot 2024-05-09 at 5 54 20 PM
  1. Would you be up for meeting and doing a screen share to see if we can debug this issue together?

@brandonpayton
Copy link
Member

Well, Playground is in very poor condition here. When I use the Browser on the Storage type, I get errors such as these.

Sorry, that is really painful. It is possible the error is due to conflict with PHP resources already stored in Browser storage. One thing that might help when switching to Browser storage is to "Delete Stored Data and Start Fresh".

Screenshot 2024-05-09 at 6 17 02 PM

If I default with Storage type: None, the page refreshes as I try to export to GitHub, and I lose all my work. I don't know if it is related to permissions or anything else, but I can't use it anymore.

This is actually expected behavior when not yet authenticated with GitHub. I missed it initially, but there is a big bold message that says work will be lost and asks the user to export Playground to a zip that can be restore later before exporting.

Screenshot 2024-05-09 at 6 09 56 PM

It is awkward user experience, but when we get this message, I believe the current solution is to:

  1. Close the dialog
  2. Use the upper right menu to download a zip of the current Playground state
  3. Use the upper right menu to begin exporting to GitHub PR again
  4. Authenticate with GitHub which refreshes the page
  5. Close the export dialog again if it is open
  6. Use the upper right menu to import the zip downloaded earlier
  7. Use the upper right menu to export to GitHub PR

@adamziel
Copy link
Collaborator

It is awkward user experience,

@brandonpayton it is awkward! We should be able to automate the export / import process and get rid of that modal. If we get another domain name, we should also be able to store GitHub token for later and ditch the requirement of connecting to GitHub every single time – right now it's all the same site and there's no way of persisting the GitHub token without exposing it to the embedded Playground.

@henriqueiamarino
Copy link
Author

henriqueiamarino commented May 13, 2024

@brandonpayton, replying to this:

It is awkward user experience, but when we get this message, I believe the current solution is to:

The current menu option, Export Pull Request to GitHub, can be confusing for users. I propose changing it to Connect your GitHub account or having a Connect option active on top of a disabled Export to address this issue.
As we are forcing users to export and import (start over) their work after the GH connection, they are still a bit far from the export task.

Would you be up for meeting and doing a screen share to see if we can debug this issue together?

As we work in very different time zones, I'll record a video of my tests and share it with you soon. Thanks.

@beafialho
Copy link

👋 I am also getting the same error message when trying to export the Upsidedown PR to Github:

Captura de ecrã 2024-05-14, às 09 32 50

@henriqueiamarino
Copy link
Author

Hey @brandonpayton, as I mentioned, here's my screen recording of the errors mentioned.
As I was not sure how to share it, I put it in a public folder of my personal Dropbox.

https://www.dropbox.com/scl/fo/7pmb6ix3slgub84jfzz8f/APqlKBgobS5ZLmd7ydnrcu0?rlkey=u4jqhc0rxk18x58xehm79ha3h&st=ldbssgxc&dl=0

@bgrgicak
Copy link
Collaborator

Related issue #1334

adamziel added a commit that referenced this issue May 14, 2024
…stream repo isn't allowed

When the GitHub export flow used a forked repository, it would still
attempt to create a branch in the upstream repository. This resulted in
the following cryptic error:

> There was an unexpected error (Not Found), please try again. If the
> problem persists, please report it at https://github.com/WordPress/
> wordpress-playground/issues.

This PR ensures that branch is created in the push target

 ## Testing instructions

1. Import an `upsidedown` theme from https://github.com/Automattic/themes
2. Run `await
   playground.writeFile('/wordpress/wp-content/themes/upsidedown/test.txt',
   'test');` in devtools
3. Try to export the changes as a PR, confirm a PR got created

Closes #1367
@adamziel
Copy link
Collaborator

#1392 might fix it 🤞

adamziel added a commit that referenced this issue May 14, 2024
…stream repo isn't allowed (#1392)

When the GitHub export flow used a forked repository, it would still
attempt to create a branch in the upstream repository. This resulted in
the following cryptic error:

> There was an unexpected error (Not Found), please try again. If the
> problem persists, please report it at https://github.com/WordPress/
> wordpress-playground/issues.

This PR ensures that branch is created in the push target

 ## Testing instructions

1. Import an `upsidedown` theme from
https://github.com/Automattic/themes
2. Run `await
playground.writeFile('/wordpress/wp-content/themes/upsidedown/test.txt',
'test');` in devtools
3. Try to export the changes as a PR, confirm a PR got created

Closes #1367
@adamziel
Copy link
Collaborator

I'll reopen until @henriqueiamarino confirms it works

@adamziel adamziel reopened this May 14, 2024
adamziel added a commit that referenced this issue May 15, 2024
…stream repo isn't allowed (#1392)

When the GitHub export flow used a forked repository, it would still
attempt to create a branch in the upstream repository. This resulted in
the following cryptic error:

> There was an unexpected error (Not Found), please try again. If the
> problem persists, please report it at https://github.com/WordPress/
> wordpress-playground/issues.

This PR ensures that branch is created in the push target

 ## Testing instructions

1. Import an `upsidedown` theme from
https://github.com/Automattic/themes
2. Run `await
playground.writeFile('/wordpress/wp-content/themes/upsidedown/test.txt',
'test');` in devtools
3. Try to export the changes as a PR, confirm a PR got created

Closes #1367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
5 participants