Skip to content

Commit 7e126d4

Browse files
authored
Rename save-cloud-common module to common (#2951)
* Renaming save-cloud-common module to common
1 parent 7501e3e commit 7e126d4

File tree

819 files changed

+3019
-2831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

819 files changed

+3019
-2831
lines changed

.github/workflows/build_and_test.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
save-api: ${{ steps.calculate-dependencies.outputs.save-api }}
2525
save-api-cli: ${{ steps.calculate-dependencies.outputs.save-api-cli }}
2626
save-backend: ${{ steps.calculate-dependencies.outputs.save-backend }}
27-
save-cloud-common: ${{ steps.calculate-dependencies.outputs.save-cloud-common }}
27+
common: ${{ steps.calculate-dependencies.outputs.common }}
2828
cosv-backend: ${{ steps.calculate-dependencies.outputs.cosv-backend }}
2929
cosv-frontend: ${{ steps.calculate-dependencies.outputs.cosv-frontend }}
3030
save-demo: ${{ steps.calculate-dependencies.outputs.save-demo }}
@@ -64,8 +64,8 @@ jobs:
6464
- save-api-cli/**
6565
save-backend:
6666
- save-backend/**
67-
save-cloud-common:
68-
- save-cloud-common/**
67+
common:
68+
- common/**
6969
cosv-backend:
7070
- cosv-backend/**
7171
cosv-frontend:
@@ -94,35 +94,35 @@ jobs:
9494
run: |
9595
set -x
9696
all=$(( ${{ steps.git-changed-files.outputs.root_gradle_all_changed_files_count }} ))
97-
save_cloud_common=$(( $all + ${{ steps.git-changed-files.outputs.save-cloud-common_all_changed_files_count }} ))
98-
frontend_common=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.frontend-common_all_changed_files_count }} ))
99-
save_orchestrator_common=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-orchestrator-common_all_changed_files_count }} ))
97+
common=$(( $all + ${{ steps.git-changed-files.outputs.common_all_changed_files_count }} ))
98+
frontend_common=$(( $common + ${{ steps.git-changed-files.outputs.frontend-common_all_changed_files_count }} ))
99+
save_orchestrator_common=$(( $common + ${{ steps.git-changed-files.outputs.save-orchestrator-common_all_changed_files_count }} ))
100100
101-
authentication_service=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.authentication-service_all_changed_files_count }} ))
102-
save_api=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-api_all_changed_files_count }} ))
103-
cosv_backend=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.cosv-backend_all_changed_files_count }} ))
104-
test_analysis_core=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.test-analysis-core_all_changed_files_count }} ))
101+
authentication_service=$(( $common + ${{ steps.git-changed-files.outputs.authentication-service_all_changed_files_count }} ))
102+
save_api=$(( $common + ${{ steps.git-changed-files.outputs.save-api_all_changed_files_count }} ))
103+
cosv_backend=$(( $common + ${{ steps.git-changed-files.outputs.cosv-backend_all_changed_files_count }} ))
104+
test_analysis_core=$(( $common + ${{ steps.git-changed-files.outputs.test-analysis-core_all_changed_files_count }} ))
105105
test_utils=$(( ${{ steps.git-changed-files.outputs.test-utils_all_changed_files_count }} ))
106106
107-
api_gateway=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.api-gateway_all_changed_files_count }} ))
108-
save_agent=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-agent_all_changed_files_count }} ))
109-
save_api_cli=$(( $save_cloud_common + $save_api + ${{ steps.git-changed-files.outputs.save-api-cli_all_changed_files_count }} ))
110-
save_backend=$(( $save_cloud_common + $authentication_service + $test_analysis_core + $cosv_backend + $test_utils + ${{ steps.git-changed-files.outputs.save-backend_all_changed_files_count }} ))
111-
cosv_frontend=$(( $save_cloud_common + $frontend_common + ${{ steps.git-changed-files.outputs.cosv-frontend_all_changed_files_count }} ))
112-
save_demo=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo_all_changed_files_count }} ))
113-
save_demo_agent=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo-agent_all_changed_files_count }} ))
114-
save_demo_cpg=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo-cpg_all_changed_files_count }} ))
115-
save_frontend=$(( $save_cloud_common + $frontend_common + ${{ steps.git-changed-files.outputs.save-frontend_all_changed_files_count }} ))
116-
save_orchestrator=$(( $save_cloud_common + $save_orchestrator_common + $test_utils + ${{ steps.git-changed-files.outputs.save-orchestrator_all_changed_files_count }} ))
117-
save_preprocessor=$(( $save_cloud_common + $test_utils + ${{ steps.git-changed-files.outputs.save-preprocessor_all_changed_files_count }} ))
107+
api_gateway=$(( $common + ${{ steps.git-changed-files.outputs.api-gateway_all_changed_files_count }} ))
108+
save_agent=$(( $common + ${{ steps.git-changed-files.outputs.save-agent_all_changed_files_count }} ))
109+
save_api_cli=$(( $common + $save_api + ${{ steps.git-changed-files.outputs.save-api-cli_all_changed_files_count }} ))
110+
save_backend=$(( $common + $authentication_service + $test_analysis_core + $cosv_backend + $test_utils + ${{ steps.git-changed-files.outputs.save-backend_all_changed_files_count }} ))
111+
cosv_frontend=$(( $common + $frontend_common + ${{ steps.git-changed-files.outputs.cosv-frontend_all_changed_files_count }} ))
112+
save_demo=$(( $common + ${{ steps.git-changed-files.outputs.save-demo_all_changed_files_count }} ))
113+
save_demo_agent=$(( $common + ${{ steps.git-changed-files.outputs.save-demo-agent_all_changed_files_count }} ))
114+
save_demo_cpg=$(( $common + ${{ steps.git-changed-files.outputs.save-demo-cpg_all_changed_files_count }} ))
115+
save_frontend=$(( $common + $frontend_common + ${{ steps.git-changed-files.outputs.save-frontend_all_changed_files_count }} ))
116+
save_orchestrator=$(( $common + $save_orchestrator_common + $test_utils + ${{ steps.git-changed-files.outputs.save-orchestrator_all_changed_files_count }} ))
117+
save_preprocessor=$(( $common + $test_utils + ${{ steps.git-changed-files.outputs.save-preprocessor_all_changed_files_count }} ))
118118
119119
echo "api-gateway=$api_gateway" >> "$GITHUB_OUTPUT"
120120
echo "authentication-service=$authentication_service" >> "$GITHUB_OUTPUT"
121121
echo "save-agent=$save_agent" >> "$GITHUB_OUTPUT"
122122
echo "save-api=$save_api" >> "$GITHUB_OUTPUT"
123123
echo "save-api-cli=$save_api_cli" >> "$GITHUB_OUTPUT"
124124
echo "save-backend=$save_backend" >> "$GITHUB_OUTPUT"
125-
echo "save-cloud-common=$save_cloud_common" >> "$GITHUB_OUTPUT"
125+
echo "common=$common" >> "$GITHUB_OUTPUT"
126126
echo "cosv-backend=$cosv_backend" >> "$GITHUB_OUTPUT"
127127
echo "cosv-frontend=$cosv_frontend" >> "$GITHUB_OUTPUT"
128128
echo "save-demo=$save_demo" >> "$GITHUB_OUTPUT"
@@ -135,17 +135,17 @@ jobs:
135135
echo "save-preprocessor=$save_preprocessor" >> "$GITHUB_OUTPUT"
136136
echo "test-analysis-core=$test_analysis_core" >> "$GITHUB_OUTPUT"
137137
echo "test-utils=$test_utils" >> "$GITHUB_OUTPUT"
138-
build_save-cloud-common:
139-
name: 'Build and test (save-cloud-common)'
138+
build_common:
139+
name: 'Build and test (common)'
140140
needs: [ calculate_build_flags ]
141141
uses: ./.github/workflows/build_and_test_reusable.yml
142142
with:
143-
do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-cloud-common > 0 }}
144-
module: save-cloud-common
143+
do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.common > 0 }}
144+
module: common
145145
gradle-cache-read-only: ${{ github.ref != 'refs/heads/master' && github.event_name != 'pull_request' }}
146146
build_save-orchestrator-common:
147147
name: 'Build and test (save-orchestrator-common)'
148-
needs: [ calculate_build_flags, build_save-cloud-common ]
148+
needs: [ calculate_build_flags, build_common ]
149149
uses: ./.github/workflows/build_and_test_reusable.yml
150150
with:
151151
do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-orchestrator-common > 0 }}

api-gateway/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
dependencies {
8-
api(projects.saveCloudCommon)
8+
api(projects.common)
99
implementation(libs.spring.cloud.starter.gateway)
1010
implementation(libs.spring.boot.starter.security)
1111
implementation(libs.spring.boot.starter.oauth2.client)

api-gateway/src/main/kotlin/com/saveourtool/save/gateway/controller/SecurityInfoController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.saveourtool.save.gateway.controller
22

3-
import com.saveourtool.save.info.OauthProviderInfo
3+
import com.saveourtool.common.info.OauthProviderInfo
44
import org.springframework.security.oauth2.client.registration.InMemoryReactiveClientRegistrationRepository
55
import org.springframework.web.bind.annotation.*
66

api-gateway/src/main/kotlin/com/saveourtool/save/gateway/security/WebSecurityConfig.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
package com.saveourtool.save.gateway.security
66

7+
import com.saveourtool.common.info.UserStatus
8+
import com.saveourtool.common.v1
79
import com.saveourtool.save.gateway.config.ConfigurationProperties
810
import com.saveourtool.save.gateway.service.BackendService
911
import com.saveourtool.save.gateway.utils.StoringServerAuthenticationSuccessHandler
10-
import com.saveourtool.save.info.UserStatus
11-
import com.saveourtool.save.v1
1212

1313
import org.springframework.context.annotation.Bean
1414
import org.springframework.core.annotation.Order

api-gateway/src/main/kotlin/com/saveourtool/save/gateway/service/BackendService.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.saveourtool.save.gateway.service
22

3+
import com.saveourtool.common.entities.User
4+
import com.saveourtool.common.utils.SAVE_USER_ID_ATTRIBUTE
5+
import com.saveourtool.common.utils.orNotFound
6+
import com.saveourtool.common.utils.switchIfEmptyToResponseException
37
import com.saveourtool.save.authservice.utils.SaveUserDetails
4-
import com.saveourtool.save.entities.User
58
import com.saveourtool.save.gateway.config.ConfigurationProperties
6-
import com.saveourtool.save.utils.SAVE_USER_ID_ATTRIBUTE
7-
import com.saveourtool.save.utils.orNotFound
8-
import com.saveourtool.save.utils.switchIfEmptyToResponseException
9-
import org.springframework.http.HttpStatus
109

10+
import org.springframework.http.HttpStatus
1111
import org.springframework.http.MediaType
1212
import org.springframework.security.authentication.BadCredentialsException
1313
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
@@ -21,6 +21,7 @@ import org.springframework.web.server.WebSession
2121
import reactor.core.publisher.Mono
2222
import reactor.kotlin.core.publisher.switchIfEmpty
2323
import reactor.kotlin.core.publisher.toMono
24+
2425
import java.security.Principal
2526

2627
/**

api-gateway/src/main/kotlin/com/saveourtool/save/gateway/utils/StoringServerAuthenticationSuccessHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.saveourtool.save.gateway.utils
22

3+
import com.saveourtool.common.utils.SAVE_USER_ID_ATTRIBUTE
34
import com.saveourtool.save.gateway.service.BackendService
4-
import com.saveourtool.save.utils.SAVE_USER_ID_ATTRIBUTE
55

66
import org.slf4j.LoggerFactory
77
import org.springframework.security.authentication.BadCredentialsException

authentication-service/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ kotlin {
2121
}
2222

2323
dependencies {
24-
implementation(projects.saveCloudCommon)
24+
implementation(projects.common)
2525
implementation(libs.spring.boot.starter.security)
2626
implementation(libs.spring.security.core)
2727
implementation("org.springframework:spring-jdbc")

authentication-service/src/main/kotlin/com/saveourtool/save/authservice/config/WebSecurityConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
package com.saveourtool.save.authservice.config
66

7+
import com.saveourtool.common.v1
78
import com.saveourtool.save.authservice.utils.SaveUserDetails.Companion.toSaveUserDetails
89
import com.saveourtool.save.authservice.utils.roleHierarchy
9-
import com.saveourtool.save.v1
1010

1111
import org.springframework.context.annotation.Bean
1212
import org.springframework.context.annotation.Profile

authentication-service/src/main/kotlin/com/saveourtool/save/authservice/utils/SaveUserDetails.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.saveourtool.save.authservice.utils
22

3-
import com.saveourtool.save.entities.User
4-
import com.saveourtool.save.utils.*
3+
import com.saveourtool.common.entities.User
4+
import com.saveourtool.common.utils.*
55

66
import com.fasterxml.jackson.annotation.JsonIgnore
77
import org.springframework.http.HttpHeaders

authentication-service/src/main/kotlin/com/saveourtool/save/authservice/utils/SecurityUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
package com.saveourtool.save.authservice.utils
66

7-
import com.saveourtool.save.domain.Role
8-
import com.saveourtool.save.info.UserStatus
7+
import com.saveourtool.common.domain.Role
8+
import com.saveourtool.common.info.UserStatus
99
import org.springframework.security.access.hierarchicalroles.RoleHierarchy
1010
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl
1111
import org.springframework.security.access.hierarchicalroles.RoleHierarchyUtils

0 commit comments

Comments
 (0)