Skip to content

Bundle per project#1025

Merged
martastain merged 25 commits intodevelopfrom
1024-bundles-per-project
Sep 29, 2025
Merged

Bundle per project#1025
martastain merged 25 commits intodevelopfrom
1024-bundles-per-project

Conversation

@martastain
Copy link
Copy Markdown
Member

@martastain martastain commented Feb 18, 2025

This is a prototype of bundles-per-project frontend. It covers just the basics needed for the backend development ( ynput/ayon-backend#521 )

Concepts

Project bundle

Project bundle is a special type of bundle, that can only contain addons that explicitly allow per-project override (allowProjectOverride boolean flag in /api/addons).

When creating a bundle. formData is also populated with addon versions from the current production, so compatibility check works, but it is not possible to change versions of these "inherited" addons. When the bundle is saved, backend removes inherited addons and stores only the overrides in the database

Project bundle setting

Assigning a project bundle to a project is done by [POST] /projects/{projectName}/bundles, that accepts json payload with fields production and staging (you may set different project bunldes for each variant). When set to null, project bundle override is removed and project will use the studio production (or staging) bundle.

Settings

[GET] /api/settings request returns a list of addons that combines studio and project bundle, when project name argument is specified. AddonList component in the addon setting container can display inherited addons differently.

Steps

  • Create project bundles from the bundles page
  • Assign project bundles to projects (somewhere in the project management)
  • Show bundle with applied addon overrides from project bundle in project settings

Design

Creating project bundles

New "project bundle" switch for setting a bundle as a project bundle.
image

Settings bundle selector redesign

  • Variant selectors work the same and update which bundle is selected.
  • Now you can always select any other bundle including project bundles.
image

Set project bundle

image

@martastain martastain linked an issue Feb 18, 2025 that may be closed by this pull request
@martastain
Copy link
Copy Markdown
Member Author

@Innders if you could help me with this one, you'd have it much faster than me:

The idea is to have a button here:

(AddonSettings.jsx)
image
image

That would:

  • open a dialog with a list of bundles, that have isProject flag set
  • user can set or unset the bundle for the current project (using [POST] /projects/{projectName}/bundles ) and the current variant
  • when bundle is changed, it would invalidate addonSettingsList

@martastain martastain assigned martastain and Innders and unassigned martastain Feb 27, 2025
@martastain martastain added the type: feature Adding something new and exciting to the product label Feb 27, 2025
@Innders
Copy link
Copy Markdown
Member

Innders commented Aug 15, 2025

image

@martastain martastain marked this pull request as ready for review August 25, 2025 15:04
@martastain martastain requested review from Innders and Copilot August 25, 2025 15:04
Copy link
Copy Markdown
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 implements a "bundle per project" feature that allows projects to have their own custom bundles for addon management. The implementation includes frontend UI for creating project bundles, assigning them to projects, and displaying them in the settings interface.

  • Converts several JavaScript files to TypeScript for better type safety
  • Adds project bundle creation and assignment functionality
  • Implements new UI components for managing project-specific bundles

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/services/addonSettings.js Adds support for project bundle parameters in addon settings API
src/pages/SettingsPage/Bundles/types.ts Defines TypeScript types for addon and bundle structures
src/pages/SettingsPage/Bundles/NewBundle.tsx Converts to TypeScript and adds project bundle creation
src/pages/SettingsPage/Bundles/BundleForm.tsx Creates new TypeScript component for bundle form with project switch
src/containers/AddonSettings/BundlesSelector.tsx New component for selecting bundles with project bundle support
src/components/PerProjectBundleConfig/* New components for project bundle configuration dialog
shared/src/api/queries/project/updateProject.ts Updates API queries for project bundle management

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +76 to +77
isEqual(formData.addonDevelopment, (previousFormData as any)?.addonDevelopment) &&
formData.name === (previousFormData as any)?.name
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

Using 'as any' type assertion bypasses type safety. Since previousFormData is already typed as LocalBundleFormData | null, you should handle the null case explicitly rather than using 'as any'.

Suggested change
isEqual(formData.addonDevelopment, (previousFormData as any)?.addonDevelopment) &&
formData.name === (previousFormData as any)?.name
isEqual(formData.addonDevelopment, previousFormData?.addonDevelopment) &&
formData.name === previousFormData?.name

Copilot uses AI. Check for mistakes.
Comment on lines +301 to +303
{Shortcuts && (
<Shortcuts shortcuts={shortcuts as any} deps={[addons, selectedAddons] as any} />
)}
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

The condition 'Shortcuts &&' suggests Shortcuts might be undefined, but it's used as a JSX component. If Shortcuts is an optional import, this should be handled properly or the component should be imported correctly.

Suggested change
{Shortcuts && (
<Shortcuts shortcuts={shortcuts as any} deps={[addons, selectedAddons] as any} />
)}
<Shortcuts shortcuts={shortcuts as any} deps={[addons, selectedAddons] as any} />

Copilot uses AI. Check for mistakes.
Comment on lines +155 to +157
let { data: { bundles = [] } = {} } = useListBundlesQuery({ archived: true }) as any
const currentProductionAddons = useMemo(
() => (bundles as any[]).find((b: any) => b.isProduction)?.addons || {},
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

Using 'as any' type assertion removes type safety. The query should be properly typed to avoid potential runtime errors.

Suggested change
let { data: { bundles = [] } = {} } = useListBundlesQuery({ archived: true }) as any
const currentProductionAddons = useMemo(
() => (bundles as any[]).find((b: any) => b.isProduction)?.addons || {},
const { data: { bundles = [] } = {} } = useListBundlesQuery({ archived: true }) as {
data?: { bundles?: Bundle[] }
}
const currentProductionAddons = useMemo(
() => (bundles as Bundle[]).find((b: Bundle) => b.isProduction)?.addons || {},

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@iLLiCiTiT
Copy link
Copy Markdown
Member

iLLiCiTiT commented Sep 10, 2025

It is probably edge case, but if you don't have set any production studio bundle, then this happens. Production variant does not have color highlight. The same happens if there is no staging bundle.
image

@iLLiCiTiT
Copy link
Copy Markdown
Member

I can see dev bundles in production/staging enum, and standard bundles in dev bundles enum.

image

Copy link
Copy Markdown
Member

@iLLiCiTiT iLLiCiTiT left a comment

Choose a reason for hiding this comment

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

Except those 2 UX changes it looks good. But merging should wait for release of AYON launcher.

@iLLiCiTiT
Copy link
Copy Markdown
Member

AYON launcher 1.4.0 released, we can merge this.

@martastain martastain merged commit 5b8a234 into develop Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Adding something new and exciting to the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundles per project

5 participants