Broken `--changed-since` for `helm_chart`
Describe the bug
Helm chart doesn't show up in pants list --changed-since if I change the helm chart template files.
Pants version 2.21.0
OS Ubuntu 22.04
Additional info Here is the commit to reproduce the problem: https://github.com/grihabor/pants-playground/tree/6caad5c30e81500eedc0a98c08417b04529e61fa/helm-dependents-bug
seems Pants is only identifying changes if made to the HelmChartMetaSourceField (the "chart.yaml" itself) and not to the HelmChartSourcesField. I think this is an interaction of things that get a sources field expecting only 1 sources field.
Confirming, we get tgt[SourcesField]. Since the chart itself is a SourcesField, this getitem gives just the chart. https://github.com/pantsbuild/pants/blob/8fa130ef917979bf30d832092b3bf17953453c9f/src/python/pants/backend/project_info/peek.py#L316
I remember that we had a similar problem with the Terraform backend, for handling tfvars and tfbackend files. My first pass was to use separate sources fields, which ran into this problem. We ended up creating separate target types, which was also helpful for other terraform things (multiple deployments for the same module). (In theory, we could create this as a synthetic target, since "chart.yaml" is a good indicator that this is a Helm chart.) We could also remove it as a sources field, and pull it in with with a pathglob. (We used to pull in terraform lockfiles with a pathglob, and now we do that with a synthetic target.)
@alonsodomin thoughts?
yeah, I think this is a result of the helm_chart target having two different sources fields. IIRC There was a similar issue reported some time ago in Slack but it never made as a bug report.
Anyway, it's quite likely that some refactoring will be needed in terms of targets, separating the responsibilities of the helm_chart target into one that points to the Chart.yaml specifically and another one for capturing the chart sources. I assume the change can be done in a way it doesn't affect end users by preserving the helm_chart target but converting it to a target generator for the other two.
maybe we should move Chart.yaml values into BUILD and generate it with pants instead? similar to setup.py for python_distribution