Agnostic git v2 - #329
Conversation
- Replaced GitHubService with RepositoryService for commit history and readme fetching. - Introduced RepositoryDescriptor type to standardize repository information. - Updated ProjectList, CommitHistory, ContributionMetrics, and other components to utilize the new repository structure. - Enhanced URL parsing and repository descriptor creation for better flexibility. - Removed deprecated GitHubService and migrated all related functionality to RepositoryService. - Added unit tests for repository utility functions to ensure correct parsing and URL generation.
✅ Deploy Preview for tansu canceled.
|
✅ Deploy Preview for staging-tansu ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @Septimus4 I am not sure I understand this PR. This still calls the GitHub API right. The goal was to be agnostic by cloning any git url and then working with the clone. So #294 is better. |
This PR is is a inbetween solution, the app stays static and should enable support for any git providers that support the Git Smart HTTP protocol. |
|
Ok so you would want to have this get in before the other PR? Or that's a full alternative. Because I really want to push for the clone. |
|
This is a full alternative, for the clone version we would need to consider having a backend, a cloud worker and redis for example. |
|
But I thought from your last message that you had found a way? Why the need for the cloud worker and redis exactly? Is it to do the clone? If this is the case and there is no other way around ok sure. You can see in the repo that for IPFS I added a simple Cloudflare worker. You could do something similar. |
This is the way. The worker is there for the clone and CORS policy. I will check and update #294 with a cloudfare setup |
|
ok thanks, I think we are now on the same page 👍 For the caching we can have a reload button to force reload if a user really wants. That would do a cache eviction behind the scene (or we still force a 1 min TTL or something to guard against abuses). Caching can be set to higher value of like 15 mins at least IMO. |
|
I was thinking of a shorter TTL to keep cost low, more than for ux, usually repositories don't change much in these short time frames. But any way I will make the TTL easy to configure and update by conf or env. |
|
Hey 👋 any updates @Septimus4 ? We are mainnet now. I want to have a few things in before making a new update to the live version so we have a bit of time. It would be nice if we manage to get this in. |
|
Yes sorry it's a busy time at work, but I will probably have time this weekend or next week. |
|
No worries, thanks 🙏 |

This version supports:
GitHub|GitLab|Bitbucket|Gitea|Codeberg|Forgejo
The list should be easy to extend for any provider that supports git over https and has permissive CORS policy.
We can choose wich strategy we prefer, #294 or this one.
Repository abstraction and descriptor usage:
CreateProjectModal.tsxandProjectCard.tsxto use a unifieddescriptorobject fromgetAuthorRepo, supporting arbitrary repository hosts and storing richer repository info.ProjectList.jsxto useparseRepositoryUrland include repository descriptors in config data, allowing downstream components to access repository metadata regardless of host.Migration from GitHub-specific to generic repository fields:
githubUrlwithrepositoryUrlinReadMoreModal.tsx,ProjectInfo.astro, and related components, ensuring consistent interface for repository links, badges, and clone commands.Repository service import standardization:
GithubServicetoRepositoryServicein all relevant files (CommitHistory.jsx,LatestCommit.tsx,ReadMoreModal.tsx,ReadmeViewer.tsx,UpdateHashModal.tsx, andProjectInfo.astro), centralizing repository interactions.