diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4bd5edcd9..778dc87cb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Scala Steward: Reformat with scalafmt 3.6.1 0c093c52c09d7b12cdbd38008e0bbc58c9d110be + +# Scala Steward: Reformat with scalafmt 3.8.3 +fc6844bda9d3bdf0b5751381ed9e402fdeb577b8 diff --git a/.github/workflows/auto-approve-broadbot-prs.yml b/.github/workflows/auto-approve-broadbot-prs.yml new file mode 100644 index 000000000..189e1a33f --- /dev/null +++ b/.github/workflows/auto-approve-broadbot-prs.yml @@ -0,0 +1,23 @@ +name: Broadbot auto-approve +on: pull_request + +permissions: + pull-requests: write + +jobs: + getActor: + runs-on: ubuntu-latest + steps: + - name: "Echo github actor" + env: + GH_ACTOR: ${{ github.actor }} + run: echo "$GH_ACTOR" + broadbot: + runs-on: ubuntu-latest + if: github.actor == 'broadbot' + steps: + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.BROADBOT_TOKEN }} diff --git a/.scalafmt.conf b/.scalafmt.conf index 47e45a8de..b0234070a 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=3.6.1 +version=3.8.3 style = default runner.dialect = scala213 diff --git a/automation/project/Dependencies.scala b/automation/project/Dependencies.scala index a9793ad49..5b01ab480 100644 --- a/automation/project/Dependencies.scala +++ b/automation/project/Dependencies.scala @@ -34,8 +34,10 @@ object Dependencies { ExclusionRule("com.google.guava", "guava-jdk5"), ExclusionRule("org.apache.httpcomponents", "httpclient") ), - "com.google.api-client" % "google-api-client" % "1.22.0" excludeAll (ExclusionRule("com.google.guava", "guava-jdk5"), - ExclusionRule("org.apache.httpcomponents", "httpclient")), + "com.google.api-client" % "google-api-client" % "1.22.0" excludeAll ( + ExclusionRule("com.google.guava", "guava-jdk5"), + ExclusionRule("org.apache.httpcomponents", "httpclient") + ), "com.typesafe.akka" %% "akka-http-core" % akkaHttpV, "com.typesafe.akka" %% "akka-stream-testkit" % akkaV, "com.typesafe.akka" %% "akka-http" % akkaHttpV, diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala index 5e3d9e603..e7ed9ae97 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala @@ -158,7 +158,7 @@ object MockTestSupport extends MockTestSupport { policyDAO, googleExt, FakeOpenIDConnectConfiguration, - azureService:Option[AzureService] + azureService: Option[AzureService] ) } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 67301d20e..ab8850065 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -8,7 +8,7 @@ object Dependencies { val scalaTestV = "3.2.19" val scalaCheckV = "1.18.1" val scalikejdbcVersion = "3.4.2" - val postgresDriverVersion = "42.7.2" + val postgresDriverVersion = "42.7.4" val sentryVersion = "6.15.0" val workbenchLibV = "fa46370" // If updating this, make sure googleStorageLocal in test dependencies is up-to-date @@ -47,13 +47,13 @@ object Dependencies { val jacksonCore: ModuleID = "com.fasterxml.jackson.core" % "jackson-core" % jacksonV val logstashLogback: ModuleID = "net.logstash.logback" % "logstash-logback-encoder" % "6.6" - val logbackClassic: ModuleID = "ch.qos.logback" % "logback-classic" % "1.4.14" + val logbackClassic: ModuleID = "ch.qos.logback" % "logback-classic" % "1.5.12" val ravenLogback: ModuleID = "com.getsentry.raven" % "raven-logback" % "7.8.6" val scalaLogging: ModuleID = "com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingV val ficus: ModuleID = "com.iheart" %% "ficus" % "1.5.2" // val stackdriverLogging: ModuleID = "org.springframework.cloud" % "spring-cloud-gcp-logging" % "1.2.8.RELEASE" excludeAll(excludeSpring, excludeSpringBoot) val stackdriverLogging: ModuleID = "com.google.cloud" % "google-cloud-logging-logback" % "0.127.11-alpha" - val janino: ModuleID = "org.codehaus.janino" % "janino" % "3.1.7" // For if-else logic in logging config + val janino: ModuleID = "org.codehaus.janino" % "janino" % "3.1.12" // For if-else logic in logging config val akkaActor: ModuleID = "com.typesafe.akka" %% "akka-actor" % akkaV val akkaSlf4j: ModuleID = "com.typesafe.akka" %% "akka-slf4j" % akkaV @@ -71,7 +71,7 @@ object Dependencies { val ioGrpc: ModuleID = "io.grpc" % "grpc-core" % "1.34.1" val googleOAuth2: ModuleID = "com.google.auth" % "google-auth-library-oauth2-http" % "0.18.0" excludeAll excludIoGrpc - val googleStorage: ModuleID = "com.google.apis" % "google-api-services-storage" % "v1-rev20220401-1.32.1" excludeAll excludIoGrpc // force this version + val googleStorage: ModuleID = "com.google.apis" % "google-api-services-storage" % "v1-rev20241008-2.0.0" excludeAll excludIoGrpc // force this version val monocle: ModuleID = "com.github.julien-truffaut" %% "monocle-core" % monocleVersion val monocleMacro: ModuleID = "com.github.julien-truffaut" %% "monocle-macro" % monocleVersion @@ -95,19 +95,30 @@ object Dependencies { val excludeGoogleAutoValue = ExclusionRule(organization = "com.google.auto.value", name = "auto-value") val excludeBouncyCastle = ExclusionRule("org.bouncycastle") val workbenchGoogle2: ModuleID = - "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V excludeAll (excludeWorkbenchModel, excludeWorkbenchUtil, excludeGoogleAutoValue, excludeBouncyCastle) + "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V excludeAll ( + excludeWorkbenchModel, + excludeWorkbenchUtil, + excludeGoogleAutoValue, + excludeBouncyCastle + ) val workbenchNotifications: ModuleID = "org.broadinstitute.dsde.workbench" %% "workbench-notifications" % workbenchNotificationsV excludeAll (excludeWorkbenchGoogle, excludeWorkbenchModel) val workbenchGoogleTests: ModuleID = - "org.broadinstitute.dsde.workbench" %% "workbench-google" % workbenchGoogleV % "test" classifier "tests" excludeAll (excludeWorkbenchUtil, excludeWorkbenchModel) + "org.broadinstitute.dsde.workbench" %% "workbench-google" % workbenchGoogleV % "test" classifier "tests" excludeAll ( + excludeWorkbenchUtil, + excludeWorkbenchModel + ) val workbenchGoogle2Tests: ModuleID = - "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V % "test" classifier "tests" excludeAll (excludeWorkbenchUtil, excludeWorkbenchModel) + "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V % "test" classifier "tests" excludeAll ( + excludeWorkbenchUtil, + excludeWorkbenchModel + ) val googleStorageLocal: ModuleID = - "com.google.cloud" % "google-cloud-nio" % "0.127.25" % "test" // needed for mocking google cloud storage. Should use same version as wb-libs + "com.google.cloud" % "google-cloud-nio" % "0.127.26" % "test" // needed for mocking google cloud storage. Should use same version as wb-libs val liquibaseCore: ModuleID = "org.liquibase" % "liquibase-core" % "4.2.2" - val circeYAML: ModuleID = "io.circe" %% "circe-yaml" % "0.14.2" + val circeYAML: ModuleID = "io.circe" %% "circe-yaml" % "0.16.0" val snakeYAML: ModuleID = "org.yaml" % "snakeyaml" % "2.3" val scalikeCore = "org.scalikejdbc" %% "scalikejdbc" % scalikejdbcVersion @@ -135,9 +146,16 @@ object Dependencies { ) val cloudResourceLib: ModuleID = - "bio.terra" % "terra-cloud-resource-lib" % crlVersion excludeAll (excludeGoogleServiceUsage, excludeGoogleCloudResourceManager, excludeJerseyCore, excludeJerseyMedia, excludeSLF4J, excludeAwsSdk) + "bio.terra" % "terra-cloud-resource-lib" % crlVersion excludeAll ( + excludeGoogleServiceUsage, + excludeGoogleCloudResourceManager, + excludeJerseyCore, + excludeJerseyMedia, + excludeSLF4J, + excludeAwsSdk + ) val azureManagedApplications: ModuleID = - "com.azure.resourcemanager" % "azure-resourcemanager-managedapplications" % "1.0.0-beta.1" + "com.azure.resourcemanager" % "azure-resourcemanager-managedapplications" % "1.0.0-beta.4" def excludeSpringBoot = ExclusionRule("org.springframework.boot") def excludeSpringAop = ExclusionRule("org.springframework.spring-aop") @@ -169,7 +187,7 @@ object Dependencies { val terraCommonLib = tclExclusions("bio.terra" % "terra-common-lib" % tclVersion classifier "plain") // was included transitively before, now explicit - val commonsCodec: ModuleID = "commons-codec" % "commons-codec" % "1.15" + val commonsCodec: ModuleID = "commons-codec" % "commons-codec" % "1.17.1" val rootDependencies = Seq( // proactively pull in latest versions of Jackson libs, instead of relying on the versions @@ -227,6 +245,6 @@ object Dependencies { // Needed because it looks like the dependency overrides of wb-libs doesn't propagate to the importing project... val rootDependencyOverrides = Seq( - "org.apache.commons" % "commons-compress" % "1.26.0" + "org.apache.commons" % "commons-compress" % "1.26.2" ) } diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala index 7507fca4d..265495033 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala @@ -28,8 +28,8 @@ import scala.util.{Failure, Try} * * Example database records: group(7795) contains user(userid) group(7798) contains user(userid) group(7801) contains group(7798) and group(7799) * - * testdb=# select * from sam_group_member; id | group_id | member_group_id | member_user_id - * -------+----------+-----------------+---------------- 15636 | 7795 | | userid 15637 | 7798 | | userid 15638 | 7801 | 7798 | 15639 | 7801 | 7799 | + * testdb=# select * from sam_group_member; id | group_id | member_group_id | member_user_id -------+----------+-----------------+---------------- 15636 | 7795 + * \| | userid 15637 | 7798 | | userid 15638 | 7801 | 7798 | 15639 | 7801 | 7799 | * * testdb=# select * from sam_group_member_flat; id | group_id | member_group_id | member_user_id | group_membership_path | last_group_membership_element * --------+----------+-----------------+----------------+-----------------------+------------------------------ 345985 | 7795 | | userid | {7795} | 7795 @@ -115,19 +115,16 @@ trait PostgresGroupDAO { * the head path + tail path * * Example: Insert group T into group H. H starts empty but is already a member of groups A and B. T already has member groups X and Y which are empty. The - * flat group model starts containing: Group | Member Group | Path - * ------|--------------|------ A | H | {A} B | H | {B} T | X | {T} T | Y | {T} + * flat group model starts containing: Group | Member Group | Path ------|--------------|------ A | H | {A} B | H | {B} T | X | {T} T | Y | {T} * - * step 1 inserts direct membership of T in H Group | Member Group | Path - * ------|--------------|------ H | T | {H} + * step 1 inserts direct membership of T in H Group | Member Group | Path ------|--------------|------ H | T | {H} * - * step 2 inserts indirect memberships T in A and B Group | Member Group | Path - * ------|--------------|------ A | T | {A,H} B | T | {B,H} + * step 2 inserts indirect memberships T in A and B Group | Member Group | Path ------|--------------|------ A | T | {A,H} B | T | {B,H} * * step 3 inserts T's lower group hierarchy so that X and Y are members of H, A and B. The tail records are all of the records above where Group is T: ((T, * X, {T}), (T, Y, {T}) The head records are all of the records above where Member Group is T and the last path element is H: ((H, T, {H}), (A, T, {A,H}), - * (B, T, {B,H})) Group | Member Group | Path - * ------|--------------|------ H | X | {H,T} H | Y | {H,T} A | X | {A,H,T} A | Y | {A,H,T} B | X | {B,H,T} B | Y | {B,H,T} + * (B, T, {B,H})) Group | Member Group | Path ------|--------------|------ H | X | {H,T} H | Y | {H,T} A | X | {A,H,T} A | Y | {A,H,T} B | X | {B,H,T} B | Y + * \| {B,H,T} * * @param groupId * group being added to