Skip to content

Add endpoint for retrieving available project resources#645

Open
mxsrc wants to merge 2 commits intodevfrom
available-project-resources
Open

Add endpoint for retrieving available project resources#645
mxsrc wants to merge 2 commits intodevfrom
available-project-resources

Conversation

@mxsrc
Copy link
Collaborator

@mxsrc mxsrc commented Feb 26, 2026

Introduce an endpoint to check a project's available resources. The endpoint is embedded in the regular endpoint hierarchy and uses newly introduced helpers for computation because the existing logic is convoluted and resists incremental change. The idea is to replace it eventually by the new approach that uses dedicated abstractions for handling resource computations.

@mxsrc mxsrc added the deploy label Feb 26, 2026
@mxsrc mxsrc force-pushed the available-project-resources branch from 2aae38f to 96ea320 Compare February 26, 2026 19:24
@mxsrc mxsrc requested a review from boddumanohar February 26, 2026 19:24
@mxsrc mxsrc marked this pull request as ready for review February 26, 2026 19:25
@mxsrc mxsrc force-pushed the available-project-resources branch from 41296bf to f4f8e71 Compare February 27, 2026 10:48
@mxsrc mxsrc removed the deploy label Feb 27, 2026
@mxsrc mxsrc force-pushed the available-project-resources branch from 9ec95c9 to 0221bdd Compare February 27, 2026 11:53
@mxsrc mxsrc added the deploy label Feb 27, 2026
Base automatically changed from dev to main February 27, 2026 14:33
@boddumanohar boddumanohar changed the base branch from main to dev March 3, 2026 02:58
Base automatically changed from dev to main March 4, 2026 12:01
@mxsrc mxsrc changed the base branch from main to dev March 4, 2026 15:27
@mxsrc mxsrc force-pushed the available-project-resources branch from 0221bdd to d5bcf2f Compare March 5, 2026 07:02
@mxsrc mxsrc marked this pull request as draft March 5, 2026 07:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new set of resource “limits / allocations / available” endpoints (system-, organization-, and project-scoped) backed by newly introduced helper dataclasses and computation helpers in the resource-limit utility layer.

Changes:

  • Introduces Limits/Resources dataclasses and new system_* / organization_* / project_* helper functions for resource computations.
  • Adds new REST endpoints under /resources, /organizations/{org_id}/resources, and /organizations/{org_id}/projects/{project_id}/resources.
  • Adds a Project.storage_enabled async property to conditionally hide storage_size in some project resource responses.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/api/_util/resourcelimit.py Adds Limits/Resources abstractions and new system/org/project limit/allocation/available helpers.
src/api/resources.py Renames router to api and adds system-level /resources/{limits,allocations,available} endpoints.
src/api/organization/resources.py Adds organization-scoped /resources/{limits,allocations,available} endpoints plus limit updates.
src/api/organization/project/resources.py Adds project-scoped /resources/{limits,allocations,available} endpoints plus limit updates and conditional storage field exclusion.
src/api/organization/project/init.py Wires the new project resources router and modifies project persistence during creation.
src/api/organization/init.py Wires the new organization resources router.
src/api/init.py Wires the (renamed) top-level resources router.
src/models/project.py Adds an async storage_enabled property based on presence of storage limits.
src/_util/init.py Adds empty() and single_or_none() helpers used by new resource computations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@mxsrc mxsrc force-pushed the available-project-resources branch from ce97876 to 86bafb2 Compare March 12, 2026 18:32
@mxsrc mxsrc force-pushed the available-project-resources branch from 86bafb2 to b7b12e0 Compare March 12, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants