Skip to content

Static service in a profile reuses its old build after a source change (no watch allowed) #562

Closed

Description

@fen89

devstack 0.49.3, Windows 11 (lane on a Linux pool node, --on <node>).

What happened

A profile turns a dev server into a static build for an acceptance run:

[services.web]
kind   = "devserver"
cwd    = "app"
run    = "npm run serve -- --port {port}"
port   = 4200
restart_on = ["app/tsconfig*.json", "app/angular.json"]

[profiles.acceptance]
data    = "fresh"
command = "e2e"

[profiles.acceptance.services.web]
kind    = "static"
build   = "npx ng build web -c dev"
output  = "app/dist/web"
forward = { "/api" = "{service.api.url}" }
  1. devstack up --profile acceptance --run --on <node> in a worktree: web builds, build id caf6fee6....
  2. Change a source file under app/libs/... in the worktree (not committed).
  3. devstack lane stop, then the same devstack up --profile acceptance --run --on <node> again.

The second start does not build web: it goes from stopped to healthy in under a second with the same build id caf6fee6..., and the suite runs against the bundle from step 1. A built service (api, with watch) does rebuild from the changed tree.

devstack builds web afterwards shows only the first build. devstack restart web builds a new id and the change is live, so the source of the lane is current; only the start reuses the old artifact.

What I expected

A static service rebuilds when its sources change, like a built service with watch. Otherwise a lane that is reused for a second acceptance run checks an old bundle and reports results for code it never ran.

What I tried

watch on the profile's static service is rejected:

unknown field `watch`, expected one of `kind`, `build`, `output`, `run`, `stop`, `spa`, `forward`, `cwd`, `health`, `env`

watch on the base service is allowed, but it is a dev server that reloads itself, so restart_on is the documented key there and watch would change the dev server's behaviour.

Suggestion

Either allow watch on a profile service (and key the static build id on it), or derive the build id of a kind = "static" service from its cwd/build inputs by default. Until then, a hint in status that a static artifact predates the working tree would help.

Workaround: devstack up --profile acceptance --on <node>, then devstack restart web, then devstack run e2e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions