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

GitHub Integration: Allow new themes/plugins to be exported in a PR #1334

Closed
mikachan opened this issue Apr 26, 2024 · 12 comments
Closed

GitHub Integration: Allow new themes/plugins to be exported in a PR #1334

mikachan opened this issue Apr 26, 2024 · 12 comments
Assignees
Labels
[Feature] GitHub integration [Type] Bug An existing feature does not function as intended

Comments

@mikachan
Copy link
Member

Currently, when trying to create a PR for a theme that doesn't exist in the target GitHub repo, you see this error:

There was an unexpected error (Object does not exist), please try again.

image

It would be amazing if you could add new themes (and plugins) to a Playground instance in order to export them in a PR like above.

I originally thought this was related to #1296, but I think this is now more of an enhancement rather than a bug 😄

@mikachan
Copy link
Member Author

Actually, I'm also seeing the same error when I try to create a PR for an existing theme (e.g. upsidedown):

image

I'm not sure if I'm doing something wrong, maybe the way I've formatted the repo URL or the path where the change should be committed?

@adamziel adamziel added this to the Zero Crashes milestone Apr 29, 2024
@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Feature] GitHub integration labels Apr 29, 2024
@bgrgicak
Copy link
Collaborator

Duplicate of #1367

@bgrgicak bgrgicak marked this as a duplicate of #1367 May 14, 2024
@adamziel adamziel closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
@mikachan
Copy link
Member Author

Hi @bgrgicak 👋 I don't think this is a duplicate of #1367, this issue was about creating a new theme or plugin via the GitHub integration. I'm currently still seeing this error when I try to add a new theme:

image

@adamziel adamziel reopened this Jun 25, 2024
@bgrgicak
Copy link
Collaborator

I don't think this is a duplicate of #1367, this issue was about creating a new theme or plugin via the GitHub integration. I'm currently still seeing this error when I try to add a new theme:

Sorry I assumed it was the same root cause so I closed it. It's open now.

@mikachan
Copy link
Member Author

Sorry I assumed it was the same root cause so I closed it. It's open now.

No worries, thank you!

@bgrgicak
Copy link
Collaborator

bgrgicak commented Jul 1, 2024

@mikachan I tested this today and it seems to work for me. Could you please try it again and let me know if it works for you?

What I did:

  • created a new empty repository
  • opened Playground and connected to GitHub in the export modal
  • filled in the export form and clicked export
  • after the loader stopped I to the PR created message

Is this what you would like to do or did I miss something?

@mikachan
Copy link
Member Author

mikachan commented Jul 1, 2024

Thanks for testing, @bgrgicak. I think your testing instructions are missing a step to create a new directory for a new theme or plugin within the Playground instance. These are the steps I'm following:

  1. Open Playground and install the Create Block Theme plugin
  2. Go to the Editor, click the spanner icon to open the Create Block Theme menu
  3. Click "Create Blank Theme". This creates a new theme and therefore a new directory in the wp-content/themes directory.
image
  1. Click "Export Pull Request to GitHub" from the Playground menu
  2. Connect my GitHub account (I can't get past this step during my testing today in Chrome, Firefox or Safari)
  3. On the next step, I'd usually say that I'd like to export a theme, type in the new theme directory name (in my case I'm using "test01"), and then set the a8c themes repo as the repo URL: https://github.com/Automattic/themes
  4. This is when I see the "branch not found" error.

I hope this helps to test this!

@bgrgicak
Copy link
Collaborator

bgrgicak commented Jul 1, 2024

Thank you! I was able to recreate it, but when I click Create PR for a second time it works 😕

I will take another look at it to see why it fails sometimes.

@adamziel adamziel moved this from Done to Inbox in Playground Board Jul 1, 2024
@bgrgicak
Copy link
Collaborator

bgrgicak commented Jul 3, 2024

This is when I see the "branch not found" error.

The only way I was able to recreate this error is by creating a new repository and trying to export to it.
The reason for the error was that I didn't have permission to push to main.

Just to double check do you have permissions on that GitHub repository?
I have and it doesn't prevent me from creating PRs.

@bgrgicak bgrgicak self-assigned this Jul 3, 2024
@bgrgicak bgrgicak moved this from Inbox to Needs Triage/Our Reply in Playground Board Jul 3, 2024
@bgrgicak bgrgicak moved this from Needs Triage/Our Reply to Needs Author's Reply in Playground Board Jul 3, 2024
@mikachan
Copy link
Member Author

mikachan commented Jul 3, 2024

Thanks for testing this, @bgrgicak. I can see your tests worked in the themes repo, however, I'm still seeing the same error (Branch not found).

Just to double check do you have permissions on that GitHub repository?

Yeah, I'm a maintainer on that repo 🙈 I've just tried on a personal repo and it works fine there, so it definitely seems related to the a8c themes repo.

@beafialho or @henriqueiamarino, could you please check if you're able to add new themes via Playground now?

@beafialho
Copy link

Thank you for your work on this!

I just tried to submit a new theme to the themes repo and I believe it worked, here's what I'm seeing:

Captura de ecrã 2024-07-03, às 12 34 15

The only comment I have is if I select the option "Create a new PR", which I did, the default description could be "The Shore: add theme" instead of "Update theme the-shore".

@adamziel adamziel moved this to Inbox in Playground Board Jul 3, 2024
@bgrgicak
Copy link
Collaborator

bgrgicak commented Jul 5, 2024

I'm glad you got it working now! I will close this issue as it seems like there isn't anything for us to do.

The only comment I have is if I select the option "Create a new PR", which I did, the default description could be "The Shore: add theme" instead of "Update theme the-shore".

We can't do that today. We only have the folder name, to get the title we would need to parse it from the theme.
We would also need to detect if the theme exists to set add instead of update in the title.

I don't think that this is something we will have time to work on in the near future.

@bgrgicak bgrgicak closed this as completed Jul 5, 2024
@github-project-automation github-project-automation bot moved this from Inbox to Done in Playground Board Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] GitHub integration [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

No branches or pull requests

4 participants