Skip to content

presist signals fired via gp sync{await, done} so they survive workspace restarts #2186

Closed
@nisarhassan12

Description

@nisarhassan12

I was recently Gitpodifying https://github.com/niklasvh/html2canvas and below is how my config looked like:

tasks:
  - name: Build
    init: npm install && npm run build && gp sync-done boot

  - name: Website
    before: cd www/
    init: npm install
    command: gp sync-await boot && npm start
    openMode: split-right

ports:
  - port: 8000
    onOpen: open-preview

The same config worked without the pre-builds while with the pre-builds it seemed to be stuck as if the npm start thing did not work. The behaviour was kind of odd and I had no idea What I was doing wrong.

Screenshots

Without Pre-build

image

With Pre-build

image

Thanks to @svenefftinge who pointed out:

the init tasks are not executed during startup of a prebuilt workspace. Therefore the gp sync-done boot command is never executed and as a consequence the other terminal is waiting forever.

moving the gp sync-done boot to the command section instead of init made it work as expected.

As a user looking at https://www.gitpod.io/docs/config-start-tasks/ I was expecting gp sync-done boot to work in the init phase. Sven proposed:

Maybe we should persist signals fired on disk so they survive workspace restarts.

I agree with him as the current behaviour unless we clearly document it is alienating.

Front logo Front conversations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions