{"id":19134007,"url":"https://github.com/umbrellio/ci_helper","last_synced_at":"2025-07-12T21:36:18.687Z","repository":{"id":40385214,"uuid":"271225393","full_name":"umbrellio/ci_helper","owner":"umbrellio","description":"CIHelper is a gem with Continuous Integration helpers for Ruby","archived":false,"fork":false,"pushed_at":"2023-12-11T07:23:42.000Z","size":73,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-18T03:09:41.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umbrellio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-10T08:44:39.000Z","updated_at":"2024-09-25T14:35:35.000Z","dependencies_parsed_at":"2023-12-09T11:22:36.807Z","dependency_job_id":"85cfb1b0-5b0d-43b4-9caf-07b4153e4fb3","html_url":"https://github.com/umbrellio/ci_helper","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":0.6129032258064516,"last_synced_commit":"2032dc6f537a5e836b2e8d36e0c0205afcef4da5"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fci_helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fci_helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fci_helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fci_helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umbrellio","download_url":"https://codeload.github.com/umbrellio/ci_helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223793136,"owners_count":17203758,"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":[],"created_at":"2024-11-09T06:24:42.792Z","updated_at":"2024-11-09T06:24:43.200Z","avatar_url":"https://github.com/umbrellio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CIHelper   [![Actions Status](https://github.com/umbrellio/ci_helper/workflows/Ruby/badge.svg)](https://github.com/umbrellio/ci_helper/actions) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/ci_helper/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/ci_helper?branch=master) [![Gem Version](https://badge.fury.io/rb/ci-helper.svg)](https://badge.fury.io/rb/ci-helper)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"ci-helper\", require: false\n```\n\nAnd then execute:\n```bash\n$ bundle install\n```\nOr install it yourself as:\n```bash\n$ gem install ci_helper\n```\n\n## Usage\n\n### Command Line\n\nYou can use this gem as command line utility. For example, to lint project by rubocop,\nexecute the following command in the project root:\n```bash\n$ ci-helper RubocopLint # Here's RubocopLint is a command\n```\n\nA command can accept list of options (parameters). Option values are passed through flags.\nFor example, the BundlerAudit command accepts the ignored_advisories option\nYou can set a value of this option by setting the flag `--ignored-advisories ignored-advisory`.\nIt should be noted that all hyphens in flag names are automatically replaced with underscores.\nIf command accepts array as option's value, you can separate values with either commas or spaces.\n```bash\n$ ci-helper BundlerAudit --ignored-advisories first,second # Valid\n$ ci-helper BundlerAudit --ignored-advisories first second # Valid too!\n```\n\nList of available commands:\n\n* **BundlerAudit** — executes `bundler-audit`. Accepted flags: `--ignored-advisories`.\n    * `--ignored-advisories [values]` — accepts advisory codes, delimited by comma.\n* **CheckDBDevelopment** — executes rails db commands (`db:drop`, `db:create`, `db:migrate`)\n    and seeds database. Does not accept flags.\n* **CheckDBRollback** — executes rails db commands with additional command\n    `db:rollback_new_migrations`, which rollbacks migrations, added in tested branch.\n    Does not accept flags. Gem provides this rake task, but only for `Sequel`.\n    If you want to use `ActiveRecord::Migrator`, you'll have to write rake task by your own.\n* **RubocopLint** — executes rubocop linter. Does not accept flags.\n* **RunSpecs** — executes `rspec` in project root.\n    Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`.\n    * `--node-index` — if you run specs in parallel in CI, then you might use this flag.\n    * `--node-total` — if you run specs in parallel in CI, then you might use this flag.\n    * `--with-database` — if you want to prepare database before executing specs,\n        you should set this flag to `true`.\n    * `--split-resultset` — if you run specs in parallel in CI,\n        then you might use this flag to `true`. If this flag set to true,\n        final `.resultset.json` will be renamed to `.resultset.#{node_index}.json`\n* **CheckSpecSuffixes** — checks specs in the spec subdirectories for `_spec` suffix,\n    by default ignores directories `support`, `factories` and files with `context` suffix.\n    Accepted flags: `--extra_paths`, `--ignored_paths`.\n    * `--extra-paths [values]` - accepts additional path patterns that should be scanned,\n        delimited by coma.\n    * `--ignored-paths [values]` - accepts path patterns that should be ignored,\n        delimited by coma.\n* **CheckCoverage** — checks coverage by executing `SimpleCov::collate`.\n    Accepted flags: `--split-resultset`, `--setup-file-path`.\n    * `--split-resultset` — if you execute command `RunSpecs` with `--split-resultset true`,\n        you also should set this flag to `true`. If this flag set to `true`, final coverage will be\n        calculated by merging results in all files, matching the mask `coverage/resultset.*.json`.\n        By default final coverage is calculated using result from `coverage/.resultset.json`.\n    * `--setup-file-path` — relative path to your `.rb` file, which setups `SimpleCov`.\n      Usually it is `spec_helper.rb`.\n* **CheckSidekiqSchedulerConfig** — checks `sidekiq_scheduler` config by trying to resolve jobs constants via `rails runner`.\n    Accepted flags: `--config-path`\n    * `--config-path` — relative path to your config yaml file with schedule.\n      Usually it is `config/sidekiq_scheduler.yml`.\n    * `--with-database` — if you want to prepare database before executing specs,\n      you should set this flag to `true`.\n\n### Rake Tasks\n\nAs you can see, some commands use generic rake tasks. To make tasks available in your application,\nyou need to require the file `ci_helper/railtie`. Also, you can require it directly in `Gemfile`:\n`gem \"ci-helper\", require: \"ci_helper/railtie, group: :test`.\nOr if you haven't set `require` option to `false`, rake tasks loads automatically.\n\n### Script\n\nAlso, you can write your own script, which can executes this commands by calling classes:\n`CIHelper::Commands::#{command_name}`. For example,\nif you want to execute `RunSpecs` command in your script, you can write following lines:\n```ruby\nbegin\n  CIHelper::Commands::RunSpecs.call!(with_database: \"true\") # returned value is exit code.\nrescue CIHelper::Commands::Error =\u003e e # Command raise error with this class if something went wrong.\n  abort e.message\nend\n```\n\n## Adding your own commands\n\nYou can write plugins (gems) that add new commands.\nYou just need create gem with following structure:\n```\n- lib\n  - ci_helper\n    - commands\n      - cool_command.rb\n```\n\nWhere your `CoolCoomand` class may look something like this:\n```ruby\nmodule CIHelper\n  module Commands\n    class CoolCommand \u003c BaseCommand\n      def call\n        execute(\"ls #{options[:cool_options]}\")\n      end\n    end\n  end\nend\n```\n\nThen you add your gem to a Gemfile:\n```ruby\ngem \"ci-helper\", require: false\ngem \"ci-helper-plugin-gem\", require: false\n```\n\nAnd now, you can use your custom command with command line tool:\n```bash\n$ ci-helper CoolCommand --cool-options option_value\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/umbrellio/ci_helper.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Authors\n\nCreated by Ivan Chernov.\n\n\u003ca href=\"https://github.com/umbrellio/\"\u003e\n\u003cimg style=\"float: left;\" src=\"https://umbrellio.github.io/Umbrellio/supported_by_umbrellio.svg\" alt=\"Supported by Umbrellio\" width=\"439\" height=\"72\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fci_helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbrellio%2Fci_helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fci_helper/lists"}