bujjibabukatta opened a new pull request, #9071:
URL: https://github.com/apache/devlake/pull/9071
### Summary
Fixes #8991 — GitHub Copilot connector's "Test Connection" fails with
either enterprise or organization is required even when a valid Enterprise
Slug is filled in and Organization is left blank.
### Root Cause
validateConnection() checked Organization for emptiness without trimming
it, while HasEnterprise() already trimmed Enterprise. This mismatch meant
a slug with incidental whitespace (e.g. copy/pasted from GitHub) could be
treated as "present" in one check and "empty" in another. A second, separate
copy of this same check in connection_test_helper.go also had a different
error message, showing the two had drifted out of sync.
The frontend's IConnectionAPI/IConnection types were also missing the
enterprise field, and the test/testOld API payload types didn't
include it either — a type-safety gap worth closing alongside this fix.
### Fix
- models/connection.go — trim Organization/Enterprise in Normalize()
- api/connection.go — trim Organization in validateConnection()
- service/connection_test_helper.go — align error message with the above
- api/connection_test.go — added regression tests going through the real
JSON decode path (hyphenated slug, whitespace-only org)
- config-ui/src/types/connection.ts — added missing enterprise field
- config-ui/src/api/connection/index.ts — added enterprise to payload types
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]