-
Notifications
You must be signed in to change notification settings - Fork 761
[feat][backend]adapter auto openapi time range #440
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
72f5489
MCheckPermission err fix
cuichen01 3c66482
feat: add TimeRangeProvider implementation for OpenAPI search trace r…
cuichen01 9545c08
fix: gofmt for openapi_test.go
cuichen01 af2106b
fix: update TestAuthProviderImpl_CheckWorkspacePermission to expect r…
cuichen01 bf0e22f
test: add unit tests for TimeRangeProvider
cuichen01 53981f8
test: update TestOpenAPIApplication_buildSearchTraceOApiReq_TimeRange…
cuichen01 056f821
fix
cuichen01 09d45cc
test: update TestOpenAPIApplication_buildSearchTraceOApiReq_TimeRange…
cuichen01 97d3dc1
fix: remove invalid time validation tests from TestOpenAPIApplication…
cuichen01 f633557
Merge branch 'main' of github.com:coze-dev/coze-loop into feat_cc_ope…
cuichen01 eaa92a9
update
cuichen01 6b82824
fix: update GetTimeRange mock calls with delayTime parameter
cuichen01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
backend/modules/observability/domain/component/time_range/mocks/time_range_mock.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
backend/modules/observability/domain/component/time_range/time_range.go
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Copyright (c) 2026 coze-dev Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package time_range | ||
|
|
||
| import ( | ||
| "context" | ||
| ) | ||
|
|
||
| //go:generate mockgen -destination=mocks/time_range_mock.go -package=mocks . ITimeRangeProvider | ||
| type ITimeRangeProvider interface { | ||
| GetTimeRange(ctx context.Context, workSpaceID, logID, traceID string, delayTime int64) (*int64, *int64) | ||
| } |
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
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
19 changes: 19 additions & 0 deletions
19
backend/modules/observability/infra/time_range/time_range.go
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright (c) 2026 coze-dev Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package time_range | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/coze-dev/coze-loop/backend/modules/observability/domain/component/time_range" | ||
| ) | ||
|
|
||
| type TimeRangeProvider struct{} | ||
|
|
||
| func NewTimeRangeProvider() time_range.ITimeRangeProvider { | ||
| return &TimeRangeProvider{} | ||
| } | ||
|
|
||
| func (p *TimeRangeProvider) GetTimeRange(ctx context.Context, workSpaceID, logID, traceID string, delayTime int64) (*int64, *int64) { | ||
| return nil, nil | ||
| } |
27 changes: 27 additions & 0 deletions
27
backend/modules/observability/infra/time_range/time_range_test.go
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Copyright (c) 2026 coze-dev Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package time_range | ||
|
|
||
| import ( | ||
| "context" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestNewTimeRangeProvider(t *testing.T) { | ||
| provider := NewTimeRangeProvider() | ||
| assert.NotNil(t, provider) | ||
| assert.IsType(t, &TimeRangeProvider{}, provider) | ||
| } | ||
|
|
||
| func TestTimeRangeProvider_GetTimeRange(t *testing.T) { | ||
| provider := NewTimeRangeProvider() | ||
| ctx := context.Background() | ||
|
|
||
| t.Run("returns nil for any input", func(t *testing.T) { | ||
| start, end := provider.GetTimeRange(ctx, "workspace1", "log1", "trace1", 0) | ||
| assert.Nil(t, start) | ||
| assert.Nil(t, end) | ||
| }) | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.