Skip to content

#853: wrap GitLab VCS failures#866

Open
GHX5T-SOL wants to merge 2 commits into
yegor256:masterfrom
GHX5T-SOL:853
Open

#853: wrap GitLab VCS failures#866
GHX5T-SOL wants to merge 2 commits into
yegor256:masterfrom
GHX5T-SOL:853

Conversation

@GHX5T-SOL

@GHX5T-SOL GHX5T-SOL commented May 26, 2026

Copy link
Copy Markdown
Contributor

Closes #853.

This PR updates GitlabRepo to wrap GitLab API failures raised by issue reads, close attempts, and comment creation. It covers the GitLab response errors from the ticket plus common transport failures, and it replaces the typoed can' comment read-error text with operation-specific wrapper messages.

What changed:

  • widen issue, close_issue, and add_comment rescue handling from only Gitlab::Error::NotFound to GitLab API errors plus common transport failures
  • cover Faraday::Error, Net::OpenTimeout, Net::ReadTimeout, Errno::ECONNREFUSED, and SocketError in the shared GitLab issue-operation rescue list
  • add focused regressions for forbidden, rate-limit, timeout, and Faraday connection failures

Validation:

  • PICKS=1 bundle exec rake test TEST=test/test_gitlab.rb in Docker Ruby 3.3 with libmagic-dev, Maven, and default JRE: 5 tests, 15 assertions, 0 failures, 0 errors, 0 skips
  • PICKS=1 bundle exec ruby -Itest test/test_gitlab.rb in Docker Ruby 3.3: 5 tests, 15 assertions, 0 failures, 0 errors, 0 skips
  • bundle exec rubocop objects/vcs/gitlab.rb test/test_gitlab.rb: 2 files inspected, no offenses detected
  • bundle exec rubocop: 89 files inspected, no offenses detected
  • git diff --check
  • gitleaks dir --no-banner --redact --log-level error .
  • GitHub Actions for this PR passed: actionlint, bashate, codecov, copyrights, markdown-lint, pdd, rake test, reuse, shellcheck, typos, xcop, yamllint, and Codacy

No secrets or credentials used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitlabRepo#issue and close_issue rescue only NotFound; Unauthorized/Forbidden/TooManyRequests propagate unhandled, plus typo "can' comment"

1 participant