-
Notifications
You must be signed in to change notification settings - Fork 457
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
fix(expand-extensions): use the Application's project #5106
base: main
Are you sure you want to change the base?
Conversation
Fixes LP bug https://bugs.launchpad.net/snapcraft/+bug/2083964 Instead of parsing the project again itself, expand-extensions now uses the project provided by the application. The output is changed slightly, but I believe it reflects a more accurate expansion.
b165507
to
c64cea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had been putting off this review because it was in draft, but this is the correct fix and looks ready-to-rock.
This failure is a consequence of using pydantic validators to modify the data here. There's probably not a way around this error besides removing that validator. |
@mr-cal as a note I had to change some other tests for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is exposing chain of errors! I suspect we have been using the wrong expand-extensions
for core20 snaps for a long time, but never noticed.
We have this check to raise a ClassicFallback
, but we are missing the next check to raise a LegacyFallback
.
list-plugins
is similar, I think you can steal these lines.
@pydantic.field_validator("build_base") | ||
@classmethod | ||
def _validate_build_base( | ||
cls, value: str | None, info: pydantic.ValidationInfo | ||
) -> str | None: | ||
"""Build-base defaults to the base value if not specified.""" | ||
return value or info.data.get("base") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heck yeah. This should be safe to remove and should be removed, so thanks for yanking off the bandage!
Fixes LP bug https://bugs.launchpad.net/snapcraft/+bug/2083964
Instead of parsing the project again itself, expand-extensions now uses the project provided by the application. The output is changed slightly, but I believe it reflects a more accurate expansion.
tox run -m lint
?tox run -e test-py310
? (supported versions:py39
,py310
,py311
,py312
)