diggerhq / digger

Digger is an open source IaC orchestration tool. Digger allows you to run IaC in your existing CI pipeline ⚡️
https://digger.dev
Apache License 2.0
4.3k stars 573 forks source link

implement caching layer for digger config #1825

Closed motatoes closed 1 week ago

motatoes commented 2 weeks ago

introduces caching for digger config so that it can be loaded from cache if needed.

The flag needed for this is "DIGGER_CONFIG_REPO_CACHE_ENABLED=1" as well as setting the value for "DIGGER_INTERNAL_SECRET={some secret}" in order to be able to call an internal url for re-caching.

The internal url is /_internal/update_repo_cache and it needs some arguments. Here is a curl request for it as an example"

 curl -XPOST https://mydigger.app/_internal/update_repo_cache \
-H "Authorization: Bearer abc123" \
-d '{ 
      "repo_full_name": "diggerhq/demo-opentofu", 
      "branch": "main", 
       "installation_id": 56497610
}'

Where repo_full_name is just a path to the repo branch is the branch you want to cache from (always this would be your default branch installation_id is your github installation ID and can be fetched from your github app settings (the place where you installed the app from)

Also if you want to disable loading from cache in a specific PR you can add the label "digger:no-cache" to it and it will not load from cache anymore

delve-auditor[bot] commented 2 weeks ago

We have finished reviewing your PR. We have found no vulnerabilities.

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.