graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

CLI exits with 0 even when graph deploy has failed

Open jaybuidl opened this issue 1 year ago • 4 comments

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

If graph deploy fails, it should exit with 1, so that the error can be reported or handled in a CI context (e.g. Github workflow), but it exits with 0 currently.

Reproduction

https://github.com/kleros/kleros-v2/actions/runs/7578013905/job/20639879509#step:13:120

Steps to Reproduce the Bug or Issue

  1. Run graph deploy --studio -l existingLabel
  2. Run echo $?

image

Expected behavior

If graph deploy fails, it should exit with 1, so that the error can be reported or handled in a CI context (e.g. Github workflow)

Screenshots or Videos

No response

Platform

  • OS: macOS
  • NodeJS: 16.20.2
  • @graphprotocol/graph-cli version(s): [0.64.1]

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

I have only looked at graph deploy with Studio, but other products or sub-commands might be affected too.

jaybuidl avatar Jan 19 '24 13:01 jaybuidl

One more report on Discord https://discord.com/channels/438038660412342282/438070183794573313/1207010623297290320

saihaj avatar Feb 13 '24 17:02 saihaj

One more report on Discord https://discord.com/channels/438038660412342282/438070183794573313/1207010623297290320

This was me, so I'm adding more information here.

Calling to

$ yarn graph deploy --studio <slug> --deploy-key <key> --version-label <label>

using a <label> that already exists will fail the deploy process

Build completed: QmcyuNXAXyBsFyk2buzzDxLUc8NTsws5SYAxRbGX8hDPmK

✖ Failed to deploy to Graph node https://api.studio.thegraph.com/deploy/: Version label already exists.
UNCAUGHT EXCEPTION: Error: EEXIT: 1
Done in 17.07s.

but when I call to check the exit code of that, it shows 0

$ echo $?
0

Currently I'm using

$ yarn -v
1.22.19

with the graph packages in my package.json as

"@graphprotocol/graph-cli": "^0.61.0",
"@graphprotocol/graph-ts": "0.30.0",

JamesEarle avatar Feb 13 '24 17:02 JamesEarle

+1 This is also affecting our CI/CD pipelines. Did you find a workaround?

mliu avatar Jun 05 '24 16:06 mliu

+1 same issue here

clemsos avatar Sep 13 '24 11:09 clemsos

+1, same issue

DJercic avatar Oct 03 '24 12:10 DJercic