Proposal: Add optional attachment size#1302
Merged
baev merged 2 commits intoallure-framework:mainfrom Sep 10, 2025
Merged
Conversation
Contributor
Author
|
For more context. I meant the extra roundtrips here: https://github.com/allure-framework/allure2/blob/main/allure-generator/src/main/java/io/qameta/allure/DefaultResultsVisitor.java @Override
public Attachment visitAttachmentLink(final URL attachmentLink) {
final RandomUidContext context = configuration.requireContext(RandomUidContext.class);
return attachmentLinks.computeIfAbsent(attachmentLink.toString(), file -> {
final String uid = context.getValue().get();
final String fileName = attachmentLink.getFile();
final String source = attachmentLink.toString();
final Long size = new UrlSizeChecker().getContentSize(attachmentLink);
return new Attachment()
.setUid(uid)
.setName(fileName)
.setSource(source)
.setType(WILDCARD)
.setSize(size);
});
}If you are interested in backporting |
Member
|
I don't see any concern there. Until the parameter is optional, the user decides, which size value should be used in the attachment. @delatrie what do you think? |
epszaw
approved these changes
Jul 1, 2025
Contributor
Author
|
Well, I have not looked for that in allure3, but if you want some basic implementation there too, I might look into it. |
This was referenced Aug 1, 2025
Closed
Contributor
Author
|
@baev, thanks much! 🙏 Could you look also into: allure-framework/allure-java#1182 ? They are related. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
In our private
allure2fork, we use thesourcefield of attachments not only for file paths but also to supportdata:,http:,https:, andfile:protocols. Basically, remote-hosted attachment files (or JSON-onlyallure-resultswith no binary ballast).While this works quite well, an optional
sizeproperty would be extremely helpful for remote attachments — it would eliminate the need for HTTP roundtrips usingHEADrequests just to retrieveContent-Lengthwhen generating HTML reports.I wonder, can we find common ground here and consider making this part of the standard?
Checklist