Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip events w/ empty stdout when generating stdout downloads #4391

Merged

Conversation

ryanpetrello
Copy link
Contributor

@ryanpetrello ryanpetrello commented Jul 29, 2019

No description provided.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@AlanCoding
Copy link
Member

Maybe we should have a section in https://github.com/ansible/awx/blob/devel/docs/job_events.md about line breaks, because I cannot remember what rules would cause the need for this. Since we have events for which start_line==end_line, I assume that \n are given in the stdout field of the event. If that's the case, then any variation of "\n".join([event.stdout for event in job_events]) should fail under some circumstances, whether or not the blank ones are excluded.

But if I dig into the scheme we're using, it seems something is much less obvious than this...

blank event:

            "stdout": "",
            "start_line": 0,
            "end_line": 0,

non-blank event:

            "stdout": "\r\nPLAY [localhost] ***************************************************************",
            "start_line": 0,
            "end_line": 2,

The best possible scheme (given our constraints) would be to enforce that event.stdout.count('\n')==event.end_line-event.start_line. You can see, that presumption is violated by the 2nd above example.

So we're not following the rule that events implicitly have \n inserted between them. We're also not following the rule that event stdout already has all the line breaks in them (and need no insertion of line breaks).

We're following some other rules. The pattern you are following here could be a validation implementation of those rules. But I do not know what those rules are.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 5d6916f into ansible:devel Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants