Skip to content

Feat: implement cache on imports#99

Open
dnitsch wants to merge 13 commits into
mainfrom
feat/cache-imports
Open

Feat: implement cache on imports#99
dnitsch wants to merge 13 commits into
mainfrom
feat/cache-imports

Conversation

@dnitsch

@dnitsch dnitsch commented May 28, 2026

Copy link
Copy Markdown
Contributor

Cache is implemented on the first run of the imports - it works for both config only and file imports (i.e. an import with src and dest)

Cache is stored globally in the $HOME/.eirctl/cache/* directory.

The entire path is base62Encoded so for example git::ssh://github.com/Ensono/eirctl-shared-utils//build/php/eirctl.yaml?ref=v0.2.267 can be referenced from multiple places and will be retrieved from cache

NB: git::ssh://github.com/Ensono/eirctl-shared-utils//build/php/eirctl.yaml?ref=v0.2.267 => git::ssh://github.com/Ensono/eirctl-shared-utils//build/php/eirctl.yaml?ref=v0.2.269 will cause a creation of a new cache entry.

For projects with many git and https style imports the difference can be up to 20X faster on cached retrieval runs.

Closes #60

dnitsch added 2 commits May 28, 2026 16:46
This includes caching import files and storing them for copying to dest
@sonarqubecloud

Copy link
Copy Markdown

@ElvenSpellmaker ElvenSpellmaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks OK, you have a few Sonar errors though about complexity

Also, how does this store the files? Does it take into account the version, can you have multiple different versions cached?

Also - we need a mechanism to refresh the cache - currently if I'm on a branch it'll never pick up any new changes to that branch.

Comment thread internal/config/cache.go Outdated
Comment thread internal/config/cache.go Outdated
Comment thread internal/config/cache.go Outdated
Comment thread internal/config/cache.go Outdated
Comment thread internal/config/loader_git_test.go Outdated
Comment thread internal/config/loader_git_test.go Outdated
Comment thread internal/config/loader_git_test.go Outdated
Comment thread internal/config/loader_git_test.go Outdated
Co-authored-by: Jack Blower <ElvenSpellmaker@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote imports should be cached

2 participants