Skip to content
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

Two depth dashboard files #67

Merged
merged 6 commits into from
May 25, 2023
Merged

Two depth dashboard files #67

merged 6 commits into from
May 25, 2023

Conversation

jmnote
Copy link
Contributor

@jmnote jmnote commented May 25, 2023

What this PR does / why we need it (변경 내용 / 필요성):

loadDashboardFromFile 오류 해결

dashboard yaml 파일 하위 디렉토리 읽기

현재 glob 패턴 방식으로는 etc/dashboards/.yml 으로는
etc/dashboards/common/aaa.yml
etc/dashboards/user/bbb.yml
와 같은 경로에 있는 파일을 로드할 수 없습니다.

또한 glob 패턴에 **을 사용할 수 없어서 etc/dashboards/**/.y*ml로 해도 안됩니다.
그래서 디렉토리 경로를 받아서 해당 디렉토리와 하위 디렉토리에서 yaml 파일을 로드하도록 수정하였습니다.

예전에 Unmarshal을 UnmarshalStrict로 바꾼 영향으로
기존 설정 일부를 읽지 못하는 현상이 있었는데 해결하였습니다.

Which issue(s) this PR fixes (관련 이슈):

Special notes for your reviewer (리뷰어에게 하고 싶은 말):

리뷰 감사합니다.

Additional documentation, usage docs, etc. (기타 관련 문서, 사용법 등):

recursive(**) 불가 golang/go#11862

@jmnote jmnote added the bug Something isn't working label May 25, 2023
@jmnote jmnote self-assigned this May 25, 2023
@jmnote jmnote linked an issue May 25, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented May 25, 2023

Codecov Report

Patch coverage: 74.55% and project coverage change: +25.10 🎉

Comparison is base (6fa8f8c) 40.76% compared to head (8b69887) 65.86%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #67       +/-   ##
===========================================
+ Coverage   40.76%   65.86%   +25.10%     
===========================================
  Files          19       31       +12     
  Lines         628     1213      +585     
===========================================
+ Hits          256      799      +543     
- Misses        341      362       +21     
- Partials       31       52       +21     
Impacted Files Coverage Δ
pkg/handler/api/error.go 0.00% <0.00%> (ø)
pkg/handler/config.go 50.00% <0.00%> (ø)
pkg/handler/handle_spa.go 33.33% <ø> (ø)
pkg/store/discovery/kubernetes/kubernetes.go 61.42% <ø> (ø)
pkg/handler/auth.go 2.15% <6.06%> (+0.24%) ⬆️
pkg/mocker/client/client.go 6.45% <6.45%> (ø)
pkg/handler/datasource.go 15.38% <15.38%> (ø)
main.go 28.00% <30.00%> (ø)
pkg/store/user/user.go 23.68% <33.33%> (ø)
pkg/handler/alert.go 50.00% <50.00%> (ø)
... and 21 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jmnote jmnote requested a review from dozer-jang May 25, 2023 06:07
Copy link
Contributor

@dozer-jang dozer-jang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

간단하지만 좋은 PR이네요!

음 filepath.walk를 사용하면 2 depth의 한계를 넘을 수 있을 것 같습니다.

하지만 또 2 depth 이상의 설정을 하는 경우는 거의 없을 수도 있을 것 같네요!

dozer-jang

This comment was marked as duplicate.

@jmnote
Copy link
Contributor Author

jmnote commented May 25, 2023

간단하지만 좋은 PR이네요!

음 filepath.walk를 사용하면 2 depth의 한계를 넘을 수 있을 것 같습니다.

하지만 또 2 depth 이상의 설정을 하는 경우는 거의 없을 수도 있을 것 같네요!

네 동일한 고민을 저도 했어요. ㅎㅎ walk를 사용하면 좋긴 한데 구현이 약간 번거로울 것 같고, 기능도 2 depth 정도면 충분한 것 같아서 일단 간단히 구현했습니다.

@jmnote jmnote merged commit f8e98fa into main May 25, 2023
@jmnote jmnote deleted the two-depth-dashboard-files branch May 25, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2-depth dashboard files
3 participants