Closed jimklimov closed 4 months ago
Another note: I am not sure if addShortText() should have any additional effects/abilities/... compared to a badge (arg-manageable color/border/...?), so maybe this is an opportunity to simplify the codebase by implementing it as yet another badge, just without an icon.
Resolved by the changes in:
The addShortText now accepts an id
.
Related to issue #45 - during the same effort I found that AddShortTextStep seems to extend a plain Step, while other badges inherit Step => AbstractStep (has the id field) => AddBadgeStep => AddInfoBadgeStep (or some other applied badge type).
Consistently, the addShortText() step does not have an "id" argument to remove the left-column text later.
Sadly, all the badge steps seem to require the "icon" argument and so any detailed text is that icon image's alt-text in resulting HTML markup -- not easy to access while monitoring build history, especially as I continuously remove and re-post the badges for a progress-update effect, as detailed in #45.
Looking at the resulting build.xml data however I saw that the badges posted to left-column in build history have very similar markups, including the class in the tag, e.g.:
vs.
Effectively, the result of addBadge() has the "id" and "iconPath" elements, and the result of addShortText() does not; others overlap.
I took a shot in the dark by calling addBadge(icon: null, ...) et voila, I have the markup with "id" and without "iconPath" which is rendered in build history as the yellow plaque of text, updated as my pipeline rolls though its loop:
Example rendered output the way I like it:
So, to summarize: for the practical purposes I need a way to remove and add the "short wall of text" in the build history. One way to achieve that "perfectly" would be native support for an "id" in the addShortText() step. Another way to achieve that "du-jour" is to (ab)use the basic addBadge() method with a
null
icon argument. At least until the former is implemented (if ever), I suggest to document the latter in the README, and add comments in the code so nobody removes this ability ;)