Corpus Management - Corpus Upload - Commit Corpus

Related to #342433 (closed). Based on plan in #341338 (comment 683187524)

Implementation Plan

  • Commit corpus upload

backend MR for the graphQL work is currently merged to master !71992 (merged)

  1. Enable flag ee/config/feature_flags/development/corpus_management.yml
  2. Run the following mutation with a valid project path and package. The package.project_id and packageID should be same.
Create Mutation
mutation CorpusCreate($input: CorpusCreateInput!) {
  corpusCreate(input: $input) {
    errors
  }
}

{
  "input": {
  	"packageId": 1,
    "fullPath": "gitlab-org/gitlab-test"
  }
}
  1. Response should not contain an error and you can check in rails console the corpus record
[42] pry(main)> AppSec::Fuzzing::Coverage::Corpus.last
  AppSec::Fuzzing::Coverage::Corpus Load (0.4ms)  SELECT "coverage_fuzzing_corpuses".* FROM "coverage_fuzzing_corpuses" ORDER BY "coverage_fuzzing_corpuses"."id" DESC LIMIT 1 
=> #<AppSec::Fuzzing::Coverage::Corpus:0x00007fc6505cee78
 id: 9,
 project_id: 1,
 user_id: 1,
 package_id: 1,
 file_updated_at: Fri, 08 Oct 2021 11:12:36.685846000 UTC +00:00,
 created_at: Fri, 08 Oct 2021 11:12:36.693666000 UTC +00:00,
 updated_at: Fri, 08 Oct 2021 11:12:36.693666000 UTC +00:00>
Edited by -