Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ninety-balloons-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/graph-cli': patch
---

remove ipfs check for studio deploys
5 changes: 5 additions & 0 deletions .changeset/real-eggs-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/graph-cli': minor
---

Part of the Hosted Service migration throw an error when users are trying to use `hosted-service` product in `graph [auth|deploy|init]` commands.
1 change: 1 addition & 0 deletions packages/cli/src/command-helpers/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface CreateCompilerOptions {
outputDir: string;
outputFormat: string;
skipMigrations: boolean;
// TODO: Remove this is unused
blockIpfsMethods?: RegExpMatchArray;
protocol: Protocol;
}
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/src/commands/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export default class AuthCommand extends Command {
required: true,
}));

// Poor var naming will cleanup later
({ node } = chooseNodeUrl({ product: node, studio: false }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saihaj should this be here?


// eslint-disable-next-line -- prettier has problems with ||=
deployKey =
deployKey ||
Expand All @@ -68,6 +71,10 @@ export default class AuthCommand extends Command {
this.error('✖ Deploy key must not exceed 200 characters', { exit: 1 });
}

if (product === 'hosted-service' || node?.match(/api.thegraph.com/)) {
this.error('✖ The hosted service is deprecated', { exit: 1 });
}

try {
await saveDeployKey(node!, deployKey);
print.success(`Deploy key set for ${node}`);
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ export default class DeployCommand extends Command {
])
.then(({ product }) => product as string));

if (product === 'hosted-service') {
this.error('✖ The hosted service is deprecated', { exit: 1 });
}

const { node } = chooseNodeUrl({
product,
studio,
Expand Down Expand Up @@ -455,7 +459,7 @@ export default class DeployCommand extends Command {
outputDir,
outputFormat: 'wasm',
skipMigrations,
blockIpfsMethods: isStudio || undefined, // Network does not support publishing subgraphs with IPFS methods
blockIpfsMethods: undefined,
protocol,
});

Expand Down
9 changes: 9 additions & 0 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ export default class InitCommand extends Command {
} = flags;

initDebugger('Flags: %O', flags);

if (product === 'hosted-service') {
this.error('✖ The hosted service is deprecated', { exit: 1 });
}

let { node, allowSimpleName } = chooseNodeUrl({
product,
// if we are loading example, we want to ensure we are using studio
Expand Down Expand Up @@ -595,6 +600,10 @@ async function processInitForm(
},
]);

if (product == 'hosted-service') {
this.error('✖ The hosted service is deprecated', { exit: 1 });
}

const { subgraphName } = await prompt.ask<{ subgraphName: string }>([
{
type: 'input',
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/tests/cli/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ describe.sequential(
'--skip-git',
'--protocol',
'near',
'--product',
'hosted-service',
'--studio',
'--from-contract',
'app.good-morning.near',
'--network',
Expand Down