Repository navigation
Raise a clear error when there is no default project - #17
Closed
scschneider44 wants to merge 1 commit into
Closed
scschneider44 wants to merge 1 commit into
scschneider44 wants to merge 1 commit into
Conversation
GET /user/me/default_project now returns null when the user has no default project in the key's organization (rowansci/eyrie#963). default_project() built a Project from that null and failed with a TypeError; it now raises a ValueError saying there is no default project and to set one or pass a folder or project. Folder creation, listing and workflow submission without a folder all go through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After rowansci/eyrie#963,
GET /user/me/default_projectreturnsnull(200) when the user has no default project in the API key's org. Before, it returned a 500.default_project()calledProject(**response.json())on thatnulland failed withTypeError: argument after ** must be a mapping, not NoneType.Changes
default_project()raisesValueError("You have no default project in this organization. Set a default project, or pass a folder or project.")when the API returnsnull. That matches the server's wording for folder-less work.Testing
tests/test_project.pychecks that a default project is returned when there is one, and that a missing one raises the clear error. The second test fails on the old code.uv run prek run --all-files --stage pre-push: ruff, ty, pytest and the other hooks pass.🤖 Generated with Claude Code