Skip to content

Conversation

@royendo
Copy link
Contributor

@royendo royendo commented Jan 13, 2026

  • auto-detect duplicate connector names
  • common creds generated as ${key}_#
    • password, token, dsn are ${driverName}${key}#
  • added feature to let user use '{{ env "key" }}
    • insensitive reference to '{{ env "key" }}, go requires all caps or no ca

PART 2 of this PR will add fallback to OS level creds. In this case, we should add visual warnings to user that this is occurring. Thinking of adding yellow text state.

https://www.loom.com/share/c0b4e5fb20c449058c809b304c66a81b

@royendo royendo mentioned this pull request Jan 13, 2026
8 tasks
@royendo
Copy link
Contributor Author

royendo commented Jan 20, 2026

Code Review

Professionalism & Code Quality: ⭐⭐⭐⭐ (Good)

Strengths:

  • Clean implementation of the env template function with case-insensitive matching
  • Good test coverage for the new env function with multiple edge cases including case-insensitivity tests
  • Well-documented template function in comments

Issues to Address:

  1. Redundant loop for case-insensitive matching in runtime/parser/template.go:280-285:

    // Try case-insensitive match
    for key, value := range data.Variables {
        if strings.EqualFold(key, name) {
            return value, nil
        }
    }

    Consider using a normalized map upfront to avoid O(n) iteration on every lookup.

  2. Renamed but unused parameter _connectorInstanceName in web-common/src/features/connectors/code-utils.ts:128 - If unused, remove it entirely rather than prefixing with _.

E2E Testing: ⚠️ Missing

No E2E tests for the env variable templating behavior.

Recommendations:

  • Add E2E test verifying .env variables are correctly resolved in connector/source YAML files
  • Test the case-insensitive matching behavior from a user perspective

General Comments:

  • The originalEnvBlob tracking in submitAddDataForm.ts is complex but necessary for conflict detection. Consider adding inline comments explaining the flow.
  • Good approach to store pre-computed env blobs for concurrent "Save Anyway" operations.

Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

Approving the backend changes

@royendo royendo requested a review from ericpgreen2 January 22, 2026 16:49
@royendo
Copy link
Contributor Author

royendo commented Jan 22, 2026

thanks!

@ericpgreen2 tagged you for a final review! updated the e2e to expect the new variables and tested the env function

Added 'aws_access_token' to the list of credentials and removed 'privateKey' for Snowflake.
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

Issues

1. Test coverage gap

The new e2e tests (bigquery-connector.spec.ts, motherduck-connector.spec.ts) skip in CI because RILL_RUNTIME_GCS_TEST_GOOGLE_APPLICATION_CREDENTIALS_JSON is not passed to the web-test-e2e.yml workflow—it's only available in the Go test workflows.

This means the core logic (getGenericEnvVarName, findAvailableEnvVarName, makeDotEnvConnectorKey) has no automated test coverage in CI.

Two options:

  • Option A: Add unit tests in code-utils.spec.ts for the pure functions. These don't require credentials and will run in CI.
  • Option B: Add the secret to web-test-e2e.yml so the existing e2e tests run.

2. Unused parameters should be removed

updateDotEnvWithSecrets at code-utils.ts:129 accepts _connectorInstanceName but never uses it. Callers still pass this value (e.g., submitAddDataForm.ts:305), but it's ignored.

Similarly, compileConnectorYAML accepts connectorInstanceName in its options (code-utils.ts:42), but only existingEnvBlob is used.


Future Work

After PR #8632 (Connectors JSON Schema) lands:

  1. Add x-env-var-name to JSON Schema: Rather than hardcoding the genericProperties set in getGenericEnvVarName, each connector schema could specify its env var name explicitly. This makes the schema self-documenting and eliminates the maintenance burden of the hardcoded list.

  2. Clean up compileConnectorYAML: The connector YAML generation logic will likely be rewritten to use the new JSON Schema infrastructure. Having test coverage ensures the behavior doesn't regress during that refactor.


Developed in collaboration with Claude Code

@royendo royendo requested a review from ericpgreen2 January 30, 2026 16:47
@royendo
Copy link
Contributor Author

royendo commented Jan 30, 2026

  1. added a bunch of arbitrary tests to code-utils, required export of new functions
    ✓ |client| src/features/connectors/code-utils.spec.ts (48 tests) 5ms

  2. Removed unused components

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.

4 participants