Skip to content

fix(api): handle 503 errors without rate limit wording - #218

Merged
matiasdaloia merged 2 commits into
mainfrom
feature/mdaloia/fix-sp-4489-503-error
Jul 9, 2026
Merged

matiasdaloia merged 2 commits into
mainfrom
feature/mdaloia/fix-sp-4489-503-error

Conversation

@matiasdaloia

@matiasdaloia matiasdaloia commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Jira SP-4489.
  • Stops reporting generic HTTP 503 responses as service-limit/rate-limit failures.
  • Lets 503 responses use the existing retry path and final server-body error reporting.

Changes

File Change
src/scanoss/scanossapi.py Removed the special 503 service-limit error branch.
tests/test_scanossapi.py Added regression coverage for retrying/reporting 503 responses.
src/scanoss/__init__.py Bumped version to 1.53.2.
CHANGELOG.md Added 1.53.2 release note.

Test Plan

  • PYTHONPATH=src python -m unittest

Summary by CodeRabbit

  • Bug Fixes
    • Fixed scan requests so HTTP 503 responses are retried instead of being misreported as service limit errors.
    • Error messages now surface the server’s response body, making failures easier to understand.
  • Chores
    • Bumped the package version to 1.53.2.
    • Updated the changelog for the new release.

@matiasdaloia matiasdaloia added the bug Something isn't working label Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6794b41a-f97a-4025-9cae-47d3519268eb

📥 Commits

Reviewing files that changed from the base of the PR and between 3f245bf and db5e521.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/scanoss/__init__.py
  • src/scanoss/scanossapi.py
  • tests/test_scanossapi.py
💤 Files with no reviewable changes (1)
  • src/scanoss/scanossapi.py

📝 Walkthrough

Walkthrough

Removes the special-case HTTP 503 handling branch in ScanossApi.scan, causing 503 responses to follow the generic retry/error path instead of raising a "service limits exceeded" error. Adds a unit test verifying retry behavior. Bumps package version to 1.53.2 and updates the changelog.

Changes

503 Retry Fix

Layer / File(s) Summary
Remove special-case 503 handling and add regression test
src/scanoss/scanossapi.py, tests/test_scanossapi.py
Removes the dedicated service_unavailable branch so HTTP 503 falls through to the generic bad_request-and-above retry flow; adds a test mocking two consecutive 503 responses, asserting the exception contains "HTTP 503" and the response body, excludes "service limits" wording, and that session.post is called exactly twice.
Version bump and changelog entry
src/scanoss/__init__.py, CHANGELOG.md
Bumps __version__ from 1.53.1 to 1.53.2 and adds a changelog entry with a Fixed note and a compare link for 1.53.2.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • scanoss/scanoss.py#214: Both PRs modify ScanossApi.scan()'s HTTP 503 error/retry handling to make 503 retryable and surface the server response body.
  • scanoss/scanoss.py#213: Both PRs bump the __version__ constant in src/scanoss/__init__.py.
  • scanoss/scanoss.py#137: Both PRs touch the same versioning surface in src/scanoss/__init__.py and corresponding CHANGELOG.md entries.

Suggested reviewers: ortizjeronimo, scanoss-qg

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: handling HTTP 503 errors via retry flow instead of rate-limit wording.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/mdaloia/fix-sp-4489-503-error
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feature/mdaloia/fix-sp-4489-503-error

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

…p-4489-503-error

# Conflicts:
#	CHANGELOG.md
#	src/scanoss/__init__.py
#	src/scanoss/scanossapi.py
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

SCANOSS SCAN Completed 🚀

  • Detected components: 2
  • Undeclared components: 0
  • Declared components: 2
  • Detected files: 113
  • Detected files undeclared: 0
  • Detected files declared: 113
  • Licenses detected: 1
  • Licenses detected with copyleft: 0
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@matiasdaloia
matiasdaloia merged commit 023538f into main Jul 9, 2026
6 checks passed
@matiasdaloia
matiasdaloia deleted the feature/mdaloia/fix-sp-4489-503-error branch July 9, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant