Skip to content

Conversation

@AthreyVinay
Copy link
Contributor

Resolves #4411

@AthreyVinay AthreyVinay added area | maintenance Changes important for efficiency and the long-term health of the project plugin | bootc The bootc provision plugin ci | full test Pull request is ready for the full test execution labels Dec 11, 2025


class BootcHost(BootcMetadataContainer):
status: Optional[HostStatus] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you revert the order of these definitions for readability? I wonder if we should also put these in a dedicated tmt.model package.

Copy link
Contributor Author

@AthreyVinay AthreyVinay Dec 13, 2025

Choose a reason for hiding this comment

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

I kept the definitions ordered from leaf to root intentionally. Did not want to do string-bsaed forward refs (gaining direct type references without forward annotations).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but it can be distracting. If we go with the tmt.model approach I think it would be good in either ordering since it is more compartmentalized then. Also with __future__.annotations the order should also be arbitrary in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This mostly comes down to readability preference. I’m happy to reorder the models if that’s the general preference, otherwise I’m fine keeping the current layout.

booted = image_status.get('status', {}).get('booted', {})
if not booted:
raise KeyError("'booted' key")
host = BootcHost.from_json(output)
Copy link
Contributor

Choose a reason for hiding this comment

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

try ... except this for json failures or whatnots.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we should fail hard. Happy to let pydantic and json parsing raise.

Copy link
Contributor

Choose a reason for hiding this comment

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

It should fail either way. The question is if you want to have a more friendly error message than what you would get from pydantic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - meant failing hard leaving pydantic handle. Also see the similar question that I had from a similar task: #4356 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | maintenance Changes important for efficiency and the long-term health of the project ci | full test Pull request is ready for the full test execution plugin | bootc The bootc provision plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate bootc status JSON before extracting current image

3 participants