diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-08 06:15:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-08 06:15:41 +0300 |
commit | 777ef5e9b2cb049db6c25867d8321a191cec8f72 (patch) | |
tree | 8e2458bdde3047bb367e99e9d7de9862107e6212 /gems | |
parent | 6352d2f7c2a9e62e07f854861f9f57dacbd6f4a4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'gems')
14 files changed, 244 insertions, 0 deletions
diff --git a/gems/gitlab-database-lock_retries/.gitignore b/gems/gitlab-database-lock_retries/.gitignore new file mode 100644 index 00000000000..b04a8c840df --- /dev/null +++ b/gems/gitlab-database-lock_retries/.gitignore @@ -0,0 +1,11 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking +.rspec_status diff --git a/gems/gitlab-database-lock_retries/.gitlab-ci.yml b/gems/gitlab-database-lock_retries/.gitlab-ci.yml new file mode 100644 index 00000000000..afe0b651d5d --- /dev/null +++ b/gems/gitlab-database-lock_retries/.gitlab-ci.yml @@ -0,0 +1,4 @@ +include: + - local: gems/gem-pg.gitlab-ci.yml + inputs: + gem_name: "gitlab-database-lock_retries" diff --git a/gems/gitlab-database-lock_retries/.rspec b/gems/gitlab-database-lock_retries/.rspec new file mode 100644 index 00000000000..34c5164d9b5 --- /dev/null +++ b/gems/gitlab-database-lock_retries/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper diff --git a/gems/gitlab-database-lock_retries/.rubocop.yml b/gems/gitlab-database-lock_retries/.rubocop.yml new file mode 100644 index 00000000000..8c670b439d3 --- /dev/null +++ b/gems/gitlab-database-lock_retries/.rubocop.yml @@ -0,0 +1,2 @@ +inherit_from: + - ../config/rubocop.yml diff --git a/gems/gitlab-database-lock_retries/CHANGELOG.md b/gems/gitlab-database-lock_retries/CHANGELOG.md new file mode 100644 index 00000000000..d4fe5180c48 --- /dev/null +++ b/gems/gitlab-database-lock_retries/CHANGELOG.md @@ -0,0 +1,5 @@ +## [Unreleased] + +## [0.1.0] - 2023-11-29 + +- Initial release diff --git a/gems/gitlab-database-lock_retries/Gemfile b/gems/gitlab-database-lock_retries/Gemfile new file mode 100644 index 00000000000..c5cc5cf5513 --- /dev/null +++ b/gems/gitlab-database-lock_retries/Gemfile @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# Specify your gem's dependencies in gitlab-database-lock_retries.gemspec +gemspec diff --git a/gems/gitlab-database-lock_retries/Gemfile.lock b/gems/gitlab-database-lock_retries/Gemfile.lock new file mode 100644 index 00000000000..36618f6f5ae --- /dev/null +++ b/gems/gitlab-database-lock_retries/Gemfile.lock @@ -0,0 +1,105 @@ +PATH + remote: . + specs: + gitlab-database-lock_retries (0.1.0) + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.1.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.4) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + diff-lcs (1.5.0) + drb (2.2.0) + ruby2_keywords + gitlab-styles (10.1.0) + rubocop (~> 1.50.2) + rubocop-graphql (~> 0.18) + rubocop-performance (~> 1.15) + rubocop-rails (~> 2.17) + rubocop-rspec (~> 2.22) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.6.3) + minitest (5.20.0) + mutex_m (0.2.0) + parallel (1.23.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (3.0.8) + rainbow (3.1.1) + regexp_parser (2.8.2) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.50.2) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.2.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.19.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-graphql (0.19.0) + rubocop (>= 0.87, < 2) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-rails (2.22.2) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + +PLATFORMS + ruby + +DEPENDENCIES + gitlab-database-lock_retries! + gitlab-styles (~> 10.1.0) + rspec (~> 3.0) + +BUNDLED WITH + 2.4.22 diff --git a/gems/gitlab-database-lock_retries/README.md b/gems/gitlab-database-lock_retries/README.md new file mode 100644 index 00000000000..249ca12a044 --- /dev/null +++ b/gems/gitlab-database-lock_retries/README.md @@ -0,0 +1,29 @@ +# Gitlab::Database::LockRetries + +This gem provides a way to automatically execute code that relies on acquiring a database lock in a way designed to minimize impact on a busy production database. + +## Installation + +TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org. + +Install the gem and add to the application's Gemfile by executing: + + $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG + +If bundler is not being used to manage dependencies, install the gem by executing: + + $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gitlab-database-lock_retries. diff --git a/gems/gitlab-database-lock_retries/Rakefile b/gems/gitlab-database-lock_retries/Rakefile new file mode 100644 index 00000000000..cca71754493 --- /dev/null +++ b/gems/gitlab-database-lock_retries/Rakefile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +require "rubocop/rake_task" + +RuboCop::RakeTask.new + +task default: %i[spec rubocop] diff --git a/gems/gitlab-database-lock_retries/gitlab-database-lock_retries.gemspec b/gems/gitlab-database-lock_retries/gitlab-database-lock_retries.gemspec new file mode 100644 index 00000000000..ee019705c3d --- /dev/null +++ b/gems/gitlab-database-lock_retries/gitlab-database-lock_retries.gemspec @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require_relative "lib/gitlab/database/lock_retries/version" + +Gem::Specification.new do |spec| + spec.name = "gitlab-database-lock_retries" + spec.version = Gitlab::Database::LockRetries::VERSION + spec.authors = ["group::database"] + spec.email = ["engineering@gitlab.com"] + + spec.summary = "Gem summary" + spec.description = "A more descriptive text about what the gem is doing." + spec.homepage = "https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-database-lock_retries" + spec.license = "MIT" + spec.required_ruby_version = ">= 3.0" + spec.metadata["rubygems_mfa_required"] = "true" + + spec.files = Dir['lib/**/*.rb'] + spec.require_paths = ["lib"] + + spec.add_development_dependency "gitlab-styles", "~> 10.1.0" + spec.add_development_dependency "rspec", "~> 3.0" +end diff --git a/gems/gitlab-database-lock_retries/lib/gitlab/database/lock_retries.rb b/gems/gitlab-database-lock_retries/lib/gitlab/database/lock_retries.rb new file mode 100644 index 00000000000..ea504ea09d5 --- /dev/null +++ b/gems/gitlab-database-lock_retries/lib/gitlab/database/lock_retries.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require_relative "lock_retries/version" + +module Gitlab + module Database + module LockRetries + # Your code goes here... + end + end +end diff --git a/gems/gitlab-database-lock_retries/lib/gitlab/database/lock_retries/version.rb b/gems/gitlab-database-lock_retries/lib/gitlab/database/lock_retries/version.rb new file mode 100644 index 00000000000..f290842df4b --- /dev/null +++ b/gems/gitlab-database-lock_retries/lib/gitlab/database/lock_retries/version.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Gitlab + module Database + module LockRetries + VERSION = "0.1.0" + end + end +end diff --git a/gems/gitlab-database-lock_retries/spec/gitlab/database/lock_retries_spec.rb b/gems/gitlab-database-lock_retries/spec/gitlab/database/lock_retries_spec.rb new file mode 100644 index 00000000000..faac321f881 --- /dev/null +++ b/gems/gitlab-database-lock_retries/spec/gitlab/database/lock_retries_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +RSpec.describe Gitlab::Database::LockRetries do + it "has a version number" do + expect(Gitlab::Database::LockRetries::VERSION).not_to be nil + end + + xit "does something useful" +end diff --git a/gems/gitlab-database-lock_retries/spec/spec_helper.rb b/gems/gitlab-database-lock_retries/spec/spec_helper.rb new file mode 100644 index 00000000000..95fdf74bf99 --- /dev/null +++ b/gems/gitlab-database-lock_retries/spec/spec_helper.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "gitlab/database/lock_retries" + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end |