Last active
August 24, 2022 10:14
-
-
Save EverlastingBugstopper/d6aa0d9a49bcf39f2df53e1cfb9bb88a to your computer and use it in GitHub Desktop.
Revisions
-
EverlastingBugstopper revised this gist
Sep 23, 2021 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -59,4 +59,11 @@ if [ $CHECK_SUCCESS = "false" ]; then echo $(_jq '.message') done fi CHECK_URL=$(echo $CHECK_OUTPUT | jq '.data.target_url') if [ $CHECK_URL != null ]; then echo "" echo "See more details in [Apollo Studio]($CHECK_URL)" fi echo "" -
EverlastingBugstopper revised this gist
Sep 23, 2021 . 1 changed file with 22 additions and 22 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,30 +6,35 @@ CHECK_OUTPUT=$(rover subgraph check my-graph --schema ./products.graphql --name CHECK_SUCCESS=$(echo $CHECK_OUTPUT | jq '.data.success') if [ $CHECK_SUCCESS = "true" ]; then echo "### Check Success" echo "" echo "#### Change Details" echo "" fi CHANGES=$(echo "${CHECK_OUTPUT}" | jq '.data.changes') if [ "$CHANGES" != "null" ]; then CHANGE_SIZE=$(echo "${CHECK_OUTPUT}" | jq -r '.data.changes | length') if [ "$CHANGE_SIZE" = "0" ]; then echo "No changes" fi if [ "$CHANGE_SIZE" != "0" ]; then echo "| Severity | Code | Description |" echo "| -------- | ---- | ----------- |" for CHANGE in $(echo "${CHECK_OUTPUT}" | jq -r '.data.changes[] | @base64'); do _jq() { echo ${CHANGE} | base64 -d | jq -r ${1} } CHANGE_SEVERITY=$(_jq '.severity') CHANGE_CODE=$(_jq '.code') CHANGE_DESCRIPTION=$(_jq '.description') echo "| $CHANGE_SEVERITY | $CHANGE_CODE | $CHANGE_DESCRIPTION |" done fi echo "" fi @@ -42,7 +47,7 @@ if [ $CHECK_SUCCESS = "false" ]; then echo "" for BUILD_ERROR in $(echo "${CHECK_OUTPUT}" | jq -r '.error.details.build_errors[] | @base64'); do _jq() { echo ${BUILD_ERROR} | base64 -d | jq -r ${1} } BUILD_ERROR_CODE=$(_jq '.code') if [ $BUILD_ERROR_CODE != "null" ]; then @@ -53,10 +58,5 @@ if [ $CHECK_SUCCESS = "false" ]; then echo $(_jq '.message') done fi echo "" -
EverlastingBugstopper revised this gist
Sep 23, 2021 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,13 +6,14 @@ CHECK_OUTPUT=$(rover subgraph check my-graph --schema ./products.graphql --name CHECK_SUCCESS=$(echo $CHECK_OUTPUT | jq '.data.success') if [ "$CHECK_SUCCESS" = "true" ]; then echo "### Check Success" echo "" echo $CHECK_OUTPUT | jq '.data' fi CHANGES=$(echo "${CHECK_OUTPUT}" | jq '.data.changes') if [ "$CHANGES" != "null" ]; then echo "#### Change Details" echo "" echo "| Severity | Code | Description |" -
EverlastingBugstopper created this gist
Sep 22, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ #! /bin/bash # This script performs a subgraph check and generates a markdown file from Rover's JSON output # Change the following line to refer to your graph ref, schema, and subgraph name CHECK_OUTPUT=$(rover subgraph check my-graph --schema ./products.graphql --name products --output json) CHECK_SUCCESS=$(echo $CHECK_OUTPUT | jq '.data.success') if [ $CHECK_SUCCESS = "true" ]; then echo "### Check Success" echo "" echo $CHECK_OUTPUT | jq '.data' fi if [ $(echo "${CHECK_OUTPUT}" | jq '.data.changes') != "null" ]; then echo "#### Change Details" echo "" echo "| Severity | Code | Description |" echo "| -------- | ---- | ----------- |" for CHANGE in $(echo "${CHECK_OUTPUT}" | jq -r '.data.changes[] | @base64'); do _jq() { echo ${CHANGE} | base64 --decode | jq -r ${1} } CHANGE_SEVERITY=$(_jq '.severity') CHANGE_CODE=$(_jq '.code') CHANGE_DESCRIPTION=$(_jq '.description') echo "| $CHANGE_SEVERITY | $CHANGE_CODE | $CHANGE_DESCRIPTION |" done echo "" fi if [ $CHECK_SUCCESS = "false" ]; then echo "### Check Failure" echo "" echo $CHECK_OUTPUT | jq -r '.error.message' echo "" echo "#### Error Details" echo "" for BUILD_ERROR in $(echo "${CHECK_OUTPUT}" | jq -r '.error.details.build_errors[] | @base64'); do _jq() { echo ${BUILD_ERROR} | base64 --decode | jq -r ${1} } BUILD_ERROR_CODE=$(_jq '.code') if [ $BUILD_ERROR_CODE != "null" ]; then echo -n "$BUILD_ERROR_CODE: " else echo -n "UNKNOWN: " fi echo $(_jq '.message') done CHECK_URL=$(echo $CHECK_OUTPUT | jq '.data.target_url') if [ $CHECK_URL != null ]; then echo "" echo "See more details in [Apollo Studio]($CHECK_URL)" fi fi