@@ -157,7 +157,15 @@ ${sanitizeDockerfileOutput(result.stderr.toString())}`;
157157}
158158
159159function sanitizeDockerfileOutput ( result : string ) : string {
160- return stripAbsoluteImportPaths ( sanitizeTimestamps ( sanitizeVersionSpecifiers ( stripRushStageNumbers ( stripANSIEscapes ( normalizeNewlines ( result ) ) ) ) ) ) ;
160+ return [
161+ normalizeNewlines ,
162+ stripANSIEscapes ,
163+ stripRushStageNumbers ,
164+ sanitizeVersionSpecifiers ,
165+ sanitizeTimestamps ,
166+ sanitizeUnimportantGulpOutput ,
167+ stripAbsoluteImportPaths ,
168+ ] . reduce ( ( result , f ) => f ( result ) , result ) ;
161169}
162170
163171function normalizeNewlines ( result : string ) : string {
@@ -172,17 +180,28 @@ function stripRushStageNumbers(result: string): string {
172180 return result . replace ( / \d + o f \d + : / g, "XX of XX:" ) ;
173181}
174182
183+ /**
184+ * Gulp's output order within a `parallel` block is nondeterministic (and there's no way to configure it to execute in series),
185+ * so we purge as much of the gulp output as we can
186+ */
187+ function sanitizeUnimportantGulpOutput ( result : string ) : string {
188+ return result . replace ( / ^ .* ( \] ( S t a r t i n g ) | ( F i n i s h e d ) ) .* $ / gm, "" ) // task start/end messages (nondeterministic order)
189+ . replace ( / ^ .* \] R e s p a w n e d t o P I D : \d + .* $ / gm, "" ) // PID of child is OS and system-load dependent (likely stableish in a container but still dangerous)
190+ . replace ( / \n + / g, "\n" ) ;
191+ }
192+
175193function sanitizeTimestamps ( result : string ) : string {
176194 return result . replace ( / \[ \d ? \d : \d \d : \d \d ( A | P ) M \] / g, "[XX:XX:XX XM]" )
177- . replace ( / \d + ( \. \d + ) ? s e c o n d s ? / g, "? seconds" )
178- . replace ( / \d + ( \. \d + ) ? m i n u t e s ? / g, "" )
179- . replace ( / \d + ( \. \d + ) ? s / g, "?s" ) ;
195+ . replace ( / \[ \d ? \d : \d \d : \d \d \] / g, "[XX:XX:XX]" )
196+ . replace ( / \d + ( \. \d + ) ? s e c ( o n d s ? ) ? / g, "? seconds" )
197+ . replace ( / \d + ( \. \d + ) ? m i n ( u t e s ? ) ? / g, "" )
198+ . replace ( / \d + ( \. \d + ) ? ( m ) ? s / g, "?s" ) ;
180199}
181200
182201function sanitizeVersionSpecifiers ( result : string ) : string {
183202 return result
184203 . replace ( / \d + .\d + .\d + - i n s i d e r s .\d \d \d \d \d \d \d \d / g, "X.X.X-insiders.xxxxxxxx" )
185- . replace ( / @ \d + \. \d + \. \d + / g, "@X .X.X" ) ;
204+ . replace ( / ( [ @ v ] ) \d + \. \d + \. \d + / g, "$1X .X.X" ) ;
186205}
187206
188207/**
0 commit comments