Skip to content

Refactor Container Index JSON Loader: Move to Config Package & Switch to Pydantic #1092

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 10 commits into from
Mar 6, 2025

Conversation

mrDzurb
Copy link
Member

@mrDzurb mrDzurb commented Mar 2, 2025

Description

This PR enhances the container index JSON loader by moving it from the UI module to the config package and refactoring it to use Pydantic instead of dataclasses.

Key Changes

  • Moved the container index JSON loader to the config package for better organization.
  • Refactored the implementation from dataclasses to Pydantic, enabling stricter validation, better serialization, and extensibility.
  • Updated unit tests to reflect the new implementation while maintaining existing functionality.

@oracle-contributor-agreementoracle-contributor-agreement bot added the OCA VerifiedAll contributors have signed the Oracle Contributor Agreement.label Mar 2, 2025
@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 2, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.45%

@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 4, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.45%

@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 4, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.45%

@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 5, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.45%

@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 5, 2025

📌 Cov diff with main:

Coverage-98%

📌 Overall coverage:

Coverage-58.60%

mayoor
mayoor previously approved these changes Mar 5, 2025
qiuosier
qiuosier previously approved these changes Mar 5, 2025
@@ -45,7 +38,7 @@ def get(
400, Errors.MISSING_REQUIRED_PARAMETER.format("model_format")
)
try:
model_format = ModelFormat(model_format.upper())
model_format = model_format.upper()
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this code is no longer checking if the model format is valid? In that case, I guess there is no need to have try/except for upper()?

-------
AquaContainerConfig: The constructed container configuration.
"""
# if not config:
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this? I see you are adding config=get_container_config() in every call instead. So the config should not be None anymore. Or maybe having a default is better?

@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 5, 2025

📌 Cov diff with main:

Coverage-98%

📌 Overall coverage:

Coverage-58.60%

kumar-shivam-ranjan
kumar-shivam-ranjan previously approved these changes Mar 5, 2025
@mrDzurbmrDzurb dismissed stale reviews from kumar-shivam-ranjan, qiuosier, and mayoor via dd15934 March 5, 2025 19:19
@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 5, 2025

📌 Cov diff with main:

Coverage-92%

📌 Overall coverage:

Coverage-58.60%

@mrDzurbmrDzurb enabled auto-merge March 5, 2025 23:32
@mrDzurbmrDzurb merged commit 1a81431 into main Mar 6, 2025
2 of 3 checks passed
@github-actionsGitHub Actions
Copy link

-actions bot commented Mar 6, 2025

📌 Cov diff with main:

No lines with coverage information in this diff.

📌 Overall coverage:

Coverage-58.60%

Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
OCA VerifiedAll contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants