-
Task
-
Resolution: Done
-
Major
-
None
-
None
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