Skip to content

refactor(dart): migrate to ModelConfig#3947

Open
jameslynnwu wants to merge 1 commit intomainfrom
migrate-dart
Open

refactor(dart): migrate to ModelConfig#3947
jameslynnwu wants to merge 1 commit intomainfrom
migrate-dart

Conversation

@jameslynnwu
Copy link
Contributor

@jameslynnwu jameslynnwu commented Feb 7, 2026

Transitions Dart generation from sidekickconfig.Config to parser.ModelConfig

Part of #3662

Transitions Dart generation from sidekickconfig.Config to parser.ModelConfig. Replaces toSidekickConfig with toModelConfig and updates the generator signatures to accept the codec map directly.
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 Dart generation logic to use parser.ModelConfig instead of sidekickconfig.Config. The changes are clean, consistent, and improve decoupling by reducing dependencies on the larger configuration structure. I've suggested one minor improvement to respect the SpecificationFormat from the library configuration instead of hardcoding it.

Comment on lines +51 to +57
modelConfig := parser.ModelConfig{
SpecificationFormat: "protobuf",
ServiceConfig: api.ServiceConfig,
SpecificationSource: ch.Path,
Source: src,
Codec: buildCodec(library),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The SpecificationFormat is currently hardcoded to "protobuf". It would be better to respect the SpecificationFormat field from the library config, which allows for other formats like "discovery". The default can remain "protobuf" if the field is not set.

Suggested change
modelConfig := parser.ModelConfig{
SpecificationFormat: "protobuf",
ServiceConfig: api.ServiceConfig,
SpecificationSource: ch.Path,
Source: src,
Codec: buildCodec(library),
}
specFormat := library.SpecificationFormat
if specFormat == "" {
specFormat = "protobuf"
}
modelConfig := parser.ModelConfig{
SpecificationFormat: specFormat,
ServiceConfig: api.ServiceConfig,
SpecificationSource: ch.Path,
Source: src,
Codec: buildCodec(library),
}

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.35%. Comparing base (4e2fdfc) to head (c5beb3b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3947   +/-   ##
=======================================
  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 7, 2026 02:42
@jameslynnwu jameslynnwu requested review from a team as code owners February 7, 2026 02:42
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.

1 participant