Deployment State Caching should be disabled by default in CI
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Describe the bug
In CI there are 3 scenarios:
1. Ephemeral runner/s
State caching is wasted IO here, it will be deleted with the runner.
3. Persistent runners
Each runner gets its own cache. Each deployment might run on a different runner getting either no cache or a stale cache.
5. Persistent runner (singular) or explict state handling.
Once you've run into the this the first time and find the docs you might use your CI provider's caching action to save/load the state between pipeline runs. The recommendation is to key a hash of the app host's (full) path, CI runners paths often include things like a build/run number, so this is likely to miss.
Additionally, the docs make it sound like the caching is only used for collecting user input interactively - but I definedly ran into problems running in CI (where there is no input) with stale state - so it'd be great if the docs could be clearer about what's actually in the state and what happens if it's missing or stale.
### Expected Behavior
Deployment works reliably out of the box in CI, without unexpectedly relying on state.
### Anything else?
I feel like the safest option would be requiring an opt in to deployment state caching when CI is detected, or even when !interactive.
Future work might be to allow for the state to be stored in/with each environment, eg. in an Azure Storage account or ARM metadata.
Contributor guide
Research direction
Start by locating the deployment state caching implementation and the CI or non-interactive deployment entry points; the issue names no files or tests. Read the existing state documentation to determine what is cached and how missing or stale state is handled. Done means CI deployments no longer rely on state by default, with the intended opt-in behavior and documentation clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100