feat(cli): add --publish-network flag to graph cli deploy#2146
Draft
nasmr wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: af497ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a
--publish-networkflag tograph deploy. When set, its value is forwarded to Studio's deployment router as thepublish_to_graph_networkparam of thesubgraph_deployJSON-RPC request. When the flag is omitted, the param is not included so existing deploy behavior is unchanged.Background
To support testing of indexing agreements on
arbitrum-sepolia(testnet for protocol), Studio's deployment-router needs to discern which protocol network to create the on-chain indexing agreement for once the subgraph deployment is created in Studio. Passing the flag will allow studio to identify if a subgraph deployment is targeting testnet if--publish-network arbitrum-sepoliais added tograph deploycommand, while defaulting toarbitrum-oneif the param is not added or passed with--publish-network arbitrum-oneChanges
packages/cli/src/commands/deploy.ts-- new--publish-networkstring flag (no default); its value is threaded into thesubgraph_deployparams aspublish_to_graph_network. When undefined,JSON.stringifydrops the key, matching how the existingdebug_forkparam behaves..changeset/deploy-publish-network.md-- minor version bump.Testing
This was tested by executing deploy command manually against local IPFS node and deployment-router, capturing the exact request body from the deployment router logs
Scenario 1:
--publish-network arbitrum-sepolia-> param presentScenario 2: flag omitted -> param absent
Also confirmed:
graph deploy --helplists the flag, andpnpm buildcompletes successfully with no error.