Merged
Conversation
Contributor
There was a problem hiding this comment.
The refactor is generally clean and well-structured. Two issues were raised: (1) the assert for unsupported format types fires synchronously before the .catch() error-logging handler, causing unsupported-format errors to be silently swallowed without logging; and (2) extractServiceName and extractCompilerType redundantly parse the same URL twice, which is also fragile for non-.json extensions — these should share a single parse.
PR Bot Information
Version: 1.17.99 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback
- Correlation ID:
1a62a280-1c4c-11f1-9007-7e27141b47b4 - Event Trigger:
pull_request.opened - Agent Instructions:
- LLM:
anthropic--claude-4.6-sonnet
mlakov
commented
Mar 10, 2026
457344a to
467d034
Compare
zongqichen
reviewed
Mar 13, 2026
Contributor
zongqichen
left a comment
There was a problem hiding this comment.
Solid refactor and clean some legacy bugs or codes, appreciate it. Some comments we can discuss.
509ba3c to
f23d7ac
Compare
f23d7ac to
943d938
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
♻️ Refactor
metaData.jswith Frozen Compiler Map and Modernized TestsRefactor
Replaced the large
switchstatement inmetaData.jswith a frozencompilersmap for cleaner, more maintainable metadata compilation logic. Also modernized test assertions to use idiomatic async Jest patterns throughout the test suite.Changes
lib/metaData.js:pathmodule import and reorderedassert/cdscdeclarations for better organization.extractServiceName(url)andextractCompilerType(url)as standalone helper functions, replacing inline URL parsing logic._getServersFromAnnotationhelper and theswitch-based compiler dispatch; replaced with a frozencompilersobject (Object.freeze) mapping eachCOMPILER_TYPESkey to its own async handler.contentType, eliminating the manual content type derivation logic previously inferred from the compiler name..catch()with a unified log message:Compilation failed for service ${serviceName} (compiler: ${compilerType}) - ${error.message}.__tests__/unit/metaData.test.js:try/catchassertion patterns withawait expect(...).rejects.toThrow(...)for idiomatic async Jest error testing.const result = await ...; expect(result)...patterns withawait expect(...).resolves.toEqual(...)for cleaner async success assertions."getMetadata should handle invalid URL format"test case (the explicit"Invalid URL format"error no longer exists)."getMetadata should raise error when get edmx failed"to"getMetadata should raise error when get OpenAPI failed"to align with the updated test URL and error.📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!
PR Bot Information
Version:
1.18.5| 📖 Documentation | 🚨 Create Incident | 💬 Feedbackpull_request.editedanthropic--claude-4.6-sonnet26e52080-1e60-11f1-9318-c014ee0ee278