Skip to content

Conversation

@martastain
Copy link
Member

@martastain martastain commented Dec 16, 2025

This pull request introduces a new "project folders" feature, allowing projects to be organized into hierarchical folders. It adds a new API for managing project folders, updates the project model and endpoints to support folder assignment, and creates the necessary database schema. The changes also ensure that folder information is available via both REST and GraphQL APIs.

Project Folders API and Models:

  • Added a new project_folders.py module with models (ProjectFolderModel, ProjectFolderPostModel, etc.) and endpoints to create, update, delete, list, and reorder project folders. This includes validation, permissions, and error handling.

  • Updated the project listing (ListProjectsItemModel in list_projects.py) to include an optional project_folder field, and modified the list logic to populate this field from the project's data.

  • Updated GraphQL project nodes and resolvers to include and return the project_folder field, ensuring folder assignment is accessible via GraphQL queries.
    Database Schema:

  • Added a new project_folders table to the database schema, including fields for hierarchy, position, and metadata, along with a unique index for folder labels within the same parent.

image

Enhanced list project endpoint

This PR also addresses #804 by adding library and pinned flags to [GET] /api/projects result

image

Notes

  • You need to run make setup after checking out this PR in order to create the database table.
  • This feature mimics entityListFolders functionality (minus owner and acl), so calls are very similar

@martastain martastain linked an issue Dec 16, 2025 that may be closed by this pull request
@martastain martastain self-assigned this Dec 16, 2025
@martastain martastain linked an issue Dec 16, 2025 that may be closed by this pull request
1 task
@martastain martastain added the type: enhancement Improvement of existing functionality or minor addition label Dec 16, 2025
Co-authored-by: Filip Vnenčák <vnencak.filip@gmail.com>
@martastain martastain requested a review from Copilot December 16, 2025 15:19
Copy link
Contributor

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

This PR introduces a hierarchical project folders feature to organize projects, along with enhancements to the project listing endpoint. The implementation includes a new database table, REST API endpoints for folder management, and GraphQL integration to expose folder assignments.

Key Changes:

  • Added comprehensive project folders API with CRUD operations, ordering, and project assignment capabilities
  • Enhanced project listing endpoint to include library, pinned, and project_folder fields
  • Integrated folder information across REST and GraphQL APIs

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
schemas/schema.public.sql Creates project_folders table with hierarchical structure and unique constraint on parent/label combinations
ayon_server/graphql/nodes/project.py Adds project_folder field to ProjectNode and resolver to expose folder assignment via GraphQL
ayon_server/graphql/resolvers/projects.py Extracts project_folder from project data in GraphQL queries
api/projects/list_projects.py Modernizes field annotations, adds library, pinned, and project_folder fields to response model
api/project_folders/router.py Establishes router for project folders API endpoints
api/project_folders/project_folders.py Implements complete project folders API with models and endpoints for managing folder hierarchy
api/project_folders/init.py Module initialization for project folders API

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

FFolderParentID = Field(title="Parent folder ID", **EntityID.META)
FFolderData = Field(
title="Folder additional data",
default_factory=lambda: ProjectFolderData(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project folders Project: Add more data to projects endpoint

3 participants