Giter Club home page Giter Club logo

zorechka-bot's Introduction

zorechka-bot

Github bot for keeping your Bazel dependencies up-to-date

It's like Scala Steward but for Bazel.

Configuration

There is a repos.md file for list of repos to check. The format is "{username}/{repo} {token}" per line. Token is optional, requred for private repos. To get a valid token, go to https://github.com/settings/tokens

How to run

Use SBT and docker-compose to build and run the application. From project dir, run:

sbt assembly
docker-compose up

If you want to rebuild the application's image before running, execute:

docker-compose up --build

How to contribute

Fork and import as SBT project.

zorechka-bot's People

Contributors

dnaumenko avatar serhii-st avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zorechka-bot's Issues

Migrate to latest ZIO and Zlayer for dependency management

Not so far time ago, a new feature of ZIO released called ZLayer (https://zio.dev/docs/howto/howto_use_layers). It fixes an old approach known as Module Pattern or approach where you hard-code dependencies in interface level (it could be seen in current code).

It would be nice to try it out and migrate current dependencies to a new system.

Some docs could be find here - https://docs.google.com/document/d/1P0mx1gSNU2UTi-9PXUeY8O74v5gyK-UETznM1SbkQjA/edit#heading=h.tsittnt9c96t

Any plans for updating dependecies?

The project uses old scalaz organization for ZIO and old scala version. Do you have plans for updating it?

If not that's okay :) I'm just looking for fresh ZIO applications, and this project is a great example how to write real-world ZIO code.

Suggestion to embrace module pattern

If you're not going to use helpers to access services, then I recommend rewriting code like this:

  def createNewVersionPullRequest(repo: GitRepo, forkDir: Path, deps: List[Dep]): ZIO[GithubClient, Throwable, Unit] = {
    val (depsDesc, branch) = branchName(deps)

    for {
      _ <- ZIO.accessM[GithubClient](_.githubClient.createBranch(forkDir, branch))
      _ <- ZIO.effect(BazelDepsCheck.applyDepUpdates(forkDir, deps))
      _ <- ZIO.accessM[GithubClient](_.githubClient.stageAllChanges(forkDir))
      _ <- ZIO.accessM[GithubClient](_.githubClient.commit(forkDir, s"zorechka found new versions for deps: $depsDesc #pr"))
      _ <- ZIO.accessM[GithubClient](_.githubClient.push(forkDir, branch))
    } yield ()
}

to be like this:

  def createNewVersionPullRequest(repo: GitRepo, forkDir: Path, deps: List[Dep]): ZIO[GithubClient, Throwable, Unit] = ZIO.accessM[GithubClient] { githubClient =>
    val (depsDesc, branch) = branchName(deps)

    for {
      _ <- githubClient.createBranch(forkDir, branch)
      _ <- ZIO.effect(BazelDepsCheck.applyDepUpdates(forkDir, deps)
      _ <- githubClient.stageAllChanges(forkDir)
      _ <- githubClient.commit(forkDir, s"zorechka found new versions for deps: $depsDesc #pr")
      _ <- githubClient.push(forkDir, branch)
    } yield ()
}

Makes the code much easier to follow.

Is this dead?

Asking because I don't see even dependency updates happening.

Add Http4s server with simple heath-check endpoint.

As this is a project for evaluating ZIO, it would be nice to see how to connect Http4s server.

For start, this server could contain just one endpoint for health-checks.

Note, that we have to read HTTP server port from the config file. Project already depends on http4s as it uses it as a client.

Add ZIO tests

ZIO has it's own testing library - https://zio.dev/docs/usecases/usecases_testing.

It would be nice to evaluate it by writing some tests. Things that are not clear for how well it integrates with IntelliJ IDEA and how comfortable is it for a developer.

I have heard about some plugin for ZIO for IDEA, so worth to check it out as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.