-
Notifications
You must be signed in to change notification settings - Fork 57
feat: 资源关联查询 --story=130149297 #1193
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
Open
Zhaoyikaiii
wants to merge
8
commits into
TencentBlueKing:master
Choose a base branch
from
Zhaoyikaiii:feat/resource_relation_query/#1010158081130149297
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: 资源关联查询 --story=130149297 #1193
Zhaoyikaiii
wants to merge
8
commits into
TencentBlueKing:master
from
Zhaoyikaiii:feat/resource_relation_query/#1010158081130149297
Conversation
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
- Add CMDBv2 interface with PathV2 return type for full path information - Implement SurrealDB query builder and response parser - Add liveness graph for time-series resource matching - Include comprehensive unit tests and mock infrastructure
- Add RelationMultiResourceResponseV2 and RelationMultiResourceRangeResponseV2 structs - Implement BKBase SurrealDB client for resource relation queries - Register v2 API endpoints: /api/v2/relation/multi_resource and multi_resource_range - Add BKBase SurrealDB configuration options (url, auth, result_table_id, etc.)
… cleanup code style
Add test coverage for SurrealDB response parsing including: - hop relation parsing with nested hops (hop2, hop3) - entity and liveness period parsing - error handling for malformed data - edge direction and category parsing
…isons - Replace assert.Len/Contains/False with complete struct assertions - Use assert.Equal to compare full LivenessGraph, NodeLiveness, EdgeLiveness structures - Fix Adjacency field expectations (stores edge IDs, not node IDs) - Use exact error message matching instead of Contains
shamcleren
reviewed
Jan 22, 2026
Zhaoyikaiii
commented
Jan 22, 2026
Collaborator
Author
Zhaoyikaiii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
shamcleren
reviewed
Jan 22, 2026
| // CMDB v1 版本接口,返回路径为 []string | ||
| type CMDB interface { | ||
| // QueryResourceMatcher 获取目标的关键维度和值(instant 查询) | ||
| QueryResourceMatcher(ctx context.Context, lookBackDelta, spaceUid string, ts string, target, source Resource, indexesMatcher, expandMatcher Matcher, expandShow bool, pathResource []Resource) (Resource, Matcher, []string, Resource, Matchers, error) |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原 indexesMatcher 可以优化成 conditions 操作符
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.
No description provided.