Closed Bug 1430902 Opened 7 years ago Closed 7 years ago

Handle invalid schemas

Categories

(Taskcluster :: Services, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alexandra_, Assigned: alexandra_, Mentored)

Details

(Keywords: good-first-bug)

No description provided.
Assignee: nobody → alesilva241
Specifically, the issue is that we allow users to upload invalid triggerSchemas, and then validate them later, causing failures. They should be validated on createHook/updateHook. Alex, is it OK if I take this bug?
Flags: needinfo?(alesilva241)
(In reply to Dustin J. Mitchell [:dustin] pronoun: he from comment #2) > https://github.com/taskcluster/taskcluster-hooks/pull/76 I've pushed some changes and one doubt. I am not sure if context.payload can be used to validation.
Assignee: alesilva241 → dustin
Flags: needinfo?(alesilva241)
Commit pushed to master at https://github.com/taskcluster/taskcluster-hooks https://github.com/taskcluster/taskcluster-hooks/commit/3c075bf2b8e06f02e2ebfdb43b17804420bcfca8 Merge pull request #76 from alexandrasp/schemaValidationErrors handle invalid schemas - bug 1430902
OK, that's landed, but the result is --- Error executing operation Invalid Schema --- which isn't too helpful. The AJV docs say that ajv.errors is set, so we can probably format that.
I think this will make a good first bug from here. The commit in comment 4 shows where this error is raised. What remains to do is to add some code to extract the errors from ajv.errors and include them in the message. You can find some examples of using ajv.errorsText in `src/v1.js` to help figure that out.
Assignee: dustin → nobody
Mentor: dustin
Keywords: good-first-bug
Assignee: nobody → alesilva241
Commit pushed to master at https://github.com/taskcluster/taskcluster-hooks https://github.com/taskcluster/taskcluster-hooks/commit/088fcce7a42f02bce1b19161ca1f20b814caf383 Merge pull request #110 from alexandrasp/extract-error-message-in-invalid-schema Bug 1430902: Format a invalid error message
Nice work! And welcome back :)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
(In reply to Dustin J. Mitchell [:dustin] pronoun: he from comment #8) > Nice work! And welcome back :) Thanks Dustin!! :) Happy to be back o/
Component: Hooks → Services
You need to log in before you can comment on or make changes to this bug.