Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Skip Style Checks on Invalid apps #168

Merged
merged 2 commits into from
Oct 27, 2017
Merged

Conversation

bcooksey
Copy link
Contributor

@bcooksey bcooksey commented Oct 26, 2017

Description

If a dev has an app that has major schema validation errors (but still parses as JSON), the zapier validate command will POST that to zapier.com to run the style checks. In some cases, this can cause the server to throw a 500. That is being fixed, and will soon correctly return a 403.

However, there really isn't a point in making that call at all if we know locally we are invalid. So, this PR updates the validate command to skip style checks on invalid apps.

TODO

  • Skip style check API call on invalid app
  • Do not print success message if style checks are skipped due to invalid app
  • Do not print success if -without-styles flag is passed.

If an app is invalid, it could be a minor thing, like missing a noun, or it could be a major thing, like defining a piece of the app that should be an object as a string. We do not have a way to tell how severe it is, so we should opt to not do the style check at all.
@bcooksey
Copy link
Contributor Author

I should mention that the process.exitCode may not be the cleanest solution now that we are skipping stuff. As an alternative we could use process.exit(), though it is nice to flow through the whole chain so that each callback can be responsible for saying messages like "Skipping because", vs the point calling process.exit() having to be aware of what all other things are skipped. Maybe a throw and .catch could solve that.

Copy link
Contributor

@BrunoBernardino BrunoBernardino left a comment

Choose a reason for hiding this comment

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

I see what you're saying. I think this works well for now. If we find we need to add a bit more structure and control we can always improve that later.

This makes sense and is a nice, clean solution! Thanks!

@bcooksey bcooksey merged commit 0b04351 into master Oct 27, 2017
@bcooksey bcooksey deleted the skip-style-checks-on-invalid-apps branch October 27, 2017 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants