From 321ce0c6fb3536a60ca9fc49f7347cba184a9ade Mon Sep 17 00:00:00 2001 From: Dylan Griffith <dyl.griffith@gmail.com> Date: Wed, 29 May 2024 17:17:49 +1000 Subject: [PATCH] Document how to use housekeeper in other projects and fix active_support This is documentation for how housekeeper could be used in other projects. In testing this I found there was a problem with requiring active_support in other projects so I fixed that as well. --- gems/gitlab-housekeeper/README.md | 16 ++++++++++++++++ .../lib/gitlab/housekeeper/runner.rb | 2 ++ 2 files changed, 18 insertions(+) diff --git a/gems/gitlab-housekeeper/README.md b/gems/gitlab-housekeeper/README.md index 642ace448314e..e73459f18fe94 100644 --- a/gems/gitlab-housekeeper/README.md +++ b/gems/gitlab-housekeeper/README.md @@ -169,3 +169,19 @@ Some best practices to consider when using a once-off keep: 1. Consider adding a link back to this MR in the description of your generated MRs. This allows reviewers to understand where this work comes from and can also help if they want to contribute improvements to an ongoing group of MRs. + +## Using Housekeeper in other projects + +Right now we do not publish housekeeper to RubyGems. We have published it once +to hold the name but it's not up to date. + +In order to use Housekeeper in another project you would need to add the +following to your `Gemfile` and run `bundle install`: + +``` +gem 'gitlab-housekeeper', git: 'https://gitlab.com/gitlab-org/gitlab.git', branch: 'master', glob: 'gems/gitlab-housekeeper/*.gemspec' +``` + +After that you can just run `bundle exec gitlab-housekeeper`. Housekeeper +defaults to loading all keeps in the `./keeps` directory so you would also +create that directory in your project and put your keeps there. diff --git a/gems/gitlab-housekeeper/lib/gitlab/housekeeper/runner.rb b/gems/gitlab-housekeeper/lib/gitlab/housekeeper/runner.rb index 5c9c91f174864..e7e960373bed7 100644 --- a/gems/gitlab-housekeeper/lib/gitlab/housekeeper/runner.rb +++ b/gems/gitlab-housekeeper/lib/gitlab/housekeeper/runner.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'active_support' +require 'active_support/core_ext' require 'active_support/core_ext/string' require 'gitlab/housekeeper/logger' require 'gitlab/housekeeper/keep' -- GitLab