- Notifications
You must be signed in to change notification settings - Fork387
chore: renameProjectModel toPackageModel#4851
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
While browsing the source code, Tim and I found that `ProjectModel` is a pretty confusing name, since:- We don't have projects anymore, but workspaces- It's also not the data of the workspace, but rather data specific to one packageWe propose to rename it to `PackageModel`
2507e50 toe881131Compare
baszalmstra left a comment
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.
Should we also remove the version suffix?
Hofer-Julian commentedOct 29, 2025
Maybe? What was the original idea to have them? |
baszalmstra commentedOct 29, 2025
Excellent question. Initially we negotiated the version using the protocol itself. That meant that the protocol types had to support multipe versions. Now that we use a package version for this I think we can greatly simplify this. |
tdejager commentedOct 29, 2025
We still need something like it if we want to support a range of build api versions in pixi right? |
baszalmstra commentedOct 29, 2025
Yes, we currently define a lower and upper limit of versions. The types in the crate should support those. |
| /// it is highly recommended to use this field. Otherwise, it will be very | ||
| /// easy to break backwards compatibility. | ||
| pubproject_model:Option<VersionedProjectModel>, | ||
| pubpackage_model:Option<PackageModel>, |
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.
@baszalmstra@tdejager this would be a breaking change.
I see two ways of proceeding with this:
- bump pixi_api_version requirement from
>=1,<=2to>=3,<=3. This would mean that we couldn't use new pixi releases anymore with older backends. This would make it pretty annoying to debug this issue for example:pixi-build-rattler-build0.3.4 breaks Pixi GUI build pixi-build-backends#445 - add a new function initialize_v2
What do you say?
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.
Option 3 is to just not break this interface, keep the nameproject_model and change the serialization ofPackageModel to be the same asVersionedProjectModel
Hofer-JulianOct 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Option 3 would be nicer with@wolfv's suggestion to use#[serde(rename = ...)] for the field name, and introduce another type that serializes to the same asVersionedProjectModel.
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 am very strictly against breaking this API for no good reason (and renaming is not a good reason). It would be highly annoying to have to rebuild all backends (IIUC).
You can rename fields with serde so IMO it should be possible to keep things possible, even if renamed?
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.
You need to add a superfluous field, which will be unused from then on out. Why are you against breaking the API? That's the whole reason we are versioning the API :)
I we deviate from the schema, the schema in this case (because the model.py has not been updated in a while) being the code, then it becomes in-transparent for anyone wanting to replicate the types, that does not use our rust types directly.
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.
If its such a huge problem than I would just keep it as is.
I would opt for >=3
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 would just do the break we want to do for the (lock-file-v7/dev) and this change in one go and the go for >=3 as Bas is saying.
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.
And in the future I think we need better standardization for upgrades like this, because if pixi build is out of preview. These things are going to be cumbersome.
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 think a good experience would be if we are compatible with at least the previous version of pixi-build-api for some time, but of course that's only really necessary once we exit thepreview phase.
Maybe I am stressing out too much about this, but IMO it feels like a break for "nothing" (and a break always means work because then we have to release all the backends, ..., talk to other backend implementors, ...) and we have a lot of other highly impactful things on our plates (while this would be mostly cleanup & eye candy).
| ///Package model that the backend should use even though it is an option | ||
| /// it is highly recommended to use this field. Otherwise, it will be very | ||
| /// easy to break backwards compatibility. | ||
| pubproject_model:Option<VersionedProjectModel>, |
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.
you can use#[serde(rename = ...)]?
Or how is this breaking?
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.
you can use
#[serde(rename = ...)]? Or how is this breaking?
Yeah, that's an easy way around for the field name.
The other breaking thing is thatVersionedProjectModel serializes to something like1 { ...content_of_project_model }. Adapting this to be the same is described as option 3 above
Uh oh!
There was an error while loading.Please reload this page.
While browsing the source code,@tdejager and I found that
ProjectModelis a pretty confusing name, since:We propose to rename it to
PackageModelAI disclosure
Nearly all of it is generated by codex