fix: filter out deleted but referenced variables - #57
Conversation
Add logic in ColorsVariablesLoader to skip variables marked as deletedButReferenced in Figma responses. Extend VariableValue with a deletedButReferenced property to track this status. Update test helpers and add a test case to ensure that deleted but referenced variables are not included in loader results. The change prevents errors from attempting to load variables that are no longer active.
Summary of ChangesHello @alexey1312, 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 enhances the color variable loading process by introducing a mechanism to gracefully handle variables that have been marked as deleted but are still referenced. This ensures that deprecated or removed variables are not processed, improving data integrity and preventing potential issues from stale data. The changes include updates to the variable model, the loading logic, and comprehensive test coverage to validate the new behavior. Highlights
Changelog
Activity
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.
Code Review
This pull request correctly filters out 'deleted but referenced' variables. The changes to the model and loader are appropriate, and the new test case effectively validates the behavior. I've included a couple of suggestions for improvement. One is a performance and readability enhancement in the ColorsVariablesLoader. The other is a suggestion to improve the robustness of the test helpers by using JSONEncoder instead of manual string building for JSON, which is becoming more fragile with these changes.
c2cfa43 to
999ef24
Compare
This pull request introduces support for handling "deleted but referenced" variables in the color variables loading process. The main change ensures that variables marked as deleted (but still referenced elsewhere) are skipped during loading, improving data accuracy and preventing deprecated variables from being processed. The update also includes new tests to validate this behavior and supporting changes to the model and test helpers.
Support for "deleted but referenced" variables:
deletedButReferencedproperty to theVariableValuemodel to represent variables that are deleted but still referenced elsewhere.ColorsVariablesLoaderto skip variables wheredeletedButReferencedistrueduring the loading process.Testing and test helpers:
VariablesMeta.makeWithAliasestest helper to accept a list of deleted variable IDs and include thedeletedButReferencedflag in generated test data. [1] [2]testSkipsDeletedButReferencedVariables, to verify that deleted-but-referenced variables are not loaded byColorsVariablesLoader.