Skip to content

Commit

Permalink
feat(bulk-import): perform more dry-run checks in the POST /imports
Browse files Browse the repository at this point in the history
… backend endpoint [RHIDP-3339] (#1979)

* Add test highlighting the expectations

* Improve import dry-run checks

Besides checking if the specified 'catalogEntityName' already exists in
the catalog:

- Check if the repo is empty
- Check if the repo already has a catalog-info YAML file in its default
  branch

* Fix code duplication issues reported by static code analysis

* Check the CODEOWNERS file presence in the repo as a new dry-run operation

On the register existing entity form,
there is this "Use codeowners file" checkbox
which reads from the CODEOWNERS file in the repo.
The import might fail if entity owner name is missing or
if no codeowners file is present in the repo.

Co-authored-by: Debsmita Santra <dsantra@redhat.com>

* Fix issues reported by SonarCloud

- Refactor to reduce code duplication in githubApiService.ts
- Explicitly set a compare function when sorting the dry-run import statuses array
- Reduce level of nested functions in router.test.ts

---------

Co-authored-by: Debsmita Santra <dsantra@redhat.com>
  • Loading branch information
rm3l and Debsmita Santra authored Aug 20, 2024
1 parent 412a483 commit e43719b
Show file tree
Hide file tree
Showing 3 changed files with 426 additions and 311 deletions.
Loading

0 comments on commit e43719b

Please sign in to comment.