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

Wrong type on job.trace()? #2808

Closed
stdedos opened this issue Feb 22, 2024 · 4 comments · Fixed by #2868
Closed

Wrong type on job.trace()? #2808

stdedos opened this issue Feb 22, 2024 · 4 comments · Fixed by #2868
Labels

Comments

@stdedos
Copy link
Contributor

stdedos commented Feb 22, 2024

if TYPE_CHECKING:
assert isinstance(return_value, dict)
return return_value

In [3]: type(job.trace())
Out[3]: bytes
@nejch nejch added the typing label Feb 22, 2024
@nejch
Copy link
Member

nejch commented Feb 22, 2024

This might be the case, as we were probably applying typing across dozens of endpoints at the time.

If we consistently get bytes regardless of the streamed argument we can change that easily.

@stdedos
Copy link
Contributor Author

stdedos commented Feb 22, 2024

Oh ... Haven't tried the streamed= 😅

Then, at least | bytes is also needed?

@stdedos
Copy link
Contributor Author

stdedos commented Feb 26, 2024

Actually ... even worse? 😅 😅

In [4]: a = job.trace(streamed=True)
b'\x1b[0KRunning with gitlab-runner ...ERROR: Job failed: command terminated with exit code 1\n\x1b[0;m\n'

In [5]: repr(a)
Out[5]: 'None'

Have I messed up something? I am pretty sure that there's no excuse for a "blanket" print to the terminal 😕

Full disclosure, I'm running against 15.10.2-ee - but I don't think that that should affect

Would you kindly check from your end?

@JohnVillalovos
Copy link
Member

So when using streamed=True it will by default just print() the data. If that is not desired, then the action argument must specify a function to call that accepts the streamed data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants