Page MenuHomePhabricator

Quibble to output markers for processing its output
Closed, ResolvedPublic

Description

The CI Jenkins has the Collapsing Console Sections Plugin. It can be used to collapse sections of the console output. For example:

capture.png (1×1 px, 310 KB)

To do so, the plugin relies on regular expressions we fill to detect the start and end of a section (via /ci/configure. A gotcha is that when no end of section is filled, the next section would be made a child. We thus have to terminate a section based on the output of an unrelated command that comes after which is not that reliable.

Some recently added rule was for Fresnel run (T220561). Example rules:

Namefresnel record ({1})
Start.*fresnel record\s*"?([^"]*).*
End.*conductor/record-end.*

Which is probably fine.

NameFresnel result
Start.*fresnel compare.*
Ends.*INFO:.*

INFO: comes from Quibble output, not Fresnel and might change. Another example:

Namesetup quibble mw-install
Start`.*(HHVMPHP).+ is installed.*`
Ends`.*INFO:quibble.cmd:(PHPUnitUser).*`

Maybe we could define a standard format to start/end section which can then be optionally inserted in the output of Quibble and testing tools?

It is probably rather trivial to implement it with a python decorator added to relevant Quibble methods.

Event Timeline

Travis does that using folding markers. Eg:

travis_fold:start:Some step
// some stuff there
travis_fold:end:Some step

Described at https://blog.travis-ci.com/2013-05-22-improving-build-visibility-log-folds

We might get this for free once e30d25a72ac50a0828835f18f9d34396d7d847d7 is deployed, each section will end with "<command string> finished in <time>". Otherwise, I like hashar's suggestion to add another decorator to produce easily matched delimiters.

Change 545972 had a related patch set uploaded (by Hashar; owner: Awight):
[integration/quibble@master] Chronometer emits folding markers

https://gerrit.wikimedia.org/r/545972

Change 545972 merged by jenkins-bot:
[integration/quibble@master] Chronometer emits folding markers

https://gerrit.wikimedia.org/r/545972

Hashar wrote in code review,

I guess that is a good first step not sure whether that would ease anything with the Jenkins collapsing plugin though :]

I think I've misunderstood the problem here, I was following this note from the task description:

A gotcha is that when no end of section is filled, the next section would be made a child. We thus have to terminate a section based on the output of an unrelated command that comes after which is not that reliable.

With the merged patch, there will be a "<<< Finish: [...]" marker at the end of each section. Is there more to do here?

Yes, try it and see whether we can parse them with the Jenkins Collapsible plugin :]

Change 562918 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/quibble@master] Release Quibble 0.0.40

https://gerrit.wikimedia.org/r/562918

Change 562918 merged by jenkins-bot:
[integration/quibble@master] Release Quibble 0.0.40

https://gerrit.wikimedia.org/r/562918

Change 562959 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] dockerfiles: Create images for Quibble version 0.0.40

https://gerrit.wikimedia.org/r/562959

Change 562960 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] jjb: Switch over to images using Quibble version 0.0.40

https://gerrit.wikimedia.org/r/562960

Change 562959 merged by jenkins-bot:
[integration/config@master] dockerfiles: Create images for Quibble version 0.0.40

https://gerrit.wikimedia.org/r/562959

Mentioned in SAL (#wikimedia-releng) [2020-01-08T20:56:33Z] <James_F> Docker: Publishing Quibble 0.0.40 images on contint1001 T192167 T220586 T236222 T236680

Change 562960 merged by jenkins-bot:
[integration/config@master] jjb: Switch over to images using Quibble version 0.0.40

https://gerrit.wikimedia.org/r/562960

hashar assigned this task to awight.

Quibble has fold markers since 6a466a3aacea7fcc7e7c3af0cbd7a8fb958d347b which has been released with 0.0.40.

I have updated the Collapsible Section rules in https://integration.wikimedia.org/ci/configure and we now have catch all:

Name{1}
Start^INFO:quibble.cmd:>>> Start: ([^{,]+).*
End^INFO:quibble.cmd:<<< Finish: .+, in .+ s

The start section thus reuse whatever name has been defined in Quibble so we don't have to keep adjusting those rules. In the start section I exclude the characters { and , to early terminate the regex group capture in order to have shorter section name in some cases.

That will make @Krinkle life easier, he previously has spend a fair amount of time to tweak those rules.

Mentioned in SAL (#wikimedia-releng) [2020-07-04T08:56:19Z] <hashar> Fixed Jenkins collapsible section parsing for Quibble. A logger changed from quibble.cmd to quibble.commands. # T220586