-
Notifications
You must be signed in to change notification settings - Fork 21
revert: switch back to the legacy mediatype for v0.1.0 #287
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
Conversation
Signed-off-by: chlins <chlins.zhang@gmail.com>
Summary of ChangesHello @chlins, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a revert to ensure compatibility with the legacy mediatype for version 0.1.0. It primarily involves switching the model specification package from "github.com/modelpack/model-spec/specs-go/v1" back to "github.com/dragonflyoss/model-spec/specs-go/v1". Additionally, it introduces explicit handling for these legacy types and annotations to maintain backward compatibility within the system. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request primarily updates the model specification dependency from github.com/modelpack/model-spec/specs-go/v1 to github.com/dragonflyoss/model-spec/specs-go/v1 and adds backward compatibility for legacy annotations. The changes are mostly straightforward dependency updates across several files. However, I've identified a critical bug in the sorting logic within pkg/backend/processor/base.go due to a copy-paste error, which would cause incorrect sorting of descriptors. I've provided a fix for this issue. It's also worth noting that the pull request title and description seem to be contradictory, which could cause confusion. The title suggests a revert, while the description and code changes indicate a migration to a new package.
aftersnow
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.
lgtm
This pull request updates the codebase to use the
github.com/dragonflyoss/model-spec/specs-go/v1package instead of the deprecatedgithub.com/modelpack/model-spec/specs-go/v1for model specifications. Additionally, it introduces compatibility with legacy model spec types and annotations where appropriate. The changes ensure consistency and future compatibility with the new model spec source.Migration to new model spec package:
github.com/modelpack/model-spec/specs-go/v1have been updated to usegithub.com/dragonflyoss/model-spec/specs-go/v1across backend and test files, includingattach.go,build.go,builder.go, processor files, and test mocks. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Legacy model spec compatibility:
pkg/backend/attach.go, references to model spec types and constants have been updated to uselegacymodelspecinstead ofmodelspecfor media types and model config structures, ensuring backward compatibility. [1] [2] [3]pkg/backend/processor/base.go, sorting logic for descriptors now checks both the new and legacy annotation keys for file paths, improving compatibility with older model spec annotations. [1] [2]