Contributing
Thanks for contributing! Here's how to get started:
- Open an issue to discuss the proposed change
- Create a branch from
main - Implement the change with tests
- Make sure tests and linting pass
- Open a pull request targeting
main
Setup
git clone git@github.com:fluence-eu/fluence-gateway-client.git
cd fluence-gateway-client
bin/setup
Requires Ruby 3.2+.
Development
Running tests and linting
bundle exec fluence-ci all # full catalog (lint + security + codequality + docs + tests)
bundle exec fluence-ci lint # rubocop only
bundle exec fluence-ci tests # rspec only
bundle exec fluence-ci docs --report # yardstick threshold check
bundle exec rubocop -a # auto-fix linting (no fluence-ci equivalent)
bundle exec fluence-ci docs --build # generate YARD HTML in doc/
Interactive console
bin/console
Commit Convention
This project follows Conventional Commits.
Format
<type>(<scope>): <description>
[body]
[footer(s)]
Types
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only changes |
style |
Formatting changes (whitespace, commas, etc.) — no logic |
refactor |
Code change that neither fixes a bug nor adds a feature |
perf |
Performance improvement |
test |
Adding or updating tests |
build |
Changes to build system or dependencies |
ci |
CI/CD configuration changes |
chore |
Other changes that don't modify source or tests |
revert |
Revert a previous commit |
Description
- Imperative mood ("add", not "adds" or "added")
- No capital letter at the start
- No period at the end
- Maximum 72 characters
Body (optional)
- Use bullet points with
-for multiple items - Explain why, not what (the diff speaks for itself)
Breaking Changes
Non-backward-compatible changes must be flagged with:
- A
!after the type/scope:feat(client)!: change response format - And/or a
BREAKING CHANGE:footer in the body
Pull Request Convention
PR Title
- Same format as commits:
<type>(<scope>): <description> - Under 72 characters
Rules
- One topic per PR — don't mix unrelated changes
- All tests must pass (
bundle exec rspec) - New code must include tests
- Never commit secrets or credentials
Architecture
lib/fluence-gateway-client.rb # Gem entry point
lib/fluence/gateway/client.rb # Namespace + require tree
lib/fluence/gateway/client/
version.rb # Semantic version (bumped by release workflow)
lib/fluence/gateway/
configuration.rb # SDK configuration (client_id, client_secret, URLs, timeout)
errors.rb # Error classes (Error, AuthenticationError, ConnectionError)
http_client.rb # Singleton HTTP client (OAuth2, path building, token forwarding)
- Client is a thread-safe singleton — HTTP verbs (
get/post/put/patch/delete) are delegated to both the instance and the class - Configuration stores OAuth2 credentials and gateway/appcenter URLs via a
Settingssingleton - Errors define the rescue hierarchy:
Error→AuthenticationError/ConnectionError with_service/with_user_tokenthread-local scopes allow block-level service targeting and end-user token forwarding
Tests
- Framework: RSpec (
spec/**/*_spec.rb) - All new code must be tested
- Coverage enforced at 95% minimum (SimpleCov + Undercover)
- YARD-style doc comments on all public methods
Code Conventions
frozen_string_literal: trueon every Ruby file- Strings: single quotes (unless interpolation is needed)
- RuboCop: no rule disabling without justification
- Version in
lib/fluence/gateway/client/version.rb— do not modify unless for an explicit release - YARD-style doc comments on all public methods
CI
GitHub Actions:
- main.yml — runs on every PR: RuboCop + RSpec + coverage reporting
- docs-deploy.yml — builds the YARD site and publishes to GitHub Pages on
main - docs-measure.yml, docs-pr.yml — yardstick baseline on
main+ sticky coverage-delta comment on PRs - rubocop-measure.yml, rubocop-pr.yml — RuboCop offense baseline + sticky offense-delta comment on PRs
- coverage-measure.yml, coverage-pr.yml — coverage baseline + undercover regression check
- codequality-measure.yml, codequality-pr.yml — reek/flog/flay advisory deltas
- prepare-release.yml —
workflow_dispatchbump (patch/minor/major) opens an auto-merged release PR - release.yml — on release PR merge, creates the tag + GitHub Release with the
.gemattached - publish.yml — on Release published, pushes the gem to GitHub Packages
AI-Assisted Contributions
When using AI tools (Claude, Copilot, etc.) to generate commits or PRs:
- Classify first — determine if the change is critical, major, minor, or trivial
- Focus on the "why" — the diff already shows the "what"
- Skip boilerplate — don't add empty sections or placeholder text
The person opening the PR takes full responsibility for the code. Before submitting:
- [ ] I have read and understood every line of code in this PR
- [ ] I can explain why each change was made
- [ ] I have tested the changes locally
Do not add AI co-author lines (Co-Authored-By), "Generated with" footers, or any AI attribution in commits or PR descriptions.