-
Notifications
You must be signed in to change notification settings - Fork 14
refactor: cleanup folder config handling and remove obsolete tests #1117
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
base: main
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Summary of ChangesHello @nick-y-snyk, 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 addresses several issues related to folder configuration management, primarily focusing on eliminating race conditions and improving the robustness of configuration handling. The changes simplify how folder configurations are populated and cloned, ensuring consistency and preventing data loss or incorrect states. Additionally, premature auto-save triggers in the UI have been removed to enhance stability during initialization. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 introduces several positive changes to address race conditions in folder configuration handling. The simplifications in config population, the robust cloning of folder settings, and the removal of premature auto-save triggers are all welcome improvements. However, I've identified a potential issue in the FolderConfig.Clone() method where a map is now being shallow-copied, which could lead to unintended side effects. I've also noted a minor formatting inconsistency. Please see my detailed comments below.
| } else { | ||
| dom.addEvent(inputs[i], "blur", formState.triggerChangeHandlers); | ||
| } |
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.
The indentation in this else block is inconsistent with the rest of the file, which appears to use tabs. Using mixed indentation (spaces and tabs) can make the code harder to read and maintain. It's best to stick to a consistent style throughout the file.
| } else { | |
| dom.addEvent(inputs[i], "blur", formState.triggerChangeHandlers); | |
| } | |
| } else { | |
| dom.addEvent(inputs[i], "blur", formState.triggerChangeHandlers); | |
| } |
02faa7b to
a4b0252
Compare
Fixes multiple race conditions and inefficiencies in folder configuration handling: 1. Simplified populateFolderConfigs to use stored configs directly instead of creating empty configs and merging 2. Fixed base_scan.go to properly clone all folder config settings when creating config for scanned directory 3. Removed unnecessary filterFolderConfigs function - filtering now happens at source in populateFolderConfigs 4. Removed premature auto-save trigger during folder org field initialization to prevent race conditions 5. Improved form-state.js event listener setup for better clarity 6. Fixed createNewStoredConfig to use proper Save function instead of direct Set 7. Cleaned up FolderConfig.Clone() implementation to be more consistent These changes ensure folder configs are properly initialized and prevent race conditions during config updates.
a4b0252 to
38b4d04
Compare
Summary
Changes
TestConfigHtmlRenderer_FiltersFolderConfigsNotInWorkspaceandTestConfigHtmlRenderer_NoWorkspaceFiltersAllFolderstests that were testing the removed filtering functionTest plan