⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Hydrator: .gitattributes content should be configurable #25870

@sym-stiller

Description

@sym-stiller

Summary

The Source Hydrator writes a .gitattributes file to the root of the hydrated branch, to hide some generated files in PRs. The content of this file is hardcoded here.

I want to use a different .gitattributes file in my hydration branch, as the current glob patterns do not match my app paths. The current glob patterns assume that all apps are stored in directories directly under the root of the repo.

Motivation

I am currently evaluating gitops-promoter in combination with Source hydrator. The generated files clutter up my promotion PRs severely.

I want to hide these generated files in my PRs, without changing my app directory structure. Source hydrator can handle more deeply nested app directories fine, only the .gitattributes file is not configured correctly. Manually overwriting this file is also not possible, as Source hydrator will overwrite it again with the hardcoded contents.

Proposal

I think there are two ways to solve this issue: Let the cluster admin take care of the .gitattributes content, or dynamically calculate the right glob patterns in Source hydrator.

Approach 1: Let the cluster admin define the content of '.gitattributes'

A cluster admin should be able to overwrite the contents of the .gitattributes file. Either Source Hydrator should just reuse any existing .gitattributes file from the dry branch, if it exists. Or Source hydrator should come with the option to configure what contents this file should have on the hydration branch, e.g. via a property in the ConfigMap argocd-cm.

Approach 2: Calculate the right glob patterns in Source hydrator

If Source hydrator wants to keep the ownership of the .gitattributes file on the hydration branch (= does not allow customizing or overwriting it), it should try to calculate better glob patterns. If hydration occurs in a path that is not matched by the current glob patterns in .gitattributes, Source hydrator should append a matching glob pattern to the file for all generated files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:hydratorIssue related to the Source Hydrator and commit serverenhancementNew feature or requesttriage/pendingThis issue needs further triage to be correctly classified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions