Skip to content

Allow setting marker for grouping output #2361

@septatrix

Description

@septatrix

Problem

mkosi can generate a lot of output, especially when installing packages and within the build script. Github Actions, Gitlab Jobs and Azure Devops all support means to group log lines into collapsible sections. I think it would be great if complete_step would use these mechanisms to make the output easier to browse.

Possible solution

This could be implemented either natively by detecting if mkosi is run in one of those environment and using the corresponding log lines or by introducing a new setting (maybe using environment variables) where one can define an line to be printed before and after a step. The latter would be easier to expand to other CI solutions (e.g. I did not lookup Jenkins, Travis etc. though I guess they have similar mechanisms). A problem with the latter, however, would be that the log lines sometimes require some templating. For Github and Azure this is only the title for the log line but Gitlab also wants a timestamp as well as a section name (which is not equal to the title/header) though this could be solved with f-formatted string and us passing a bunch of stuff into them which the user may then reference.

Alternative solution

Add silent or quit flags which would result in capturing all output and only print it in case of failure. This, however, is a very drastic approach.

References

PS: I think this would also be great for the CI. Sadly pytest does not support it out of the box so we would have to roll our own solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions