kscout / serverless-registry-api

API which curates serverless applications.
https://api.kscout.io
GNU General Public License v2.0
0 stars 1 forks source link

Missing deployment files but present deployment dir causes error #163

Open Noah-Huppert opened 5 years ago

Noah-Huppert commented 5 years ago

Submitting a PR with a deployment/ directory which is present but has no files in it results in an internal error response.

Occurred on this PR: https://github.com/kscout/serverless-apps/pull/46#issuecomment-512842560

Logs from the server:

serverless-registry-api.handlers [DEBUG] received pull request event:  ... SNIP ...
serverless-registry-api.handlers [DEBUG] started validate job for PR #46
serverless-registry-api.handlers [DEBUG] GET /health
serverless-registry-api.handlers [DEBUG] POST /apps/webhook
serverless-registry-api.job-runner.job.validate [ERROR] internal error when validating app "grpc-example": the "Resources" field failed the "required" validation tag
serverless-registry-api.job-runner.job.validate [ERROR] internal error when validating app "grpc-example": the "ParameterizedResources" field failed the "required" validation tag
serverless-registry-api.job-runner.job.validate [ERROR] internal error when validating app "grpc-example": the "Parameters" field failed the "required" validation tag
serverless-registry-api.job-runner.job.validate [ERROR] internal error when validating app "grpc-example": the "DeployScript" field failed the "required" validation tag
serverless-registry-api.handlers [DEBUG] GET /health
serverless-registry-api.job-runner [DEBUG] ran validate job

As we can see the App model fields related to deployment resources are all failing the required validation. These fields are never supposed to be empty. Because there is logic in parsing/repo.go which checks that all required files are present before reaching this code. Improve this logic.