Skip to content

Conversation

@noomorph
Copy link
Contributor

@noomorph noomorph commented Aug 1, 2025

Context

This PR adds an optional size field to the io.qameta.allure.model.Attachment class to eliminate HEAD HTTP roundtrips for remote attachments (when they are implemented, of course — but here it is a chicken and egg problem).

This change aligns with ongoing efforts to add optional size support across Allure implementations.
See related PR in allure-js: allure-framework/allure-js#1302

Changes:

  • Added optional Long size field to Attachment class
  • Added getSize() and setSize() methods following existing patterns
  • Field is nullable to maintain backward compatibility

Benefits:

  • Enables efficient attachment handling when size is already known from JSON
  • Eliminates need for reflection-based workarounds
  • Maintains backward compatibility with existing code
  • Follows Allure's established patterns and conventions
  • Supports remote attachment workflows without HTTP roundtrips

Checklist

@baev baev added the type:improvement Change that improves some user experience but can't be considered as a new feature label Sep 10, 2025
@baev baev merged commit eafc1b3 into allure-framework:main Sep 10, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:core theme:model type:improvement Change that improves some user experience but can't be considered as a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants