Uploaded image for project: 'Red Hat Internal Developer Platform'
  1. Red Hat Internal Developer Platform
  2. RHIDP-3339

[bulk-import][backend] Make dry run perform additional checks

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.3.0
    • None
    • Bulk Import
    • None
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required
    • RHDH Core Team 3260, RHDH Core Team 3261

      Currently, the `dryRun` parameter on the `POST /imports` endpoint only checks in the catalog if there is any entity with the name specified in the catalog, and the only possible error returned would be CONFLICT or no error. It won't query the repository.
      In some cases, e.g., if the repository is empty, dryRun would return no error, but the actual PR creation would fail. We should also check the repository as part of a dry run.

      Rationale

      From Debsmita:

      with the create import jobs, the dry run didn't give me any errors, may be because it only checks if the repository already exists in the catalog page
      Then when creating a job it gave an error saying the repo is empty so cannot create a PR
      Can we make the dry run catch these kind of errors ?

      Another use case from Debsmita:

      On the register existing entity form there is this "Use codeowners file" checkbox which reads from the CODEOWNERS file in the repo. The PR creation fails if entity owner name is missing/codeowners file is not present in the repo.

      TODO
      Perform the following additional checks when dryRun is true:

      • checking the entity in the catalog (DONE)
      • checking if the repo is empty
      • checking if the repo already has a catalog-info.yaml file
      • checking if the repo does not have a CODEOWNERS file

              rh-ee-asoro Armel Soro
              rh-ee-asoro Armel Soro
              RHDH Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: