Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Agnostic git v2 - #329

Closed
Septimus4 wants to merge 2 commits into
tupui:mainfrom
Septimus4:agnostic-git-v2
Closed

Agnostic git v2#329
Septimus4 wants to merge 2 commits into
tupui:mainfrom
Septimus4:agnostic-git-v2

Conversation

@Septimus4

@Septimus4 Septimus4 commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

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:

  • Updated logic in CreateProjectModal.tsx and ProjectCard.tsx to use a unified descriptor object from getAuthorRepo, supporting arbitrary repository hosts and storing richer repository info.
  • Refactored ProjectList.jsx to use parseRepositoryUrl and include repository descriptors in config data, allowing downstream components to access repository metadata regardless of host.

Migration from GitHub-specific to generic repository fields:

  • Replaced all usages of githubUrl with repositoryUrl in ReadMoreModal.tsx, ProjectInfo.astro, and related components, ensuring consistent interface for repository links, badges, and clone commands.

Repository service import standardization:

  • Changed imports from GithubService to RepositoryService in all relevant files (CommitHistory.jsx, LatestCommit.tsx, ReadMoreModal.tsx, ReadmeViewer.tsx, UpdateHashModal.tsx, and ProjectInfo.astro), centralizing repository interactions.

- 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.
@netlify

netlify Bot commented Oct 27, 2025

Copy link
Copy Markdown

Deploy Preview for tansu canceled.

Name Link
🔨 Latest commit 54cb203
🔍 Latest deploy log https://app.netlify.com/projects/tansu/deploys/68ff2d9d59daba000808a7e0

@netlify

netlify Bot commented Oct 27, 2025

Copy link
Copy Markdown

Deploy Preview for staging-tansu ready!

Name Link
🔨 Latest commit 54cb203
🔍 Latest deploy log https://app.netlify.com/projects/staging-tansu/deploys/68ff2d9d26b0c900086d3ea2
😎 Deploy Preview https://deploy-preview-329--staging-tansu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 83
Accessibility: 85
Best Practices: 92
SEO: 92
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@tupui

tupui commented Oct 30, 2025

Copy link
Copy Markdown
Owner

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.

@Septimus4

Copy link
Copy Markdown
Contributor Author

cloning any git url and then working with the clone
I can't find a way of doing that and keeping the application static. This would require a backend. and basically go the route of #294.

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.

@tupui

tupui commented Oct 31, 2025

Copy link
Copy Markdown
Owner

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.

@Septimus4

Copy link
Copy Markdown
Contributor Author

This is a full alternative, for the clone version we would need to consider having a backend, a cloud worker and redis for example.

@tupui

tupui commented Oct 31, 2025

Copy link
Copy Markdown
Owner

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.
For Redis, you want to do some caching for everyone? I am pretty sure cloudflare has a way to cache workers requests/responses. Because I don't want to add more centralisation points to the system.

@Septimus4

Copy link
Copy Markdown
Contributor Author

But I thought from your last message that you had found a way?

This is the way.

The worker is there for the clone and CORS policy.
The caching would be use to persist the metrics and avoid recloning and recomputing the metrics too often, we can imagine a TTL of 5min. If a repository metrics are have not been used the past 5 minutes we evict them (the TTL value could be finetune). I said Redis but of course any caching solution would do the job, I can check what Cloudflare offers.

I will check and update #294 with a cloudfare setup

@tupui

tupui commented Nov 3, 2025

Copy link
Copy Markdown
Owner

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.

@Septimus4

Septimus4 commented Nov 3, 2025

Copy link
Copy Markdown
Contributor Author

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.

@tupui

tupui commented Nov 30, 2025

Copy link
Copy Markdown
Owner

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.

@Septimus4

Copy link
Copy Markdown
Contributor Author

Yes sorry it's a busy time at work, but I will probably have time this weekend or next week.
Congrats for being on mainet, I will go have a look.

@tupui

tupui commented Dec 3, 2025

Copy link
Copy Markdown
Owner

No worries, thanks 🙏

@Septimus4 Septimus4 closed this Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants