Skip to content

Avoid rewriting generated files when their final content is unchanged#3787

Description

@aqeelat

Description

Running orval repeatedly with unchanged inputs rewrites generated files even when the final output is identical.

Current behavior

Repeated generation updates file modification times across the output directory. This can trigger downstream file watchers and rebuilds, create timestamp noise, and perform unnecessary filesystem work.

Some generated barrel files already avoid writes when their content is unchanged, but that behavior is not applied consistently to all generated artifacts.

Discussion

One direction would be to compare the final generated content with the existing file and skip the write when they are identical.

This could be default behavior rather than an onlyUpdateWhenDifferent option: rewriting an unchanged artifact does not provide useful output. Alternatively, an opt-in option would preserve current behavior for users who rely on write events.

This is separate from version-stamp churn. If generated content genuinely differs, including because of a versioned header, the file would still be rewritten.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions