GoogleContainerTools / GoogleContainerTools/skaffold

Control API receiving deploy intent before build causes dev loop to softlock

Open
#4,886 1 comment 0 reactions 1 assignee Claimed by @PriyaModali View on GitHub
area/api kind/bug priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
When dev loop is running with `auto-build` and `auto-deploy` both set to false, if a rebuild is necessary and a deploy intent is issued by the user **before the build intent**, this intent should be ignored by the server and `needsDeploy` should still be `true`.

### Actual behavior
When a change is made to an already-deployed application, the intents are reset on the runner. Then, when a deploy intent is received **first**, skaffold tries to redeploy (which it shouldn't), though nothing changes, but the intent is then set to `false`. Thus, if a build intent is sent after this, the build will occur, but subsequent `deploy` intents will do nothing.

Users can escape out of this by making another code change, but it's still a bad UX.

To fix, we should do two things:
1) reject deploy intents if we have nothing new to deploy (or perhaps if we have `autoBuild` set to false as well, and haven't received a build intent yet). in the logs I see `DEBU[0024] 1 manifests to deploy. 0 are updated or new`, so I know we're tracking this
2) reset `needsRedeploy` whenever a build is complete

### Information

- Skaffold version: v1.15.0
- Operating system: OS X

### Steps to reproduce the behavior

1. any example in the project, `getting-started` works fine
2. `skaffold dev --auto-build=false --auto-deploy=false --rpc-http-port=12345`
3. change `main.go`
4. `curl http://localhost:12345/v1/execute -X POST -d '{"deploy": true}`
5. watch logs as skaffold "redeploys", but of course it actually doesn't
6. `curl http://localhost:12345/v1/execute -X POST -d '{"build": true}`
7. watch as rebuild is successful
8. `curl http://localhost:12345/v1/execute -X POST -d '{"deploy": true}`
9. watch as nothing happens

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.