Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[TT-18717] Pass the Postgres MCP analytics DSN to API tests #176
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
Uh oh!
There was an error while loading. Please reload this page.
[TT-18717] Pass the Postgres MCP analytics DSN to API tests #176
Changes from all commits
1fabe65File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check warning on line 52 in .github/actions/tests/api-tests/action.yaml
security Issue
Raw output
Avoid hardcoding the DSN. Instead, pass the full connection string as a dedicated input to the action. This allows the calling workflow to control the connection parameters, sourcing them from environment variables or secrets as needed, which is more secure and flexible. Example implementation: In `action.yaml`: ```yaml inputs: # ... mcp-postgres-dsn: description: 'Postgres DSN for MCP analytics tests.' required: false # ... inside the run step: if [[ "${{ inputs.db }}" == postgres* && -n "${{ inputs.mcp-postgres-dsn }}" ]]; then echo "TYK_TEST_MCP_POSTGRES_DSN=${{ inputs.mcp-postgres-dsn }}" >> pytest.env fi ``` The calling workflow would then be responsible for providing the correct DSN.Check warning on line 52 in .github/actions/tests/api-tests/action.yaml
architecture Issue
Raw output
To improve flexibility, make the DSN configurable by adding a new action input (e.g., `mcp-postgres-dsn`) with the current value as a default. This allows different environments to override the DSN without changing the action's code. Then, use the input in the script: `echo "TYK_TEST_MCP_POSTGRES_DSN=${{ inputs.mcp-postgres-dsn }}" >> pytest.env`.Check warning on line 53 in .github/actions/tests/api-tests/action.yaml
architecture Issue
Raw output
To improve configurability and transparency, extract the DSN into a new action input, using the current hard-coded value as its default. This makes the configuration explicit, self-documenting, and allows for overrides when necessary. 1. Add a new input to the `inputs` section: ```yaml postgres_mcp_dsn: description: 'DSN for MCP analytics tests on Postgres. Used when `db` starts with `postgres`.' required: false default: 'postgresql://postgres@localhost:5432/tyk_analytics?sslmode=disable' ``` 2. Use this new input in the run step: ```bash if [[ "$DB" == postgres* ]]; then echo "TYK_TEST_MCP_POSTGRES_DSN=${{ inputs.postgres_mcp_dsn }}" >> pytest.env fi ```Check failure on line 57 in .github/actions/tests/api-tests/action.yaml
template-injection
Uh oh!
There was an error while loading. Please reload this page.