Implement Git and GitHub StorageRoot backends with access control #245
+1,248
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds Git and GitHub repository backends to the storage system, enabling version-controlled data storage with optional access control through GitHub's collaborator API.
Implementation
Git StorageRoot (
storage/git.nw)StorageRoot, handles local and remote repositories~/.cache/nytid/git-repos/, uses local paths in-placecommit_changes(), skips push when no remote configuredNotImplementedErrorfor access control (directs users to GitHub backend)GitHub StorageRoot (
storage/github.nw)git.StorageRootwith collaborator management via GitHub REST APIgrant_access(user, permission)adds collaborators withpull/push/adminpermissionsrevoke_access(user)removes collaboratorsGITHUB_TOKENenvironment variable or constructor parameterIntegration (
storage/init.nw)open_root()detects GitHub URLs via@github,://github,/githubpatterns.gitURLs, local filesystem otherwiseUsage
Testing
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)mygithubproject.com/usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED cp /tmp�� py git.nw > git.py && noroots git.nw && black git.py kpsewhich tualenvs/nytid-8X3FfPdf-py3.12/bin/pytest(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.