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

Backend: Add backup repo #2673

Merged
merged 18 commits into from
Oct 16, 2024
Merged

Backend: Add backup repo #2673

merged 18 commits into from
Oct 16, 2024

Conversation

CalMWolfs
Copy link
Collaborator

@CalMWolfs CalMWolfs commented Oct 5, 2024

What

Adds backup repo to the build. This is automatically included in every gradle build, (only adds .5mb)

This uses the exact same logic as neu uses

This aims to solve problems for people who play somewhere that github blocks them from downloading the repo, as currently all they can do is disable auto-update and manually download the repo. This results in them getting many new errors each time they update their mod version.
Repo patterns are also forced to be local while using the backup repo to avoid the edge case of a release being built before the github action to update the repo patterns completes.

This pr can be tested by deleteing your repo folder, setting your repo branch to something that isnt real and starting the game. Reading the logs will show it didnt download but you will have no repo errors and the backup repo will be copied into the repo folder.

Changelog Improvements

  • Added backup Repo. - CalMWolfs
    • Added a backup repository, which provides a backup in case you are unable to download from GitHub. - CalMWolfs

Changelog Technical Details

  • Included backup repo in builds. - CalMWolfs

@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Oct 5, 2024
Copy link

github-actions bot commented Oct 5, 2024

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

# Conflicts:
#	src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
@hannibal002 hannibal002 added this to the Version 0.28 milestone Oct 5, 2024
Copy link

github-actions bot commented Oct 5, 2024

Conflicts have been resolved! 🎉

@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Oct 5, 2024
@CalMWolfs CalMWolfs added the Backend A backend pull request that will be merged soon label Oct 8, 2024
@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Oct 11, 2024
Copy link

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

@hannibal002 hannibal002 added the Soon This Pull Request will be merged within the next couple of betas label Oct 11, 2024
# Conflicts:
#	build.gradle.kts
#	buildSrc/build.gradle.kts
@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Oct 11, 2024
Copy link

Conflicts have been resolved! 🎉

Copy link
Owner

@hannibal002 hannibal002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to test his, ive renamed the host name github.com to something else inside RepoManager.kt and deleted my local repo.
This has worked, i can join skyblock and do not get error messages in chat.

But:
/shdebug does not show anything about that. It would be good if we somewhere store that the backup repo is in use, and indicate so in /shdebug.

Also, when running /shupdaterepo manually, i get an error message (as expected), but also the normal "updated successfully" message. maybe change the wording of that message to indicate that the internal backup repo is in use instead.
image

@CalMWolfs
Copy link
Collaborator Author

Also, when running /shupdaterepo manually, i get an error message (as expected), but also the normal "updated successfully" message. maybe change the wording of that message to indicate that the internal backup repo is in use instead.

This is nothing new with my pr, but i can fix it

@hannibal002
Copy link
Owner

patch to break github
Index: src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
--- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt(revision cb72825685b0f1670d77dc128a83aaf2025d4d53)
+++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt(date 1729079369334)
@@ -310,13 +310,13 @@
         val repoUser = config.location.user
         val repoName = config.location.name
         val repoBranch = config.location.branch
-        return "https://api.github.com/repos/$repoUser/$repoName/commits/$repoBranch"
+        return "https://api.notgithub.com/repos/$repoUser/$repoName/commits/$repoBranch"
     }
 
     private fun getDownloadUrl(commitId: String?): String {
         val repoUser = config.location.user
         val repoName = config.location.name
-        return "https://github.com/$repoUser/$repoName/archive/$commitId.zip"
+        return "https://notgithub.com/$repoUser/$repoName/archive/$commitId.zip"
     }
 
     @Throws(IOException::class)

@CalMWolfs
Copy link
Collaborator Author

Fixed some issues related to the backup repo and did the requested changes. Also removed the shdebug from the RepoManager file as there was already repo information gathered in the DebugCommand file

@hannibal002 hannibal002 merged commit e883d0c into hannibal002:beta Oct 16, 2024
4 checks passed
@github-actions github-actions bot removed Soon This Pull Request will be merged within the next couple of betas Backend A backend pull request that will be merged soon labels Oct 16, 2024
@CalMWolfs CalMWolfs deleted the backup-repo branch October 16, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants