Skip to content

fix: three small fixes — workspace count, python version, bare raise - #6701

Open
Timelovers wants to merge 2 commits into
crewAIInc:mainfrom
Timelovers:fix/triple-bug-fixes
Open

fix: three small fixes — workspace count, python version, bare raise#6701
Timelovers wants to merge 2 commits into
crewAIInc:mainfrom
Timelovers:fix/triple-bug-fixes

Conversation

@Timelovers

Copy link
Copy Markdown

Fixes #6664, fixes #6662, fixes #6568.

Three small fixes:

  1. CONTRIBUTING.md — workspace count was "four" but pyproject.toml lists 6 packages.
  2. .python-version — was 3.13 but CI and CONTRIBUTING.md target 3.12.
  3. factory.py — two bare raise outside except blocks caused RuntimeError: No active exception to re-raise instead of meaningful PermanentUploadError.

- CONTRIBUTING.md: correct workspace count from four to six
  The pyproject.toml lists 6 packages, not 4. Fixes crewAIInc#6664

- .python-version: align with CI and CONTRIBUTING.md (3.12)
  The workflow and docs target 3.12 but .python-version said 3.13.
  Fixes crewAIInc#6662

- factory.py: replace bare raise with PermanentUploadError
  Two bare raise statements outside except blocks caused
  RuntimeError: No active exception to re-raise instead of
  meaningful error messages. Fixes crewAIInc#6568

Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1acdb239-101c-47c6-a9e5-d764fb51c223

📥 Commits

Reviewing files that changed from the base of the PR and between 831be0d and cb68d13.

📒 Files selected for processing (2)
  • .github/CONTRIBUTING.md
  • lib/crewai-files/src/crewai_files/uploaders/factory.py
💤 Files with no reviewable changes (1)
  • lib/crewai-files/src/crewai_files/uploaders/factory.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/CONTRIBUTING.md

📝 Walkthrough

Walkthrough

The PR replaces two invalid bare raises in the uploader factory with PermanentUploadError messages, updates .python-version from 3.13 to 3.12, and corrects the workspace documentation from four to six packages.

Changes

Repository and uploader updates

Layer / File(s) Summary
Explicit uploader configuration errors
lib/crewai-files/src/crewai_files/uploaders/factory.py
Missing Bedrock S3 configuration and unsupported uploader providers now raise PermanentUploadError with explicit messages.
Repository version and workspace metadata
.github/CONTRIBUTING.md, .python-version
The documentation lists six uv workspace packages, and the declared Python version is changed to 3.12.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the three fixes in the changeset and is concise.
Description check ✅ Passed The description directly matches the code changes and explains each fix clearly.
Linked Issues check ✅ Passed The PR addresses all three linked issues by correcting the workspace count, Python version, and uploader error handling.
Out of Scope Changes check ✅ Passed The changes are limited to the documented fixes and do not show unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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)
lib/crewai-files/src/crewai_files/uploaders/factory.py (1)

191-201: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Treat empty and None bucket values as missing configuration.

The guard only checks whether "bucket_name" exists in kwargs. If callers pass bucket_name=None or bucket_name="", this branch is skipped; BedrockFileUploader then raises its ValueError later instead of the intended PermanentUploadError.

-        if (
-            not os.environ.get("CREWAI_BEDROCK_S3_BUCKET")
-            and "bucket_name" not in kwargs
-        ):
+        if not (
+            kwargs.get("bucket_name")
+            or os.environ.get("CREWAI_BEDROCK_S3_BUCKET")
+        ):

The Bedrock uploader treats falsy bucket_name values as unconfigured, so the factory should apply the same contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-files/src/crewai_files/uploaders/factory.py` around lines 191 -
201, Update the Bedrock S3 configuration guard in the uploader factory to treat
missing, None, and empty bucket_name values as unconfigured, while still
honoring a non-empty kwargs value or CREWAI_BEDROCK_S3_BUCKET. Ensure these
cases raise the existing PermanentUploadError before constructing
BedrockFileUploader.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/CONTRIBUTING.md:
- Line 32: Update the workspace description in CONTRIBUTING.md so its stated
package count matches the package table: either add the two missing packages to
the table or explicitly identify the table as a partial selection.

In `@lib/crewai-files/src/crewai_files/uploaders/factory.py`:
- Around line 215-220: Remove the unreachable logger.debug call and bare raise
after the unconditional PermanentUploadError in the uploader factory method.
Update that public method’s docstring to state that unsupported providers raise
PermanentUploadError instead of returning None.

---

Outside diff comments:
In `@lib/crewai-files/src/crewai_files/uploaders/factory.py`:
- Around line 191-201: Update the Bedrock S3 configuration guard in the uploader
factory to treat missing, None, and empty bucket_name values as unconfigured,
while still honoring a non-empty kwargs value or CREWAI_BEDROCK_S3_BUCKET.
Ensure these cases raise the existing PermanentUploadError before constructing
BedrockFileUploader.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 025788e6-3166-40ee-af0c-dd32a9462e37

📥 Commits

Reviewing files that changed from the base of the PR and between 2e95bfb and 831be0d.

📒 Files selected for processing (3)
  • .github/CONTRIBUTING.md
  • .python-version
  • lib/crewai-files/src/crewai_files/uploaders/factory.py

Comment thread .github/CONTRIBUTING.md
Comment on lines 215 to 220
raise PermanentUploadError(
f"No file uploader available for provider: {provider}"
)

logger.debug(f"No file uploader available for provider: {provider}")
raise

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the unreachable fallback and update the public contract.

The new unconditional PermanentUploadError makes the logger and bare raise at Lines 219-220 unreachable. Also, the docstring still states that unsupported providers return None, while this implementation now raises. Remove the dead fallback and document the exception behavior.

As per coding guidelines, public APIs should document their behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-files/src/crewai_files/uploaders/factory.py` around lines 215 -
220, Remove the unreachable logger.debug call and bare raise after the
unconditional PermanentUploadError in the uploader factory method. Update that
public method’s docstring to state that unsupported providers raise
PermanentUploadError instead of returning None.

Source: Coding guidelines

- Add missing cli and crewai-core packages to CONTRIBUTING.md table
- Remove unreachable logger.debug and bare raise after PermanentUploadError

Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant