Skip to content

Fix default config and improve logging for debuggability#3597

Open
Aniruddh25 wants to merge 7 commits into
mainfrom
dev/anmunde/fixDefaultConfig
Open

Fix default config and improve logging for debuggability#3597
Aniruddh25 wants to merge 7 commits into
mainfrom
dev/anmunde/fixDefaultConfig

Conversation

@Aniruddh25
Copy link
Copy Markdown
Collaborator

Why make this change?

  • Closes [Bug]: Critical! Default image config is not usable. #3593
  • Add default dab-config.json to Docker image #3168 attempted to add a simplified dab config to the docker image build. However, the official image that is built internally picks up the dab-config.json from the binaries built folder.
  • That is why the generic dab-config.json should move to src/Service and replace the unusable previous dab-config.json that was specific to Aspire project. This way the generic dab-config gets copied into the publish folder and lands in the official docker image

What is this change?

Configuration and Environment Variable Changes:

  • Changed environment variable for database connection strings from ConnectionStrings__Database to DAB_CONNSTRING throughout the codebase, ensuring consistency and aligning with Data API Builder conventions (src/Aspire.AppHost/AppHost.cs, src/Service/dab-config.json). [1] [2] [3]
  • Set the database type explicitly to mssql in dab-config.json instead of using an environment variable, simplifying configuration for local development (src/Service/dab-config.json).

Entity Management Simplification:

  • Removed explicit entity definitions and relationships in favor of autoentities with a default pattern that includes all schema objects, drastically reducing manual configuration and making the setup more maintainable (dab-config.json, src/Service/dab-config.json). [1] [2]
  • Added a pattern in autoentities to automatically include all objects and generate entity names in the format {schema}_{object} (dab-config.json, src/Service/dab-config.json). [1] [2]

Access and Security Relaxations for Development:

  • Updated CORS settings to allow all origins by default, making APIs accessible from any client during development (dab-config.json, src/Service/dab-config.json). [1] [2]
  • Changed authentication provider to Unauthenticated and allowed all actions for the anonymous role, making the API open by default for easier testing (dab-config.json, src/Service/dab-config.json). [1] [2]

Minor Improvements:

  • Improved error messaging for GraphQL name violations by including the entity name in the exception message (src/Core/Services/MetadataProviders/SqlMetadataProvider.cs).
  • Disabled strict request body validation for REST endpoints to allow more flexible payloads during development (src/Service/dab-config.json).

How was this tested?

  • Used the default config to start dab on a local SQL Server and ensured all endpoints were working. Once merged, will build a test docker image from internal buddy pipeline to verify inclusion.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the unusable default dab-config.json shipped in the official Docker image by replacing the Aspire-specific config at src/Service/dab-config.json (the file actually picked up during the official image build) with a generic, autoentities-based config. Also standardizes the DB connection-string environment variable name and improves a GraphQL name-violation error message.

Changes:

  • Replace entity-specific dev config in src/Service/dab-config.json with a generic mssql + autoentities config matching the repo-root dab-config.json.
  • Rename ConnectionStrings__Database to DAB_CONNSTRING in Aspire AppHost wiring, and relax the root dab-config.json (CORS *, anonymous *, autoentities pattern).
  • Include entity name in the GraphQL column name-violation error message for better debuggability.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Service/dab-config.json Replaces Aspire-specific entity config with generic mssql/autoentities config baked into the Docker image.
dab-config.json Adds autoentities.patterns, opens CORS to *, and broadens anonymous permissions to *.
src/Aspire.AppHost/AppHost.cs Renames the connection-string env var to DAB_CONNSTRING for both mssql and pg services.
src/Core/Services/MetadataProviders/SqlMetadataProvider.cs Adds entity name to the GraphQL column name-violation exception message.

Comment thread src/Service/dab-config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Critical! Default image config is not usable.

4 participants