Skip to content

Send ul cloud runs to the same project as yolo train - #114

Merged
pderrenger merged 1 commit into
ultralytics:mainfrom
JaviChulvi:JaviChulvi/cloud-project-workspace
Oct 14, 2026
Merged

pderrenger merged 1 commit into
ultralytics:mainfrom
JaviChulvi:JaviChulvi/cloud-project-workspace

Conversation

@JaviChulvi

@JaviChulvi JaviChulvi commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

ul cloud train/predict/export kept only the last folder of project= and always used your own account, so project=team/exp landed in your personal account (even for a workspace you can't edit, where it should fail), while local yolo train registers the same value in team/exp.

resolve_project now follows the contract's local-training rule (training.metrics): an existing username before the first slash selects that workspace, checked with account.profile, and the rest of the path joins with dashes. A workspace you can't edit fails with HTTP 403 before anything is uploaded. One extra GET, only when project= contains a slash.

Tested on production against YOLO 8.4.176. For 9 project= forms (plain, own and uppercase prefix, nested, double slash, absolute path, spaces, 128-character truncation, non-username prefix), ul cloud predict, export (including official-weights clones) and train (watched and detached) used the project local yolo train registered. A workspace you can't edit exits 1 with nothing created. Lookup errors (404/400 fall back, 429/500 raise) were checked offline. Team workspaces you can edit are untested; the test account has none. Ruff, pytest and generator drift pass.

This is a CLI-only fix, so it ships with the next contract version.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Cloud train, predict, and export now resolve project= to the Platform owner and project slug using the same path convention as local training.

📊 Key Changes

  • A username before the first slash is looked up as the project owner; the remaining path is joined with dashes and slugified as the project name.
  • If that lookup returns HTTP 400 or 404, the prefix is treated as a local directory and the current account remains the owner; other API errors are propagated.
  • A project value that produces an empty slug now raises a ValueError.
  • Updated the Python SDK documentation with the workspace and path behavior.

🎯 Purpose & Impact

  • project=team/exp now targets the exp project in the team workspace; users without the required workspace access receive an error rather than creating the run in their own account.

resolve_project kept only the last folder of project= and always used the caller's account, so project=team/exp landed in the caller's personal account even when team is a workspace, and a workspace the caller cannot edit silently fell back to their account. It now follows the contract's local-training rule: an existing username before the first slash selects that workspace (account.profile), and the rest of the path joins with dashes.
@UltralyticsAssistant UltralyticsAssistant added bug Something isn't working fixed Bug has been resolved labels Oct 13, 2026
@UltralyticsAssistant

Copy link
Copy Markdown
Member

👋 Hello @JaviChulvi, thank you for submitting a ultralytics/sdk 🚀 PR! This automated message confirms your contribution was received, and an Ultralytics engineer will assist with the review. To ensure a seamless integration of your work, please review the following checklist:

  • ✅ Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • ✅ Synchronize with Source: Confirm your PR is synchronized with the ultralytics/sdk main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • ✅ Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • ✅ Update Documentation: Update the relevant documentation for any new or modified features.
  • ✅ Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • ✅ Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR; the CLA check will comment with signing instructions if needed.
  • ✅ Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔍 PR Review

Made with ❤️ by Ultralytics Actions

Reviewed the project-resolution change and matching documentation in both CLI copies. No concrete behavioral regression found; LGTM.

@UltralyticsAssistant
UltralyticsAssistant dismissed their stale review October 13, 2026 15:17

Superseded by new review

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔍 PR Review 2

Made with ❤️ by Ultralytics Actions

Since review 1, no code changes are present; there were no prior findings to address, and no new issues were found. The project-resolution change and matching documentation look sound. LGTM.

@JaviChulvi
JaviChulvi marked this pull request as ready for review October 13, 2026 15:33

@pderrenger pderrenger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Cold full-diff review of 4b843df found no findings against the Core Principles. The shared CLI resolve_project function owns cloud destination selection and reuses the existing Ultralytics slug helper; the public API contract already defines workspace-prefix behavior for local training. Focused offline checks passed for nested and absolute paths, normalized usernames, lookup failures, empty slugs, project creation, and default privacy. CI confirms generation drift, lint, builds, and all six tests pass on Python 3.11 and 3.14. API-owned versioning remains unchanged.

@pderrenger
pderrenger merged commit 836b589 into ultralytics:main Oct 14, 2026
6 checks passed
@UltralyticsAssistant

Copy link
Copy Markdown
Member

🎉 PR #114 is merged! Thank you @JaviChulvi, with contributions from @pderrenger.

“Alone we can do so little; together we can do so much.” — Helen Keller

This change makes project=team/exp resolve to the exp project in the team workspace, following the same path convention as local training.

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

Labels

bug Something isn't working fixed Bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants