Skip to content

fix(integrations): TrelloConfig inherits StrictConfigModel instead of BaseModel#2671

Open
luojiyin1987 wants to merge 1 commit into
Tracer-Cloud:mainfrom
luojiyin1987:fix/trello-config-strict-model
Open

fix(integrations): TrelloConfig inherits StrictConfigModel instead of BaseModel#2671
luojiyin1987 wants to merge 1 commit into
Tracer-Cloud:mainfrom
luojiyin1987:fix/trello-config-strict-model

Conversation

@luojiyin1987
Copy link
Copy Markdown

@luojiyin1987 luojiyin1987 commented May 30, 2026

Closes #2670

TrelloConfig in app/integrations/trello.py inherits from pydantic.BaseModel directly, while every other integration config model in the project (81 usages) inherits from StrictConfigModel.

Changes

  • Replace BaseModel with StrictConfigModel
  • Add from app.strict_config import StrictConfigModel import

TrelloConfig now gains:

  • Unknown field rejection with helpful suggestions
  • Automatic string stripping

@github-actions
Copy link
Copy Markdown
Contributor

Greptile code review

This repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md.

Run a review — add a PR comment with:

@greptile review

Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5.

Optional: automate with the greploop skill.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 30, 2026

Greptile Summary

This PR fixes a consistency gap where TrelloConfig was the only integration config in the project inheriting directly from pydantic.BaseModel rather than the shared StrictConfigModel. The fix brings it in line with all other integrations.

  • TrelloConfig now inherits StrictConfigModel, gaining extra=\"forbid\" (unknown-field rejection with "did you mean?" suggestions) and automatic string stripping on all fields.
  • The existing _normalize_base_url field validator is fully compatible with StrictConfigModel's _strip_string_values wildcard validator — both operate in mode=\"before\" and the stripping is idempotent, so behaviour for valid inputs is unchanged.

Confidence Score: 5/5

Safe to merge — a one-line base-class change with no behavioral regression for valid inputs.

The change is minimal and well-scoped: swapping the base class adds stricter validation without altering how any existing valid config is processed. The two mode="before" string-stripping validators are fully compatible and idempotent when composed. No other code paths are touched.

No files require special attention.

Important Files Changed

Filename Overview
app/integrations/trello.py TrelloConfig base class changed from pydantic.BaseModel to StrictConfigModel, adding unknown-field rejection with suggestions and auto-string stripping, consistent with all other integration configs in the project.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class BaseModel {
        <<pydantic>>
    }
    class StrictConfigModel {
        +model_config: ConfigDict(extra="forbid")
        +_strip_string_values(value) Any
        +_reject_unknown_fields(data) Any
    }
    class TrelloConfig {
        +base_url: str
        +api_key: str
        +token: str
        +board_id: str
        +list_id: str
        +timeout_seconds: float
        +_normalize_base_url(value) str
        +api_base_url: str
    }
    BaseModel <|-- StrictConfigModel : inherits
    StrictConfigModel <|-- TrelloConfig : inherits (after fix)
    note for TrelloConfig "Previously inherited BaseModel directly"
Loading

Reviews (1): Last reviewed commit: "fix(integrations): TrelloConfig inherits..." | Re-trigger Greptile

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.

fix(integrations): TrelloConfig should inherit StrictConfigModel

1 participant