Skip to content

Migrate core Hera classes to dataclasses (dropping Pydantic)#1547

Merged
elliotgunton merged 8 commits intomainfrom
migrate-off-pydantic-v1
Jan 29, 2026
Merged

Migrate core Hera classes to dataclasses (dropping Pydantic)#1547
elliotgunton merged 8 commits intomainfrom
migrate-off-pydantic-v1

Conversation

@elliotgunton
Copy link
Copy Markdown
Collaborator

@elliotgunton elliotgunton commented Jan 20, 2026

Pull Request Checklist

Description of PR
This PR will be used as the base branch for #1544, starting in this PR with the Archive, Env and EnvFrom classes being converted to dataclasses as they are the simplest classes that show the proof of concept for converting to dataclasses (in this case, it's effectively a "one-liner" to remove the BaseModel parent class and use @dataclass instead). And then continuing with the internals of Hera which can be converted without generating new API classes. We can then generate those API classes and fix the minor issues that appear.

@elliotgunton elliotgunton added type:task A general task (including refactors) semver:major A change requiring a major version bump labels Jan 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 92.61745% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.1%. Comparing base (5dc9eaa) to head (0b38d1b).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/hera/workflows/volume.py 92.7% 9 Missing and 6 partials ⚠️
src/hera/workflows/resources.py 82.3% 1 Missing and 5 partials ⚠️
src/hera/workflows/env.py 93.3% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1547     +/-   ##
=======================================
+ Coverage   80.4%   81.1%   +0.6%     
=======================================
  Files         63      63             
  Lines       5144    5267    +123     
  Branches     821     824      +3     
=======================================
+ Hits        4140    4273    +133     
+ Misses       858     847     -11     
- Partials     146     147      +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@elliotgunton elliotgunton force-pushed the migrate-off-pydantic-v1 branch from 9f13642 to 87417b4 Compare January 20, 2026 11:21
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
@elliotgunton elliotgunton force-pushed the migrate-off-pydantic-v1 branch from 87417b4 to 1a6aa96 Compare January 20, 2026 11:27
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
* Remove badly-named deprecated volume classes

Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
@elliotgunton elliotgunton force-pushed the migrate-off-pydantic-v1 branch from aa99286 to 08cccc2 Compare January 20, 2026 13:14
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
@elliotgunton elliotgunton force-pushed the migrate-off-pydantic-v1 branch from 7d555a4 to 3744a3a Compare January 20, 2026 13:53
@elliotgunton elliotgunton marked this pull request as ready for review January 21, 2026 14:00
Copy link
Copy Markdown
Collaborator

@jeongukjae jeongukjae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

Comment thread src/hera/workflows/_mixins.py
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
@elliotgunton elliotgunton merged commit 5586a4f into main Jan 29, 2026
23 checks passed
@elliotgunton elliotgunton deleted the migrate-off-pydantic-v1 branch January 29, 2026 19:46
@elliotgunton elliotgunton changed the title Migrate to dataclasses Migrate core Hera classes to dataclasses Mar 11, 2026
@elliotgunton elliotgunton added type:informational Provides information or notice to the community and removed type:task A general task (including refactors) labels Mar 19, 2026
@elliotgunton elliotgunton changed the title Migrate core Hera classes to dataclasses Migrate core Hera classes to dataclasses (dropping Pydantic) Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major A change requiring a major version bump type:informational Provides information or notice to the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Hera classes and related internals off Pydantic V1

2 participants