Skip to content

Commit

Permalink
Rename save-cloud-common module to common (#2951)
Browse files Browse the repository at this point in the history
* Renaming save-cloud-common module to common
  • Loading branch information
Cheshiriks authored Apr 25, 2024
1 parent 7501e3e commit 7e126d4
Show file tree
Hide file tree
Showing 819 changed files with 3,019 additions and 2,831 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
save-api: ${{ steps.calculate-dependencies.outputs.save-api }}
save-api-cli: ${{ steps.calculate-dependencies.outputs.save-api-cli }}
save-backend: ${{ steps.calculate-dependencies.outputs.save-backend }}
save-cloud-common: ${{ steps.calculate-dependencies.outputs.save-cloud-common }}
common: ${{ steps.calculate-dependencies.outputs.common }}
cosv-backend: ${{ steps.calculate-dependencies.outputs.cosv-backend }}
cosv-frontend: ${{ steps.calculate-dependencies.outputs.cosv-frontend }}
save-demo: ${{ steps.calculate-dependencies.outputs.save-demo }}
Expand Down Expand Up @@ -64,8 +64,8 @@ jobs:
- save-api-cli/**
save-backend:
- save-backend/**
save-cloud-common:
- save-cloud-common/**
common:
- common/**
cosv-backend:
- cosv-backend/**
cosv-frontend:
Expand Down Expand Up @@ -94,35 +94,35 @@ jobs:
run: |
set -x
all=$(( ${{ steps.git-changed-files.outputs.root_gradle_all_changed_files_count }} ))
save_cloud_common=$(( $all + ${{ steps.git-changed-files.outputs.save-cloud-common_all_changed_files_count }} ))
frontend_common=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.frontend-common_all_changed_files_count }} ))
save_orchestrator_common=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-orchestrator-common_all_changed_files_count }} ))
common=$(( $all + ${{ steps.git-changed-files.outputs.common_all_changed_files_count }} ))
frontend_common=$(( $common + ${{ steps.git-changed-files.outputs.frontend-common_all_changed_files_count }} ))
save_orchestrator_common=$(( $common + ${{ steps.git-changed-files.outputs.save-orchestrator-common_all_changed_files_count }} ))
authentication_service=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.authentication-service_all_changed_files_count }} ))
save_api=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-api_all_changed_files_count }} ))
cosv_backend=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.cosv-backend_all_changed_files_count }} ))
test_analysis_core=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.test-analysis-core_all_changed_files_count }} ))
authentication_service=$(( $common + ${{ steps.git-changed-files.outputs.authentication-service_all_changed_files_count }} ))
save_api=$(( $common + ${{ steps.git-changed-files.outputs.save-api_all_changed_files_count }} ))
cosv_backend=$(( $common + ${{ steps.git-changed-files.outputs.cosv-backend_all_changed_files_count }} ))
test_analysis_core=$(( $common + ${{ steps.git-changed-files.outputs.test-analysis-core_all_changed_files_count }} ))
test_utils=$(( ${{ steps.git-changed-files.outputs.test-utils_all_changed_files_count }} ))
api_gateway=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.api-gateway_all_changed_files_count }} ))
save_agent=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-agent_all_changed_files_count }} ))
save_api_cli=$(( $save_cloud_common + $save_api + ${{ steps.git-changed-files.outputs.save-api-cli_all_changed_files_count }} ))
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 }} ))
cosv_frontend=$(( $save_cloud_common + $frontend_common + ${{ steps.git-changed-files.outputs.cosv-frontend_all_changed_files_count }} ))
save_demo=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo_all_changed_files_count }} ))
save_demo_agent=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo-agent_all_changed_files_count }} ))
save_demo_cpg=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo-cpg_all_changed_files_count }} ))
save_frontend=$(( $save_cloud_common + $frontend_common + ${{ steps.git-changed-files.outputs.save-frontend_all_changed_files_count }} ))
save_orchestrator=$(( $save_cloud_common + $save_orchestrator_common + $test_utils + ${{ steps.git-changed-files.outputs.save-orchestrator_all_changed_files_count }} ))
save_preprocessor=$(( $save_cloud_common + $test_utils + ${{ steps.git-changed-files.outputs.save-preprocessor_all_changed_files_count }} ))
api_gateway=$(( $common + ${{ steps.git-changed-files.outputs.api-gateway_all_changed_files_count }} ))
save_agent=$(( $common + ${{ steps.git-changed-files.outputs.save-agent_all_changed_files_count }} ))
save_api_cli=$(( $common + $save_api + ${{ steps.git-changed-files.outputs.save-api-cli_all_changed_files_count }} ))
save_backend=$(( $common + $authentication_service + $test_analysis_core + $cosv_backend + $test_utils + ${{ steps.git-changed-files.outputs.save-backend_all_changed_files_count }} ))
cosv_frontend=$(( $common + $frontend_common + ${{ steps.git-changed-files.outputs.cosv-frontend_all_changed_files_count }} ))
save_demo=$(( $common + ${{ steps.git-changed-files.outputs.save-demo_all_changed_files_count }} ))
save_demo_agent=$(( $common + ${{ steps.git-changed-files.outputs.save-demo-agent_all_changed_files_count }} ))
save_demo_cpg=$(( $common + ${{ steps.git-changed-files.outputs.save-demo-cpg_all_changed_files_count }} ))
save_frontend=$(( $common + $frontend_common + ${{ steps.git-changed-files.outputs.save-frontend_all_changed_files_count }} ))
save_orchestrator=$(( $common + $save_orchestrator_common + $test_utils + ${{ steps.git-changed-files.outputs.save-orchestrator_all_changed_files_count }} ))
save_preprocessor=$(( $common + $test_utils + ${{ steps.git-changed-files.outputs.save-preprocessor_all_changed_files_count }} ))
echo "api-gateway=$api_gateway" >> "$GITHUB_OUTPUT"
echo "authentication-service=$authentication_service" >> "$GITHUB_OUTPUT"
echo "save-agent=$save_agent" >> "$GITHUB_OUTPUT"
echo "save-api=$save_api" >> "$GITHUB_OUTPUT"
echo "save-api-cli=$save_api_cli" >> "$GITHUB_OUTPUT"
echo "save-backend=$save_backend" >> "$GITHUB_OUTPUT"
echo "save-cloud-common=$save_cloud_common" >> "$GITHUB_OUTPUT"
echo "common=$common" >> "$GITHUB_OUTPUT"
echo "cosv-backend=$cosv_backend" >> "$GITHUB_OUTPUT"
echo "cosv-frontend=$cosv_frontend" >> "$GITHUB_OUTPUT"
echo "save-demo=$save_demo" >> "$GITHUB_OUTPUT"
Expand All @@ -135,17 +135,17 @@ jobs:
echo "save-preprocessor=$save_preprocessor" >> "$GITHUB_OUTPUT"
echo "test-analysis-core=$test_analysis_core" >> "$GITHUB_OUTPUT"
echo "test-utils=$test_utils" >> "$GITHUB_OUTPUT"
build_save-cloud-common:
name: 'Build and test (save-cloud-common)'
build_common:
name: 'Build and test (common)'
needs: [ calculate_build_flags ]
uses: ./.github/workflows/build_and_test_reusable.yml
with:
do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-cloud-common > 0 }}
module: save-cloud-common
do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.common > 0 }}
module: common
gradle-cache-read-only: ${{ github.ref != 'refs/heads/master' && github.event_name != 'pull_request' }}
build_save-orchestrator-common:
name: 'Build and test (save-orchestrator-common)'
needs: [ calculate_build_flags, build_save-cloud-common ]
needs: [ calculate_build_flags, build_common ]
uses: ./.github/workflows/build_and_test_reusable.yml
with:
do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-orchestrator-common > 0 }}
Expand Down
2 changes: 1 addition & 1 deletion api-gateway/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
api(projects.saveCloudCommon)
api(projects.common)
implementation(libs.spring.cloud.starter.gateway)
implementation(libs.spring.boot.starter.security)
implementation(libs.spring.boot.starter.oauth2.client)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.gateway.controller

import com.saveourtool.save.info.OauthProviderInfo
import com.saveourtool.common.info.OauthProviderInfo
import org.springframework.security.oauth2.client.registration.InMemoryReactiveClientRegistrationRepository
import org.springframework.web.bind.annotation.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

package com.saveourtool.save.gateway.security

import com.saveourtool.common.info.UserStatus
import com.saveourtool.common.v1
import com.saveourtool.save.gateway.config.ConfigurationProperties
import com.saveourtool.save.gateway.service.BackendService
import com.saveourtool.save.gateway.utils.StoringServerAuthenticationSuccessHandler
import com.saveourtool.save.info.UserStatus
import com.saveourtool.save.v1

import org.springframework.context.annotation.Bean
import org.springframework.core.annotation.Order
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.saveourtool.save.gateway.service

import com.saveourtool.common.entities.User
import com.saveourtool.common.utils.SAVE_USER_ID_ATTRIBUTE
import com.saveourtool.common.utils.orNotFound
import com.saveourtool.common.utils.switchIfEmptyToResponseException
import com.saveourtool.save.authservice.utils.SaveUserDetails
import com.saveourtool.save.entities.User
import com.saveourtool.save.gateway.config.ConfigurationProperties
import com.saveourtool.save.utils.SAVE_USER_ID_ATTRIBUTE
import com.saveourtool.save.utils.orNotFound
import com.saveourtool.save.utils.switchIfEmptyToResponseException
import org.springframework.http.HttpStatus

import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.security.authentication.BadCredentialsException
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
Expand All @@ -21,6 +21,7 @@ import org.springframework.web.server.WebSession
import reactor.core.publisher.Mono
import reactor.kotlin.core.publisher.switchIfEmpty
import reactor.kotlin.core.publisher.toMono

import java.security.Principal

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.saveourtool.save.gateway.utils

import com.saveourtool.common.utils.SAVE_USER_ID_ATTRIBUTE
import com.saveourtool.save.gateway.service.BackendService
import com.saveourtool.save.utils.SAVE_USER_ID_ATTRIBUTE

import org.slf4j.LoggerFactory
import org.springframework.security.authentication.BadCredentialsException
Expand Down
2 changes: 1 addition & 1 deletion authentication-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin {
}

dependencies {
implementation(projects.saveCloudCommon)
implementation(projects.common)
implementation(libs.spring.boot.starter.security)
implementation(libs.spring.security.core)
implementation("org.springframework:spring-jdbc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

package com.saveourtool.save.authservice.config

import com.saveourtool.common.v1
import com.saveourtool.save.authservice.utils.SaveUserDetails.Companion.toSaveUserDetails
import com.saveourtool.save.authservice.utils.roleHierarchy
import com.saveourtool.save.v1

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Profile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.saveourtool.save.authservice.utils

import com.saveourtool.save.entities.User
import com.saveourtool.save.utils.*
import com.saveourtool.common.entities.User
import com.saveourtool.common.utils.*

import com.fasterxml.jackson.annotation.JsonIgnore
import org.springframework.http.HttpHeaders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

package com.saveourtool.save.authservice.utils

import com.saveourtool.save.domain.Role
import com.saveourtool.save.info.UserStatus
import com.saveourtool.common.domain.Role
import com.saveourtool.common.info.UserStatus
import org.springframework.security.access.hierarchicalroles.RoleHierarchy
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl
import org.springframework.security.access.hierarchicalroles.RoleHierarchyUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.saveourtool.save.authservice.utils

import com.saveourtool.save.authservice.utils.SaveUserDetails.Companion.toSaveUserDetails
import com.saveourtool.save.utils.AUTHORIZATION_ID
import com.saveourtool.save.utils.AUTHORIZATION_NAME
import com.saveourtool.save.utils.AUTHORIZATION_ROLES
import com.saveourtool.save.utils.AUTHORIZATION_STATUS
import com.saveourtool.common.utils.AUTHORIZATION_ID
import com.saveourtool.common.utils.AUTHORIZATION_NAME
import com.saveourtool.common.utils.AUTHORIZATION_ROLES
import com.saveourtool.common.utils.AUTHORIZATION_STATUS
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@file:Suppress("VARIABLE_NAME_INCORRECT", "CONSTANT_UPPERCASE", "TopLevelPropertyNaming")
@file:JsExport

package com.saveourtool.save
package com.saveourtool.common

import kotlin.js.JsExport

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

/**
* Env names which agent supports and expects
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.utils.DEFAULT_SETUP_SH_TIMEOUT_MILLIS
import com.saveourtool.common.utils.DEFAULT_SETUP_SH_TIMEOUT_MILLIS
import kotlinx.serialization.Serializable

/**
Expand All @@ -15,6 +15,6 @@ data class AgentInitConfig(
val saveCliUrl: String,
val testSuitesSourceSnapshotUrl: String,
val additionalFileNameToUrl: Map<String, String>,
val saveCliOverrides: SaveCliOverrides,
val saveCliOverrides: com.saveourtool.common.agent.SaveCliOverrides,
val setupShTimeoutMillis: Long = DEFAULT_SETUP_SH_TIMEOUT_MILLIS,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultDebugInfo
import com.saveourtool.common.domain.TestResultDebugInfo
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Model classes for heartbeating between save agent and the orchestrator
*/

package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultStatus
import com.saveourtool.save.entities.DtoWithId
import com.saveourtool.save.test.analysis.metrics.NoDataAvailable
import com.saveourtool.save.test.analysis.metrics.TestMetrics
import com.saveourtool.save.test.analysis.results.AnalysisResult
import com.saveourtool.common.domain.TestResultStatus
import com.saveourtool.common.entities.DtoWithId
import com.saveourtool.common.test.analysis.metrics.NoDataAvailable
import com.saveourtool.common.test.analysis.metrics.TestMetrics
import com.saveourtool.common.test.analysis.results.AnalysisResult

import kotlinx.serialization.Serializable

Expand Down Expand Up @@ -53,8 +53,8 @@ data class TestExecutionDto(
hasDebugInfo: Boolean? = null,
testMetrics: TestMetrics = NoDataAvailable.instance,
analysisResults: List<AnalysisResult> = emptyList(),
): TestExecutionExtDto =
TestExecutionExtDto(
): com.saveourtool.common.agent.TestExecutionExtDto =
com.saveourtool.common.agent.TestExecutionExtDto(
this,
hasDebugInfo,
testMetrics,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.test.analysis.metrics.NoDataAvailable
import com.saveourtool.save.test.analysis.metrics.TestMetrics
import com.saveourtool.save.test.analysis.results.AnalysisResult
import com.saveourtool.common.test.analysis.metrics.NoDataAvailable
import com.saveourtool.common.test.analysis.metrics.TestMetrics
import com.saveourtool.common.test.analysis.results.AnalysisResult
import kotlinx.serialization.Serializable

/**
Expand All @@ -19,7 +19,7 @@ import kotlinx.serialization.Serializable
*/
@Serializable
data class TestExecutionExtDto(
val testExecution: TestExecutionDto,
val testExecution: com.saveourtool.common.agent.TestExecutionDto,
val hasDebugInfo: Boolean? = null,
val testMetrics: TestMetrics = NoDataAvailable.instance,
val analysisResults: List<AnalysisResult> = emptyList(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultStatus
import com.saveourtool.common.domain.TestResultStatus
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultStatus
import com.saveourtool.common.domain.TestResultStatus

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@file:JvmName("Flow")
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")

package com.saveourtool.save.coroutines.flow
package com.saveourtool.common.coroutines.flow

import okio.Buffer
import kotlin.jvm.JvmName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

import kotlin.math.roundToInt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("FILE_NAME_INCORRECT")

package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

/**
* Base interface for all BaseMetrics classes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("FILE_NAME_INCORRECT")

package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

/**
* Base interface for CvssVector classes
Expand Down
Loading

0 comments on commit 7e126d4

Please sign in to comment.