Skip to content

update ipfs url #2047

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

update ipfs url #2047

wants to merge 3 commits into from

Conversation

fubhy
Copy link
Member

@fubhy fubhy commented Jun 6, 2025

No description provided.

Copy link

changeset-bot bot commented Jun 6, 2025

⚠️ No Changeset found

Latest commit: ea0e916

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

cloudflare-workers-and-pages bot commented Jun 6, 2025

Deploying graph-tooling with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea0e916
Status: ✅  Deploy successful!
Preview URL: https://888fca4f.graph-tooling.pages.dev
Branch Preview URL: https://update-ipfs-url.graph-tooling.pages.dev

View logs

@fordN
Copy link
Collaborator

fordN commented Jun 6, 2025

Looks like we'll also need to update the tests at ../packages/cli/src/command-helpers/compiler.test.ts.

@fubhy
Copy link
Member Author

fubhy commented Jun 6, 2025

Looks like we'll also need to update the tests at ../packages/cli/src/command-helpers/compiler.test.ts.

I reverted my changes to the test cases.

But after reading what's going on there I'm confused. This should not be a thing in the first place. Why would we magically rewrite some URLs and others not based on whether there's certain path segments in there or not.

That seems like a recipe for disaster / confusion. Just expect users to configure the right URL imo :-P

@fubhy
Copy link
Member Author

fubhy commented Jun 7, 2025

Ok.... Instead of just changing the URLs here, what we should really do is:

  1. Remove appendApiVersionForGraph
  2. Replace it with a function that validates the given URL

Validation logic:

  • Check that it's not one of the deprecated URLs (ipfs.testnet.thegraph.com/*, ipfs.network.thegraph.com/*, api.thegraph.com/ipfs)
  • Print a deprecation notice if the user is using one of the deprecated URLs
  • Automatically swap the URL to ipfs.thegraph.com (without the /ipfs/ path prefix)

This is not going to resolve the problem for users who won't upgrade their graph-cli dependency though, so we'll have to continue to support the legacy URLs for a while.

Who can tackle this? @YaroShkvorets? :-)

@YaroShkvorets
Copy link
Collaborator

Sorry out of the loop here. You are deprecating old E&N IPFS endpoints replacing them with https://ipfs.thegraph.com/ipfs/{cid}?

So you want the logic to be

  • if the user supplies their own IPFS endpoint use that endpoint
  • if the supplied endpoint is one of those being deprecated print deprecation notice and use the new endpoint
  • if IPFS endpoint is not provided use the new endpoint (or make it required?)

@fubhy
Copy link
Member Author

fubhy commented Jun 11, 2025

Sorry out of the loop here. You are deprecating old E&N IPFS endpoints replacing them with https://ipfs.thegraph.com/ipfs/{cid}?

So you want the logic to be

  • if the user supplies their own IPFS endpoint use that endpoint
  • if the supplied endpoint is one of those being deprecated print deprecation notice and use the new endpoint
  • if IPFS endpoint is not provided use the new endpoint (or make it required?)

Yeah. Exactly that. And no magic path substition logic (imo). That's a recipe for disaster.

Let's use the new one by default (not make it required).

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.

3 participants