arcxp / datadog-service-catalog-metadata-provider

This repository houses the Datadog Service Catalog Metadata Provider. With this tool you can use GitHub Actions to provide Datadog with the metadata for your service. For more information on what the Datadog Service Catalog is: https://www.datadoghq.com/product/service-catalog/
MIT License
19 stars 6 forks source link

Skip creation of catalog entry when it already exists #122

Closed azen1k5 closed 2 weeks ago

azen1k5 commented 1 month ago

Is your feature request related to a problem? Please describe. When running this for a service that has a catalog info already in the repository or was otherwise created, running this action will overwrite the information.

Describe the solution you'd like The action should have a toggle to skip creating an entry if it already exists for that service. This can be done by quering the datadog api.

Describe alternatives you've considered For now I created an additional step to query the api and then skip this action if an entry already exists.

manchicken commented 1 month ago

I'm sorry friend, I don't quite understand this issue and I'm hoping you can help me out.

If you're using a GitHub Action to update a service in the Datadog Service Catalog and you supply information for a service—even if it already exists—the idea is that updating it with the same information (or different information) is desired behavior because this is the path through which updates come.

Could you help me understand the use case where you wouldn't want to update a service?

azen1k5 commented 3 weeks ago

Sure we have the use case where a lot of services don't have a catalog entry yet so we automatically create one in the pipeline using this great action.

But as adaption progresses more and more teams are putting the catalog info in a yaml in their repository with more information, there is a conflict if I would still run it from the pipeline.

Totally fine if you think this is not appropriate for this action. :-)

manchicken commented 3 weeks ago

One of the items I have on my TODO for this Action is to allow folks to just supply the YAML file directly to the action, so I think that might be my preferred middle-ground here. I don't know when I'll have time to get to that, but that's issue #103.

azen1k5 commented 2 weeks ago

sounds good then I will close my issue