mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-29 01:41:42 +00:00
fix(group): tidy thrift source-scan identifiers
This commit is contained in:
parent
476af9b152
commit
e81546db29
4 changed files with 10 additions and 3 deletions
|
|
@ -228,7 +228,10 @@ export class ManifestExtractor {
|
|||
} else if (link.type === 'grpc' || link.type === 'thrift') {
|
||||
// Contract is "Service/Method" or just "Service" (or package.Service
|
||||
// variants). Prefer matching by method name when present, otherwise
|
||||
// by service name. NO IDL path fallback — that's guaranteed to
|
||||
// by service name. Thrift generated Java classes often use
|
||||
// package.Service in manifests while graph Class/Interface names are
|
||||
// stored as bare Service, so strip the package prefix for thrift
|
||||
// service-name lookups. NO IDL path fallback — that's guaranteed to
|
||||
// return a wrong symbol in any repo with more than one IDL file.
|
||||
// Label filters scope lookups: methods → Function|Method, services
|
||||
// → Class|Interface (no label match = no silent wrong hits on
|
||||
|
|
|
|||
|
|
@ -184,7 +184,10 @@ function thriftSourceScanSymbolUid(
|
|||
filePath: string,
|
||||
symbolName: string,
|
||||
): string {
|
||||
return ['source-scan::thrift', role, contractId, normalizeThriftPath(filePath), symbolName].join(
|
||||
const contractKey = contractId.startsWith('thrift::')
|
||||
? contractId.slice('thrift::'.length)
|
||||
: contractId;
|
||||
return ['source-scan::thrift', role, contractKey, normalizeThriftPath(filePath), symbolName].join(
|
||||
'::',
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ class IfaceOrderHandler implements OrderService.Iface {
|
|||
symbolUid: [
|
||||
'source-scan::thrift',
|
||||
'consumer',
|
||||
'thrift::OrderService/PlaceOrder',
|
||||
'OrderService/PlaceOrder',
|
||||
'src/BillingWorkflow.java',
|
||||
'orderService.PlaceOrder',
|
||||
].join('::'),
|
||||
|
|
|
|||
|
|
@ -488,6 +488,7 @@ class IfaceOrderHandler implements OrderService.Iface {
|
|||
expect(providers.map((c) => c.symbolUid)).toEqual(repeatedProviders.map((c) => c.symbolUid));
|
||||
expect(providers.every((c) => c.symbolUid.length > 0)).toBe(true);
|
||||
expect(new Set(providers.map((c) => c.symbolUid)).size).toBe(2);
|
||||
expect(providers.every((c) => !c.symbolUid.includes('::thrift::billing.v1'))).toBe(true);
|
||||
});
|
||||
|
||||
it('test_extract_java_thrift_providers_from_fully_qualified_generated_iface', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue