-
Notifications
You must be signed in to change notification settings - Fork 1
feat: monitoring app add/#677 #678
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
+124
−2
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,9 @@ public enum MonitoredApp { | |
| ANDROID_STUDIO, | ||
| XCODE, | ||
| UNITY, | ||
| } | ||
| BLENDER, | ||
| DATAGRIP, | ||
| NOTION, | ||
| FIGMA, | ||
| ROBLOX_STUDIO, | ||
| } | ||
108 changes: 108 additions & 0 deletions
108
src/main/resources/db/migration/V35__add_more_monitored_apps.sql
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,108 @@ | ||
| ALTER TABLE record_sessions | ||
| DROP CONSTRAINT IF EXISTS ck_record_sessions_app_id; | ||
|
|
||
| ALTER TABLE record_sessions | ||
| ADD CONSTRAINT ck_record_sessions_app_id | ||
| CHECK ( | ||
| app_id IS NULL | ||
| OR app_id IN ( | ||
| 'VSCODE', | ||
| 'WEBSTORM', | ||
| 'INTELLIJ_IDEA', | ||
| 'PYCHARM', | ||
| 'GOLAND', | ||
| 'PHPSTORM', | ||
| 'RUBYMINE', | ||
| 'CLION', | ||
| 'RIDER', | ||
| 'ANDROID_STUDIO', | ||
| 'XCODE', | ||
| 'UNITY', | ||
| 'BLENDER', | ||
| 'DATAGRIP', | ||
| 'NOTION', | ||
| 'FIGMA', | ||
| 'ROBLOX_STUDIO' | ||
| ) | ||
| ); | ||
|
|
||
| ALTER TABLE record_session_segments | ||
| DROP CONSTRAINT IF EXISTS ck_record_session_segments_app_id; | ||
|
|
||
| ALTER TABLE record_session_segments | ||
| ADD CONSTRAINT ck_record_session_segments_app_id | ||
| CHECK ( | ||
| app_id IN ( | ||
| 'VSCODE', | ||
| 'WEBSTORM', | ||
| 'INTELLIJ_IDEA', | ||
| 'PYCHARM', | ||
| 'GOLAND', | ||
| 'PHPSTORM', | ||
| 'RUBYMINE', | ||
| 'CLION', | ||
| 'RIDER', | ||
| 'ANDROID_STUDIO', | ||
| 'XCODE', | ||
| 'UNITY', | ||
| 'BLENDER', | ||
| 'DATAGRIP', | ||
| 'NOTION', | ||
| 'FIGMA', | ||
| 'ROBLOX_STUDIO' | ||
| ) | ||
| ); | ||
|
|
||
| ALTER TABLE record_develop_sessions_v2 | ||
| DROP CONSTRAINT IF EXISTS ck_record_develop_sessions_v2_app_id; | ||
|
|
||
| ALTER TABLE record_develop_sessions_v2 | ||
| ADD CONSTRAINT ck_record_develop_sessions_v2_app_id | ||
| CHECK ( | ||
| app_id IN ( | ||
| 'VSCODE', | ||
| 'WEBSTORM', | ||
| 'INTELLIJ_IDEA', | ||
| 'PYCHARM', | ||
| 'GOLAND', | ||
| 'PHPSTORM', | ||
| 'RUBYMINE', | ||
| 'CLION', | ||
| 'RIDER', | ||
| 'ANDROID_STUDIO', | ||
| 'XCODE', | ||
| 'UNITY', | ||
| 'BLENDER', | ||
| 'DATAGRIP', | ||
| 'NOTION', | ||
| 'FIGMA', | ||
| 'ROBLOX_STUDIO' | ||
| ) | ||
| ); | ||
|
|
||
| ALTER TABLE record_develop_session_segments_v2 | ||
| DROP CONSTRAINT IF EXISTS ck_record_develop_session_segments_v2_app_id; | ||
|
|
||
| ALTER TABLE record_develop_session_segments_v2 | ||
| ADD CONSTRAINT ck_record_develop_session_segments_v2_app_id | ||
| CHECK ( | ||
| app_id IN ( | ||
| 'VSCODE', | ||
| 'WEBSTORM', | ||
| 'INTELLIJ_IDEA', | ||
| 'PYCHARM', | ||
| 'GOLAND', | ||
| 'PHPSTORM', | ||
| 'RUBYMINE', | ||
| 'CLION', | ||
| 'RIDER', | ||
| 'ANDROID_STUDIO', | ||
| 'XCODE', | ||
| 'UNITY', | ||
| 'BLENDER', | ||
| 'DATAGRIP', | ||
| 'NOTION', | ||
| 'FIGMA', | ||
| 'ROBLOX_STUDIO' | ||
| ) | ||
| ); | ||
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 |
|---|---|---|
|
|
@@ -21,6 +21,15 @@ void execute_returnsMonitoredApps() { | |
| new GetMonitoredAppsV2Data.Command(new Actor(1L)) | ||
| ); | ||
|
|
||
| assertThat(result.apps()).contains(MonitoredApp.VSCODE, MonitoredApp.INTELLIJ_IDEA, MonitoredApp.XCODE); | ||
| assertThat(result.apps()).contains( | ||
| MonitoredApp.VSCODE, | ||
| MonitoredApp.INTELLIJ_IDEA, | ||
| MonitoredApp.XCODE, | ||
| MonitoredApp.BLENDER, | ||
| MonitoredApp.DATAGRIP, | ||
| MonitoredApp.NOTION, | ||
| MonitoredApp.FIGMA, | ||
| MonitoredApp.ROBLOX_STUDIO | ||
| ); | ||
|
Comment on lines
+24
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| } | ||
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.
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.
동일한
app_id목록이 4개의 테이블 제약 조건(CHECK constraint)에 중복해서 작성되어 있습니다. 현재는 기존의 방식을 따르고 있으나, 모니터링 대상 앱이 추가될 때마다 모든 테이블의 제약 조건을 수동으로 업데이트해야 하므로 실수가 발생하기 쉽습니다. 장기적으로는monitored_apps와 같은 별도의 참조 테이블을 생성하고 외래 키(FK)를 참조하는 방식으로 개선하는 것을 권장합니다.