Repository navigation
fix: resolve the AssetDB data source by name #70
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,9 +30,23 @@ class Settings(BaseSettings): | |
| ), | ||
| ) | ||
|
|
||
| assetdb_datasource: int = Field( | ||
| default=1, | ||
| description="AssetDB datasource", | ||
| assetdb_datasource: int | None = Field( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be explicitly deprecated?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Left it in, but I'd argue it either way — here's the reasoning so you can overrule. Against keeping it: it has no consumer. Platform's companion PR removes the only place that set it, and nothing else in the tree or the deployment configs does. The case it used to cover ("this deployment's id isn't 1") is now covered by the lookup, and the case where the source is named something else is covered by For keeping it: it's a three-line escape hatch for a lookup that has never run in production. If My inclination is to leave it undeprecated until the lookup has some production mileage, then drop it outright rather than deprecate-then-remove, given there are no external consumers to stage for. Happy to mark it deprecated now if you'd rather signal it early — say the word and I'll push it. |
||
| default=None, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: README.md and CLAUDE.md still say AssetDB defaults to ID 1 and omit the name setting. Update both configuration descriptions to document the Prompt for AI agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid — fixed in 3b29a57. Both files did still say the id defaults to 1 and omit the name setting; both now document the two override paths. |
||
| description=( | ||
| "Redash data source id to query, for a deployment that needs to name one " | ||
| "explicitly. Left unset, the id is looked up by name -- see " | ||
| "assetdb_datasource_name -- which is what every Stacklet deployment wants: " | ||
| "Redash assigns the id at creation, so it differs between deployments and " | ||
| "cannot be assumed." | ||
| ), | ||
| ) | ||
| assetdb_datasource_name: str = Field( | ||
| default="AssetDB", | ||
| description=( | ||
| "Name of the Redash data source to resolve an id from, used when " | ||
| "assetdb_datasource is unset. Matches the name Stacklet provisions, which " | ||
| "is stable across deployments in the way the id is not." | ||
| ), | ||
| ) | ||
|
Comment on lines
+33
to
50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The shipped default now resolves the data source by name instead of defaulting its ID to Prompt To Fix With AIThis is a comment left during a code review.
Path: stacklet/mcp/settings.py
Line: 33-50
Comment:
**Configuration guide is stale**
The shipped default now resolves the data source by name instead of defaulting its ID to `1`, but the repository's configuration guide still documents `STACKLET_MCP_ASSETDB_DATASOURCE` as defaulting to `1` and does not mention the new name setting. This can lead operators to expect behavior the server no longer has; update the configuration reference to match these settings.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid — fixed in 3b29a57. |
||
| assetdb_allow_save: bool = Field( | ||
| default=False, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.