Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement caching layer for digger config #1825

Merged
merged 6 commits into from
Nov 15, 2024
Merged

Conversation

motatoes
Copy link
Contributor

@motatoes motatoes commented Nov 14, 2024

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

Copy link

delve-auditor bot commented Nov 14, 2024

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.

@motatoes motatoes merged commit 16a1d63 into develop Nov 15, 2024
11 checks passed
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.

1 participant