Skip to content

feat: add address_code field to shipping address#9

Merged
KostasKostogloy merged 9 commits into
masterfrom
feature/add_address_code_to_shipping_address
Feb 19, 2026
Merged

feat: add address_code field to shipping address#9
KostasKostogloy merged 9 commits into
masterfrom
feature/add_address_code_to_shipping_address

Conversation

@KostasKostogloy

Copy link
Copy Markdown
Contributor

No description provided.

@KostasKostogloy KostasKostogloy self-assigned this Feb 19, 2026
@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds an address_code field across Desertcart ShippingAddress (resource, serializer, deserializer, create/update contracts). Bumps Ruby toolchain/target versions (gemspec, .ruby-version, .tool-versions, RuboCop) and updates CI and .gitignore entries.

Changes

Cohort / File(s) Summary
ShippingAddress resource & (de)serialization
lib/desertcart/resources/shipping_address.rb, lib/desertcart/shipping_address/deserializer.rb, lib/desertcart/shipping_address/serializer.rb
Added address_code attribute to the resource, deserializer, and serializer.
Operation contracts
lib/desertcart/shipping_address/operations/create.rb, lib/desertcart/shipping_address/operations/update.rb
Added optional address_code parameter (maybe(:string)) to create and update LedgerSync contracts.
Ruby runtime & tooling
.ruby-version, desertcart.gemspec, .tool-versions, .rubocop.yml
Updated Ruby version targets: .ruby-version3.2.0, spec.required_ruby_version>= 3.2, added .tool-versions with ruby 3.3.5, and set RuboCop target to Ruby 3.2.
CI workflow
.github/workflows/ruby.yml
Updated GitHub Actions Ruby matrix to ["3.2", "3.3"] and changed ruby/setup-ruby usage to v1.
Repository ignores
.gitignore
Added ignore entries for RubyMine / .idea.
Minor formatting
lib/desertcart/client.rb
Adjusted indentation of header merge calls; no semantic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the purpose and scope of the address_code field addition.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding an address_code field to the shipping address resource, which is the primary objective of this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add_address_code_to_shipping_address

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.ruby-version:
- Line 1: The .ruby-version currently pins the runtime to the initial patch
"ruby-3.1.0"; update this to track the latest 3.1.x security/stability patch by
replacing "ruby-3.1.0" with the most recent 3.1 patch string (e.g.,
"ruby-3.1.<latest-patch>") or otherwise use a team-approved strategy for patch
updates so the project (file ".ruby-version") receives 3.1.x security fixes.

In `@desertcart.gemspec`:
- Line 17: Update documentation to reflect the gemspec change that requires Ruby
>= 3.1: add an entry under the [Unreleased] section of CHANGELOG.md noting that
this release drops support for Ruby < 3.1 and describe it as a breaking change,
and update README.md to include a clear "Requirements" or "Compatibility"
section stating "Ruby 3.1 or newer is required" (or similar) so it aligns with
spec.required_ruby_version = '>= 3.1'.

Comment thread .ruby-version Outdated
Comment thread desertcart.gemspec Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ruby.yml:
- Line 24: Update the deprecated checkout action usage by replacing the
reference "uses: actions/checkout@v2" with the current stable release "uses:
actions/checkout@v6" so the workflow runs on modern runners; locate the checkout
step in the workflow file where "actions/checkout@v2" is used and change the
version tag to "@v6" (optionally preserve any existing "with:" keys such as
fetch-depth if present).

In `@desertcart.gemspec`:
- Line 17: The gemspec now sets spec.required_ruby_version = '>= 3.2', but
.rubocop.yml still has AllCops->TargetRubyVersion set to 2.7; update
.rubocop.yml to set TargetRubyVersion to 3.2 so RuboCop lints against the
correct Ruby version and CI stops failing. Locate the TargetRubyVersion entry in
.rubocop.yml and change its value from 2.7 to 3.2, then run RuboCop/CI locally
to verify no further version mismatches.

---

Duplicate comments:
In @.ruby-version:
- Line 1: The .ruby-version currently pins Ruby to the initial patch release
"ruby-3.2.0"; update this to the latest 3.2.x security/stability patch (for
example "ruby-3.2.7") by replacing the value in the .ruby-version file so the
project uses the current patched 3.2 release.

Comment thread .github/workflows/ruby.yml
Comment thread desertcart.gemspec
@KostasKostogloy KostasKostogloy force-pushed the feature/add_address_code_to_shipping_address branch from 5fba21b to b2a7ff1 Compare February 19, 2026 16:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
desertcart.gemspec (1)

34-34: ⚠️ Potential issue | 🔴 Critical

Pin RuboCop to a version that supports Ruby 3.2.

The unpinned rubocop dependency is causing the CI failure because older versions don't recognize Ruby 3.2 as a valid TargetRubyVersion. Pin to >= 1.31 which added Ruby 3.2 support.

🐛 Proposed fix
-  spec.add_development_dependency 'rubocop'
+  spec.add_development_dependency 'rubocop', '>= 1.31'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@desertcart.gemspec` at line 34, The unpinned RuboCop dev dependency in the
gemspec (the line spec.add_development_dependency 'rubocop') must be constrained
to a version that supports Ruby 3.2; change that declaration to pin RuboCop to a
compatible range (for example ">= 1.31") so CI recognizes TargetRubyVersion 3.2,
then run bundle install/update to lock the new version into the Gemfile.lock.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.ruby-version:
- Line 1: Align the Ruby version strings between .ruby-version and
.tool-versions to avoid mismatch: update the .ruby-version entry (currently
"ruby-3.2.0") to match the version format and value used in .tool-versions (or
vice versa), and prefer a current 3.2.x patch release instead of 3.2.0 for
stability/security; ensure both files reference the same exact Ruby version
(e.g., 3.2.<latest-patch>) and use the same formatting between the two files.

In @.tool-versions:
- Line 1: The Ruby versions are inconsistent between .tool-versions and
.ruby-version; pick the canonical Ruby version you want to standardize on (e.g.,
3.3.5 or 3.2.0) and update both files to the same string so asdf and rbenv users
get identical versions—edit .tool-versions and .ruby-version to contain the
chosen version (ensure the format matches each file's expected syntax) and
commit the change.

---

Outside diff comments:
In `@desertcart.gemspec`:
- Line 34: The unpinned RuboCop dev dependency in the gemspec (the line
spec.add_development_dependency 'rubocop') must be constrained to a version that
supports Ruby 3.2; change that declaration to pin RuboCop to a compatible range
(for example ">= 1.31") so CI recognizes TargetRubyVersion 3.2, then run bundle
install/update to lock the new version into the Gemfile.lock.

---

Duplicate comments:
In @.github/workflows/ruby.yml:
- Around line 21-26: Replace the deprecated checkout action used in the workflow
step "uses: actions/checkout@v2" with the latest major release (e.g.,
actions/checkout@vX) by updating that "uses: actions/checkout@v2" line in the
workflow; verify the current latest tag (via the provided curl/JQ check) and
change only that step, leaving the "uses: ruby/setup-ruby@v1" step intact.

In `@desertcart.gemspec`:
- Line 17: Update documentation to reflect the breaking change from Ruby 2.7 to
3.2 by (1) adding an explicit note under the [Unreleased] section in
CHANGELOG.md that the gem now requires Ruby >= 3.2 (mentioning the previous
minimum was 2.7 and that this is a breaking change), and (2) adding a
"Requirements" or "Prerequisites" section in README.md that states "Ruby >= 3.2"
(and a short compatibility note for older apps), referencing the change made to
spec.required_ruby_version to help users discover the requirement quickly.

Comment thread .ruby-version
@@ -1 +1 @@
ruby-2.7.2 No newline at end of file
ruby-3.2.0 No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for Ruby version specifications across the repository
echo "=== .ruby-version ==="
cat .ruby-version

echo -e "\n=== .tool-versions ==="
cat .tool-versions 2>/dev/null || echo "File not found"

echo -e "\n=== gemspec required_ruby_version ==="
rg -n "required_ruby_version" desertcart.gemspec

Repository: desertcart/desertcart-ruby

Length of output: 218


Align Ruby versions between .ruby-version and .tool-versions.

.ruby-version specifies ruby-3.2.0 while .tool-versions specifies ruby 3.3.5. This inconsistency can cause confusion for developers using different version managers. Consider aligning these files to the same version, and consider using the latest 3.2.x patch release instead of 3.2.0 for security and stability updates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.ruby-version at line 1, Align the Ruby version strings between
.ruby-version and .tool-versions to avoid mismatch: update the .ruby-version
entry (currently "ruby-3.2.0") to match the version format and value used in
.tool-versions (or vice versa), and prefer a current 3.2.x patch release instead
of 3.2.0 for stability/security; ensure both files reference the same exact Ruby
version (e.g., 3.2.<latest-patch>) and use the same formatting between the two
files.

Comment thread .tool-versions
@@ -0,0 +1 @@
ruby 3.3.5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Version mismatch with .ruby-version.

This file specifies Ruby 3.3.5 for asdf users, while .ruby-version specifies 3.2.0 for rbenv users. This inconsistency can lead to "works on my machine" issues. Align both files to use the same Ruby version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.tool-versions at line 1, The Ruby versions are inconsistent between
.tool-versions and .ruby-version; pick the canonical Ruby version you want to
standardize on (e.g., 3.3.5 or 3.2.0) and update both files to the same string
so asdf and rbenv users get identical versions—edit .tool-versions and
.ruby-version to contain the chosen version (ensure the format matches each
file's expected syntax) and commit the change.

@KostasKostogloy KostasKostogloy merged commit 305e1b5 into master Feb 19, 2026
2 of 3 checks passed
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.

1 participant