Skip to content

Decouple Report Generation from BuildResult Field Dependencies #933

Open
@zewei-wang

Description

@zewei-wang

Currently, the to_dict() method in BuildResult from results.py sets the 'compiles' field to self.success instead of self.compiles. This is due to legacy reasons — report generation expects a 'compiles' field that implies not just the compiles, but also binary_exists and is_function_referenced.

This tight coupling between BuildResult internals and report generation logic is confusing and error-prone.

We propose to decouple the report generation logic from specific fields in BuildResult, potentially by introducing an abstraction layer or adapter. This would allow future refactoring of result classes without needing to update report logic each time.

Motivation:

  • Clarify field semantics (success, compiles, etc.)
  • Improve maintainability
  • Avoid confusion for future developers
  • Align with best practices (e.g., similar to OpenAPI generator decoupling patterns)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions