Skip to content

Fix JSON schema of Ci::JobArtifactsDeletedEvent

What does this MR do and why?

I had originally picked this event out to provide an example for !141110 (merged) (the choice was completely arbitrary), but found that it always passed my validations, no matter what type of an element I put in there. Turns out the array item type declaration was invalid, but the schema validation passed because the library ignores the unused 'properties' key for 'type' => 'array'.

This change should be safe because the data is artifacts.map(&:job_id), and the job_id column a non-nullable integer.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Try the following examples before and after this change:

# Happy path should pass
Ci::JobArtifactsDeletedEvent.new(data: { job_ids: [1, 3] })

# One invalid element should fail, but passes before this change
Ci::JobArtifactsDeletedEvent.new(data: { job_ids: [1, nil] })
Edited by Hordur Freyr Yngvason

Merge request reports