gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

werft.ts: How should we deal with phases?

Open fullmetalrooster opened this issue 4 years ago • 3 comments

We open new phases with werft.phase(<NAME>) but we never close them. Instead we create slices inside the current phase by werft.log(<SLICE>,<MESSAGE>). In case of the phase validate-changes [1] a new phase is created and a slice is created with werft.done("validate-changes"). It looks like it was meant to close the phase. Should we close phases explicitly with werft.endPhase(<NAME>)?

fullmetalrooster avatar Apr 04 '22 09:04 fullmetalrooster

werft jobs do not have any real structure. Adding new validation rules and checks might become messy over time if we do not have a proper model for werft jobs. I propose to structure the werft jobs like this.

fullmetalrooster avatar Apr 04 '22 09:04 fullmetalrooster

As just discussed in sync: I agree that calling werft.done for a phase is wrong, because done() closes the slice, not the phase. Better: make endPhase() public and call endPahse explicitly: https://github.com/gitpod-io/gitpod/blob/d020cb22daf32ed159a8b074b4d8a38f44a41fa8/.werft/util/werft.ts#L101

While it's ok that phases get implicitly closed by opening a follow-up phase, I also don't mind if we close them explicitly because it may give us traces with more accurate/reliable timings. E.g. The traces capture if accidentally there is a time sink between phases.

meysholdt avatar Apr 04 '22 14:04 meysholdt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 07 '22 02:07 stale[bot]