Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

NAS-131559 / 25.04 / Remove accepts style decorator from apps plugin #15225

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

Qubad786
Copy link
Contributor

Context

Removes accept style decorator from app plugin.

@Qubad786 Qubad786 requested a review from a team December 17, 2024 20:33
@bugclerk bugclerk changed the title Remove accepts style decorator from apps plugin NAS-131559 / 25.04 / Remove accepts style decorator from apps plugin Dec 17, 2024
@bugclerk
Copy link
Contributor

src/middlewared/middlewared/api/v25_04_0/app.py Outdated Show resolved Hide resolved
pass


class AppContainerIDResult(BaseModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

We should try and keep Args and Result model pairs together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and that is indeed my intention but then for the result model we need to have another base model which is what is in between the args/result model. If we keep the args/result together then the models which are only used for these 2 will have to live some where else and it looked messy to me that way. So for example here is what i am proposing:

Args model

Some models required for result if any

Result model

Copy link
Contributor

Choose a reason for hiding this comment

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

It does get hairy with lots of extra models so I can see where you're coming from. The NEP proposes this structure:

Entry model (if applicable)

All extra models

Args and Result pairs in alphabetical order

Granted, this does separate Args/Result models from their relevant helper models so I don't want to be the style police on this one.

@Qubad786 Qubad786 merged commit 9ef345f into master Dec 31, 2024
2 checks passed
@Qubad786 Qubad786 deleted the NAS-131559 branch December 31, 2024 10:49
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants