{"id":22615734,"url":"https://github.com/polyvariant/pitgull","last_synced_at":"2025-08-05T17:32:12.631Z","repository":{"id":39802575,"uuid":"282340797","full_name":"polyvariant/pitgull","owner":"polyvariant","description":"Automatic housekeeping for your gitlab repositories.","archived":false,"fork":false,"pushed_at":"2023-09-28T18:59:02.000Z","size":778,"stargazers_count":14,"open_issues_count":33,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-09-28T22:25:18.476Z","etag":null,"topics":["cats-effect","dhall","fs2","gitlab","scala","scala-steward","sttp","tapir"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polyvariant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-25T00:27:08.000Z","updated_at":"2023-05-14T07:14:00.000Z","dependencies_parsed_at":"2023-09-28T21:02:19.080Z","dependency_job_id":null,"html_url":"https://github.com/polyvariant/pitgull","commit_stats":null,"previous_names":[],"tags_count":13,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fpitgull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fpitgull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fpitgull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fpitgull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polyvariant","download_url":"https://codeload.github.com/polyvariant/pitgull/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228779141,"owners_count":17971086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cats-effect","dhall","fs2","gitlab","scala","scala-steward","sttp","tapir"],"created_at":"2024-12-08T19:09:14.585Z","updated_at":"2024-12-08T19:09:16.098Z","avatar_url":"https://github.com/polyvariant.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pitgull\n\n[![License](https://img.shields.io/:license-Apache%202-green.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)\n![Continuous Integration](https://github.com/pitgull/pitgull/workflows/Continuous%20Integration/badge.svg)\n[![Powered by cats](https://img.shields.io/badge/powered%20by-cats-blue.svg)](https://github.com/typelevel/cats)\n![Gluten free](https://img.shields.io/badge/gluten-free-orange.svg)\n\n## How it works\n\nThe core idea behind the project is very simple - create a tool for automatically applying merge requests created by [Scala Steward](https://github.com/scala-steward-org/scala-steward) on any [Gitlab](https://gitlab.com/) instance. Currently Pitgull is ortogonal from the bots, the merge requests are qualified by generic rules.\n\nPitgull works as a web service, listening for webhook events from Gitlab instance. Upon receiving a webhook, it reads related project's merge requests, finds one best candidate and tries to merge it. If all qualifying merge requests need to be updated, an attempt to rebase them onto the target branch will be made.\nOnce an MR is merged, Gitlab will trigger another webhook, creating a loop until Pitgull finds no qualifying merge request.\n\n![Flow diagram](https://www.plantuml.com/plantuml/svg/VOz1IyD048Nl-HNZtT9x3wM288Ar9HVFkzcNPEncDyxEjkJV6sqDXGIlm_UzzsQNr8ZcpXSFsg83MP_HY1cA41KKpn1wOVN6RkZ8FJm7hFUG1YJuoaYwVly1SKPGua2zn4zKMbobrVR8scJlD_G1syPuAcw7rVOlzd2wwvhmLuUWN0zJu09JmZZg80s7XYHx9AgZJCQiwOsJKdS_VXAMD-zdx7zp3k8Wj2yJsU5QOonxrk6H4lmeKSsIT2IMx6TKx42NrYXf91VfmjhUJBZHcZzKmfg4zLDLeV_DtI6utFbl)\n\n\n## Integrating with Pitgull\n\nAlong with Pitgull, we provide a `pitgull-bootstrap` command line utility. This program prepares your GitLab project for integration with Pitgull by deleting existing Scala Steward merge requests and setting up a webhook for triggering Pitgull.\n```\nCLI Arguments:\n --url - your gitlab url like https://gitlab.com/\n --token - your gitlab personal token, needs to have full access to project\n --project - project ID, can be found on project main page\n --bot - user name of Scala Steward bot user\n --webhook - Pitgull target url like https://pitgull.example.com/webhook\n```\n### Why delete existing merge requests?\n\nPitgull will only take action when it's triggered by a webhook. By deleting merge requests we make sure no Scala Steward MR gets unnoticed. If we'd only close them, Scala Steward wouldn't update them, so no webhook would be triggerd.\n\nAdditionally, if you have some legacy merge requests for single library, this program makes sure to clean them up. When Scala Steward notices that some dependency is out of date and MR is missing - it will recreate it, so no worries about skipping any updates.\n\n## Development\n\n### Useful commands/links\n\n- https://gitlab.com/-/graphql-explorer - Gitlab API's GraphiQL\n- `cat example.dhall | dhall-to-json` - normalize example and convert to JSON\n- `http post :8080/webhook @path-to-file.json` - send fake webhook event from file\n\n### Related projects\n\nWe're using https://github.com/polyvariant/caliban-gitlab for some communication with Gitlab,\nas well as https://github.com/softwaremill/tapir + https://github.com/softwaremill/sttp for the actions not available via the GraphQL API.\n\n### Docker\n\nYou're going to need docker and docker-compose (or podman/podman-compose, although it hasn't been confirmed to work here yet).\n\nYou can use the setup in the `docker` directory to run Scala Steward with [the test repository](https://gitlab.com/kubukoz/demo), or customize it to your needs.\nCheckout https://github.com/scala-steward-org/scala-steward/blob/master/docs/running.md#running-scala-steward for more information.\nYou'll need to add a `pass.sh` file that prints your GitLab token to standard output when run (consult the Scala Steward docs to see how).\n\nAfter you're all set-up, run `docker-compose up` inside the `docker` directory (or `docker-compose -f docker/docker-compose.yml up` in the project directory).\n\n## Releasing\n\nDocker images are being pushed on every push to `main` and tags starting with `v`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyvariant%2Fpitgull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyvariant%2Fpitgull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyvariant%2Fpitgull/lists"}