-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 entity-validation/catalog: Add possibility to validate multiple Entities that depend on each other #568
Comments
Hi @knowacki23, sounds like a solid feature to add, feel free to submit a PR 🚀 |
Hey @awanlin. |
Hey,
since all the entities sent to validator are coming from the same location we only need one
And while I'm looking at that solution I'm thinking if it makes sense, or if its even a good solution. I'm afraid that this might be a bad approach. Does anyone has some idea or strong opinions regarding this matter? The problem I want to solve is that we are using a custom validation rules which are checking if an entity under validation has an owner that actually exists in Software Catalog or the system that it is going to be a part of exists in the catalog as well. |
I was facing a similar situation when I built a linter to verify the catalog-info.yaml files:
What I did to solve the problem:
As you can see here, I have to do some "dirty" hacks to pull this off. I personally would love to see some progress on this matter so I don't have to maintain all the hacks I did. |
Plugin Name
🚀 entity-validation/catalog
🔖 Feature description
Add possibility to send more then one entity to
/api/catalog/validate-entity
and add temporary registry of validated entities to allow validation of multiple entities that are depending on each other.This feature would allow validation of multiple entities at once which would be helpful when user is trying to introduce multiple entities that depend on each other at once.
We are using
validate-entity
endpoint to validate entities in Pull Requests. If user tries to introduce more than one entity and these entities are depending on each other validator fails.🎤 Context
While using entity-validation we have realized that it is impossible to validate two (or more) separate entities that depend on each other.
For example, if we want to validate new Group entity and a Component that should be owned by that Group entity validator will return error for the Component because it doesn't know about the group entity.
Sample validator input:
validator response:
Validates Group entity correctly.
for the Component entity returns following error:
In the networking tab of developer web browser tools I see that validator sends two separate POST requests to the
https://<backstage-url>/api/catalog/validate-entity
endpoints. Each of the requests is for each of the components passed to Entity Validator.The first one is for the Group entity and it returns 200, the second one is for the Component and it returns 400 due to missing Group entity.
✌️ Possible Implementation
Modify validator and
validate-entity
endpoint formcatalog
so the endpoint would accept more than one entity with a single API call.We would send all the entities which should be validated within single API call and then store them in some temporary array and validate other entities from the same request against Software Catalog and that array as well.
Or maybe some temporary Software Catalog only for validation purposes?
Would it make sense?
👀 Have you spent some time to check if this feature request has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: