Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fixed issue with pushing project to empty GitHub repo #9086

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

barankyle
Copy link
Member

@barankyle barankyle commented Oct 18, 2023

Summary

Backend code was trying to delete an empty repo and then crete it with auto_init set to true. This needs the admin GH scope, though, which is not requested. Changed this to creating a dummy readme file instead.

Fixed bug in edit ProjectsPage that was not refreshing the installed projects on project patch. This was causing projects that were patched to have a GitHub repo link to not have their options updated to reflect that.

🤖 Generated by Copilot at 7575cf5

This pull request refactors the resource and project management features of the client and server packages to use the new Engine class and to handle some edge cases. It also updates the uploadToRepo function to avoid deleting and recreating GitHub repositories.

References

closes #9081 #9082

Explanation

🤖 Generated by Copilot at 7575cf5

  • Refactored the resource management logic to use Engine.instance.api instead of API.instance.client in the client components (link, link, link, link, link)
  • Updated the project schema import to use the same definition as the server in ProjectsPage.tsx (link)
  • Added a useEffect hook to listen to the patched event of the project service and update the installed projects list in ProjectsPage.tsx (link)
  • Modified the uploadToRepo function to handle the empty repository case by creating a dummy README.md file in github-helper.ts (link)
  • Filtered the project permissions by the type owner when fetching the project owners in the project service hook in project.ts (link)

🤖 Generated by Copilot at 7575cf5

Sing, O Muse, of the valiant deeds of the code warriors
Who reforged the ProjectService with the mighty Engine
And tamed the GitHub beast with cunning and skill
And made the projects shine with harmony and grace

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

Backend code was trying to delete an empty repo and then crete it with auto_init
set to true. This needs the `admin` GH scope, though, which is not requested.
Changed this to creating a dummy readme file instead.

Fixed bug in edit ProjectsPage that was not refreshing the installed projects on
project patch. This was causing projects that were patched to have a GitHub repo
link to not have their options updated to reflect that.
@barankyle barankyle added this pull request to the merge queue Oct 31, 2023
Merged via the queue into dev with commit 1255ec7 Oct 31, 2023
13 of 14 checks passed
@barankyle barankyle deleted the 9081-fix-empty-github-push branch October 31, 2023 17:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants