Skip to content

Commit

Permalink
address pull request feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Ender Tunc committed Mar 24, 2023
1 parent 8c14342 commit 9a99f9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Expand Up @@ -43,7 +43,7 @@ object ForgeSelection {
)(implicit
httpJsonClient: HttpJsonClient[F],
logger: Logger[F],
temporal: Temporal[F]
F: Temporal[F]
): ForgeApiAlg[F] = {
val auth = (_: Any) => authenticate(forgeCfg.tpe, user)
forgeSpecificCfg match {
Expand Down
Expand Up @@ -17,7 +17,7 @@
package org.scalasteward.core.forge.gitlab

import cats.effect.Temporal
import cats.{MonadThrow, Parallel}
import cats.Parallel
import cats.syntax.all._
import io.circe._
import io.circe.generic.semiauto._
Expand Down Expand Up @@ -165,8 +165,7 @@ final class GitLabApiAlg[F[_]: Parallel](
)(implicit
client: HttpJsonClient[F],
logger: Logger[F],
F: MonadThrow[F],
temporal: Temporal[F]
F: Temporal[F]
) extends ForgeApiAlg[F] {
import GitLabJsonCodec._

Expand Down Expand Up @@ -217,21 +216,21 @@ final class GitLabApiAlg[F[_]: Parallel](
.get[MergeRequestOut](url.existingMergeRequest(repo, number), modify(repo))
.flatMap {
case mr if mr.mergeStatus =!= GitLabMergeStatus.Checking => F.pure(mr)
case _ if retries > 0 =>
case mr if retries > 0 =>
logger.info(
s"Merge request is still in '${GitLabMergeStatus.Checking}' state. We will check merge request status in $initialDelay again. " +
s"Merge request is still in '${mr.mergeStatus}' state. We will check merge request status in $initialDelay again. " +

Check warning on line 221 in modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala

View check run for this annotation

Codecov / codecov/patch

modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala#L219-L221

Added lines #L219 - L221 were not covered by tests
s"Remaining retries count is $retries"
) >> temporal.sleep(initialDelay) >> waitForMergeRequestStatus(
) >> F.sleep(initialDelay) >> waitForMergeRequestStatus(

Check warning on line 223 in modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala

View check run for this annotation

Codecov / codecov/patch

modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala#L223

Added line #L223 was not covered by tests
number,
retries - 1,
initialDelay * backoffMultiplier

Check warning on line 226 in modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala

View check run for this annotation

Codecov / codecov/patch

modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala#L225-L226

Added lines #L225 - L226 were not covered by tests
)
case other =>
case mr =>
logger
.warn(
s"Exhausted all retires while waiting for merge request status. Last known status is '${other.mergeStatus}'"
s"Exhausted all retries while waiting for merge request status. Last known status is '${mr.mergeStatus}'"
)
.as(other)
.as(mr)

Check warning on line 233 in modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala

View check run for this annotation

Codecov / codecov/patch

modules/core/src/main/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlg.scala#L233

Added line #L233 was not covered by tests
}

val updatedMergeRequest =
Expand Down

0 comments on commit 9a99f9d

Please sign in to comment.