don't try to create >255 chars long artifact filenames
ClosedPublic

Authored by kparal on Jul 20 2015, 11:12 AM.

Details

Summary

This happened for large Bodhi updates with many builds before it got
assigned an update id.

Test Plan

tested manually

Diff Detail

Repository
rDEPCK task-depcheck
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to don't try to create >255 chars long artifact filenames.Jul 20 2015, 11:12 AM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added reviewers: jskladan, mkrizek, lbrabec.
This revision is now accepted and ready to land.Jul 20 2015, 11:26 AM

you nasty ninja!

jskladan requested changes to this revision.Jul 20 2015, 11:36 AM
jskladan added inline comments.
depcheck/squash_results.py
176–177

item = item[:255-len('....%s.log' % result.keyvals['arch']) + '...'

This IMHO has the same output, but is more readable, how about that?

This revision now requires changes to proceed.Jul 20 2015, 11:36 AM
kparal added inline comments.Jul 20 2015, 11:43 AM
depcheck/squash_results.py
176–177

Another option would be this:

exceed_len = len(filename) - 255
item = item[:-exceed_len-len('...')] + '...'

I should have done it like that in the first place. I like that I don't need to repeat the structure with all the arch and log suffix etc (which can change).

But if you prefer the way you proposed it more, why not. I'd probably do arch = result.keyvals['arch'] first, to make it more readable.

jskladan accepted this revision.Jul 20 2015, 11:54 AM

Accepted with the changes mentioned in the comments.

depcheck/squash_results.py
176–177

Another option would be this: ...

This revision is now accepted and ready to land.Jul 20 2015, 11:54 AM
This revision was automatically updated to reflect the committed changes.