Skip to content

refactor(internal/sidekick/parser): migrate sidekick parsers to use ModelConfig#3941

Merged
jameslynnwu merged 2 commits intomainfrom
create-model-config
Feb 7, 2026
Merged

refactor(internal/sidekick/parser): migrate sidekick parsers to use ModelConfig#3941
jameslynnwu merged 2 commits intomainfrom
create-model-config

Conversation

@jameslynnwu
Copy link
Contributor

This commit updates parser.CreateModel to use ModelConfig instead of sidekickconfig.Config.

Part of #3662

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 refactors the sidekick parsers by introducing a new ModelConfig struct to decouple them from the broader sidekickconfig.Config, enhancing separation of concerns and explicitness of dependencies. While the refactoring is well-executed and clean, several security concerns were identified: file paths from configurations are used in file operations across multiple parsers without sufficient validation, which could lead to Path Traversal vulnerabilities if untrusted repositories or configurations are processed. As per repository guidelines (Rule: Sanitize inputs for code generation templates), it is strongly recommended to implement robust path validation and sanitization for all specification and configuration sources. Additionally, following repository Go style guidelines (Rule: All exported types and fields in Go should have doc comments), documentation should be added to the new ModelConfig to clarify its usage for future developers.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.35%. Comparing base (9d04c44) to head (e79ece0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3941   +/-   ##
=======================================
  Coverage   83.35%   83.35%           
=======================================
  Files          69       69           
  Lines        6188     6188           
=======================================
  Hits         5158     5158           
  Misses        671      671           
  Partials      359      359           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jameslynnwu jameslynnwu marked this pull request as ready for review February 6, 2026 17:45
@jameslynnwu jameslynnwu requested review from a team as code owners February 6, 2026 17:45
… ModelConfig

This commit updates parser.CreateModel and internal/sidekick/parser configs to use a structured ModelConfig instead of a sidekickconfig.Config. This allows generator specific code to separate from the common logic.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: James Wu <jameslynnwu@users.noreply.github.com>
@jameslynnwu jameslynnwu merged commit 4e2fdfc into main Feb 7, 2026
15 checks passed
@jameslynnwu jameslynnwu deleted the create-model-config branch February 7, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants