Skip to content

Migrate mixin classes to dataclasses#1548

Merged
elliotgunton merged 11 commits intomainfrom
migrate-mixin-classes
Feb 4, 2026
Merged

Migrate mixin classes to dataclasses#1548
elliotgunton merged 11 commits intomainfrom
migrate-mixin-classes

Conversation

@elliotgunton
Copy link
Copy Markdown
Collaborator

@elliotgunton elliotgunton commented Jan 21, 2026

Pull Request Checklist

Description of PR
Migrate the remaining core components of Hera that involve the use of the "Mixins".

@elliotgunton elliotgunton marked this pull request as ready for review January 21, 2026 14:00
@elliotgunton elliotgunton changed the title Migrate mixin classes Migrate mixin classes to dataclassers Jan 21, 2026
@elliotgunton elliotgunton changed the title Migrate mixin classes to dataclassers Migrate mixin classes to dataclasses Jan 21, 2026
@elliotgunton elliotgunton added type:enhancement A general enhancement semver:major A change requiring a major version bump type:task A general task (including refactors) and removed type:enhancement A general enhancement labels Jan 21, 2026
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/_cli/generate/python.py
Comment thread src/hera/workflows/_mixins.py
Comment thread src/hera/workflows/_mixins.py Outdated
Comment thread src/hera/workflows/container.py Outdated
Comment thread tests/test_unit/test_pydantic_io_mixins.py Outdated
Comment thread tests/test_unit/test_context.py Outdated
Base automatically changed from migrate-off-pydantic-v1 to main January 29, 2026 19:46
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
* `test_unit` folder all passing
* Artifact and Parameter remaining to migrate

Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
* Temporarily disable roundtrip check in tests (CronWorkflow tests failing)
* All test_hera_output tests passing

Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
* Due to extra="forbid" on the model, I discovered various typos and invalid
  code. e.g. `Artifact` never had a `description`, even though it was in the tests

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-mixin-classes branch from 460d9c5 to 6276088 Compare January 29, 2026 19:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 94.78261% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.3%. Comparing base (5586a4f) to head (962e4b5).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/hera/workflows/_mixins.py 90.0% 4 Missing and 2 partials ⚠️
src/hera/workflows/script.py 83.7% 2 Missing and 4 partials ⚠️
src/hera/workflows/_meta_mixins.py 75.0% 3 Missing ⚠️
src/hera/workflows/workflow.py 93.1% 1 Missing and 1 partial ⚠️
src/hera/workflows/parameter.py 94.7% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1548     +/-   ##
=======================================
+ Coverage   81.1%   81.3%   +0.2%     
=======================================
  Files         63      63             
  Lines       5267    5362     +95     
  Branches     824     825      +1     
=======================================
+ Hits        4273    4361     +88     
- Misses       847     852      +5     
- Partials     147     149      +2     

☔ 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-mixin-classes branch from de91624 to 27c715f Compare January 29, 2026 21:40
* Plus other tidy ups

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-mixin-classes branch from 27c715f to 57be54b Compare January 29, 2026 22:02
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
@elliotgunton elliotgunton merged commit 41dd2dc into main Feb 4, 2026
23 checks passed
@elliotgunton elliotgunton deleted the migrate-mixin-classes branch February 4, 2026 14:15
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:task A general task (including refactors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Hera classes and related internals off Pydantic V1

2 participants