Skip to content

feature: skip unchanged import categories (schemas, objects) during git repository import #9992

Description

@lancamat1

Component

Git Integration

Describe the Feature Request

When importing from a git repository, Infrahub should detect whether the files behind each import category defined in .infrahub.yml (schemas, object files, ...) actually changed since the last imported commit, and skip a category entirely when none of its files changed.

The granularity would be per category, not per file: a change to at least one file under a category (e.g. one object file under an objects/ directory) triggers the import of that entire category, while untouched categories are skipped. For example, if only a schema file changed between two commits, the import would load the schemas but not re-load all objects.

An explicitly requested import should still be able to run everything: today, manually triggering "Import latest commit" is also how users repair a drifted or partially-failed import, and that repair path must keep working.

Describe the Use Case

On repositories with a large number of object files, every import re-loads everything even when a commit only touched a schema (or vice versa), which makes imports much slower than they need to be.

This is currently achievable with CI-side hacks and workarounds (detecting changed paths in the pipeline and triggering partial loads externally), but Infrahub already tracks file changes between commits on the git side, so this information is available internally.

It would also streamline the multi-environment promotion workflow recommended in #9953, where read-only repositories are imported on every promotion — faster, change-aware imports would remove the need for external optimization around that flow.

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    group/backendIssue related to the backend (API Server, Git Agent)state/need-triageThis issue needs to be triagedtype/featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions