argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.33k stars 4.93k forks source link

Add commit_age to ApplicationSet SCM Provider Generator parameters #18043

Open eitan-papaya opened 2 weeks ago

eitan-papaya commented 2 weeks ago

Summary

In the SCM Provider generator, there are several parameters provided that can be later used for the post selector like short sha, labels, branch normalized. I would like to add to those parameters the commit age.

Motivation

My use case is using ApplicationSet to generate feature environments with the generator, but only keeping envs that the last commit was less then X days ago. This can be helpful to filter out old unused branches and reduce cloud costs on unutilized environments.

Proposal

The data is most likely already provided from the different SCM providers APIs, just need to add it to the parameters. I will gladly make a PR if the enhancement proposal is accepted.