refactor: use local git operations for commit data#294
Conversation
✅ Deploy Preview for staging-tansu ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tansu canceled.
|
|
#271 was just merged 🎉 This can be resumed. |
|
@Septimus4 OnlyDust is closing shop. I sent you another reward now for what you did before and this. I suggest you take out quickly until you still can. |
|
@tupui okay noted thank you |
37c785d to
7e0e659
Compare
|
@tupui here is a full v1, the main issue is that the first time we open a project the loading is on the slow side, especially for metrics, so I cache them for 5min with a in memory cache. I can work on a smarter cache or we can have a totally different startegy. |
|
A 5 mins caching sounds good to start with. I am not sure about a different strategy for now so we can start like that. |
|
should we also put a upper bound limit on how many repo can be cached at the same time ? |
|
Makes sense. Something like 10 is enough I think. But at the same time users would have to open many repos in less than 5 mins. You really need to want to do that 😅 |
|
Or do you mean by that that the solution requires a sort of backend?? Because I would want that the git clone is done on the user side. We don't want a backend as the only other place with a backend is the IPFS token and I will eventually move that to a cloudflare worker. |
|
My understanding is that you can't have a fully static site that clones a repo. I need to make more research to see if there is a simple solution but from a rapid goodle search + Chatgpt you need a more complex flow. Cloudflare Worker proxy:
Client-only cloning: The main limitation since the browser is doing the cloning and you need valid CORS. Having a cors proxy kind of defeats the initial idea, you only support whitelisted domains so not very agnostic, and you have complex setup of Filesystem in the browser. But let me make some in depth research to make sure there is no light solution possible |
|
Thanks 🙏 otherwise we could start with some allow list or have a proxy on cloudflare for that. |
|
From my research, it should be possible to fetch publicly available repositories from any provider that supports the Git Smart HTTP protocol and exposes endpoints with permissive or flexible CORS policies. Providers to Support in v1
Implementation Plan (v1)
|
|
Great to read! |
|
Hey 👋 just checking, did you get any time to make some progress? |
|
Yes I have a branch locally with the implementation, I need to test it more fix some edge cases, but I will open the PR this weekend |
|
Awesome, thanks for the update 🚀 |
- Add ALLOWED_GIT_HOSTS allow list to local git API (github, gitlab, bitbucket, codeberg, etc.) - Support additional hosts via GIT_ALLOWED_HOSTS environment variable - Create git-proxy Cloudflare Worker as alternative to local API - Add PUBLIC_GIT_PROXY_URL environment variable to switch between local API and Cloudflare proxy - Worker supports GitHub, GitLab, Bitbucket, Codeberg APIs with unified interface - Add CORS and security controls to both local and proxy implementations
d925326 to
a0e1879
Compare
👷 Deploy request for tansu pending review.Visit the deploys page to approve it
|
❌ Deploy Preview for staging-tansu failed. Why did it fail? →
|
|
Nice to see some movement :) |
|
Do you have some updates @Septimus4? This could be part of the new Wave program. |
|
I am close to initial testing, if it goes well it could be ready soon. It should, but I will only be certain when I run it end to end. It's more change that I initally imagined. |
|
Awesome 🙌 |
|
Hey 👋 any updates? |

Migrate from Github API to a agnostic git implementation, just clone and build the necessary data
Draft, I will update when #271 is merged