Generate schema.graphql on demand

This will fix some issues with jenkins builds failing if the
patchset is behind some newer graphql changes, as well as allowing
us to include content defined in our plugins in the graphql.schema
file.

Test Plan:
  - Jenkins passes

fixes USERS-210

flag = none

Change-Id: Ic44849ee57955e0b90395661a66f6d5840a38e87
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222029
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
This commit is contained in:
Landon Gilbert-Bland 2020-01-06 08:04:11 -07:00
parent 9b80b7f52d
commit f45ab202a3
5 changed files with 5 additions and 3531 deletions

3
.gitignore vendored
View File

@ -82,3 +82,6 @@ docker-compose.local.*
.nyc_output
coverage-jest
coverage-karma
# generated graphql schema
schema.graphql

View File

@ -77,18 +77,6 @@ function run_brakeman {
bundle exec ruby script/brakeman
}
function graphQL_schema_check {
bundle exec rails graphql:schema
# if the generated file is different from the checked in file, fail
if ! git diff --exit-code schema.graphql; then
echo "Error: GraphQL Schema changes are not checked in"
echo "run 'bundle exec rails graphql:schema' to generate graphql.schema file"
return 1
else
echo "GraphQL schema changes passed"
fi
}
function build_tasklist {
echo "Building tasklist..."

View File

@ -2,4 +2,5 @@
set -x -o errexit -o errtrace -o nounset -o pipefail
docker-compose run --name tests-jest -e COVERAGE web yarn test:jest --runInBand
docker-compose run --name tests-jest -e COVERAGE -e RAILS_ENV=test web \
bash -c "bundle exec rails graphql:schema && yarn test:jest --runInBand"

View File

@ -38,13 +38,6 @@ bundle exec ruby script/rlint
bundle exec ruby script/eslint
bundle exec ruby script/lint_commit_message
RAILS_ENV=test bundle exec rails graphql:schema
# if the generated file is different from the checked in file, fail
if ! git diff --exit-code schema.graphql; then
message="GraphQL Schema changes are not checked in: run 'bundle exec rails graphql:schema' to generate graphql.schema file"
gergich comment "{\"path\":\"schema.graphql\",\"position\":1,\"severity\":\"error\",\"message\":\"\$message\"}"
fi
gergich status
if [[ "$GERGICH_PUBLISH" == "1" ]]; then
gergich publish

File diff suppressed because it is too large Load Diff