feat:[SG-43421] Migrate FlowAM publish hooks phase1 & 2#217
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #217 +/- ##
==========================================
- Coverage 41.21% 40.09% -1.13%
==========================================
Files 62 60 -2
Lines 5054 4617 -437
==========================================
- Hits 2083 1851 -232
+ Misses 2971 2766 -205
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
carlos-villavicencio-adsk
left a comment
There was a problem hiding this comment.
Looks good for a first phase. I'm not sure if this is considered to change and merge it into the existing hook workflow once the dependencies (framework, etc) are migrated.
My understanding was that the initial plan was to first get the hook in place, and then, after the framework dependency migration, design it so the hooks are picked up automatically when sg_flow_am_id and the draft ID (for publisher) are available in the context. |
20fd6c2 to
d85e923
Compare
a12fe39 to
7769861
Compare
Move Flow AM publish hooks from tk-config-flowam POC into upstream tk-multi-publish2 as a lift-and-shift with no logic changes. Added hooks/flowam/: - collector_dcc.py: DCC-specific collector extending base collector - pre_publish.py: pre-publish validation for Flow AM draft state - publish_alembic_derivative.py: publish alembic derivative workflow - publish_to_flow.py: base publish to Flow AM hook - publish_to_flow_dcc.py: DCC-specific publish to Flow AM hook - icons/alembic.png, icons/flow.png: icons referenced by publish hooks
- Remove collector_dcc.py - only called super() with no additional logic; Toolkit hook chain handles passthrough automatically - Remove alembic.png icon - licensing concern; icon() now returns the alembic icon under hooks/icons/alembic.png - Remove unused `settings` param from _publish_to_flow() across in publish_to_flow.py and its children - Add return type annotations to new (non-overridden) methods: _get_flow_module() -> ModuleType, _get_draft_id() -> str | None - Update class docstrings to accurately describe responsibilities and expected hook chain configuration for each hook - Add finalize() docstring explaining why the no-op override is needed
…tained hook The shared base class FlowPublishPlugin (publish_to_flow.py) and its DCC leaf (publish_to_flow_dcc.py) are merged into a single self-contained DccFlowPublishPlugin in publish_to_flow.py. This removes the 3-class hierarchy (publish_file -> FlowPublishPlugin -> FlowDccPublishPlugin) in favour of two independent plugins - one per context (DCC and desktop) - each subclassing publish_file.py directly. The desktop counterpart lives in tk-desktop. Independent release cycles between the two repos no longer require a shared base class in tk-multi-publish2. Changes: - publish_to_flow.py: rewritten as DccFlowPublishPlugin with all validation (project + draft + conflict check) merged into a single validate(), and _get_flow_args inlined into _publish_to_flow - publish_to_flow_dcc.py: deleted (merged into publish_to_flow.py)
…top subclasses Restore the base + subclass layout from the original tk-config-flowam POC, now living entirely under tk-multi-publish2 (no Flow AM publish hooks in tk-desktop anymore). - publish_to_flow.py: FlowPublishPlugin base class with shared properties, project-level validation, publish/finalize/get_publish_user, and _get_flow_args helper. - publish_to_flow_dcc.py: DccFlowPublishPlugin adds draft validation and conflict check; publishes via publish_dcc_draft. - publish_to_flow_desktop.py: DesktopFlowPublishPlugin rejects Maya files, adds revision validation, and publishes via publish_generic_revision or create_generic_workfile. - collector_desktop.py: desktop-only collector moved from tk-desktop.
- Embed Flow AM publish logic directly into the stock collector, pre_publish, and publish_file hooks, gated on ctx.flow_project_id - Add python/tk_multi_publish2/flowam/ package with publish, validate, inputs, constants, and exceptions modules - Expose flowam package via app.py as self.parent.flowam - collector.py: capture TK_FLOWAM_REVISION_ID_* env var for Desktop revision publishes; block DCC extensions via FLOWAM_DCC_EXTENSIONS - pre_publish.py: add Flow AM project validation branch - publish_file.py: add Flow AM validate/publish/finalize branches for both DCC (draft-based) and Desktop (generic asset) publish paths - publish_alembic_derivative.py: drop load_framework calls, use SDK imports and self.parent.flowam directly - Eliminate tk-framework-flowam dependency
26497fd to
3140a1f
Compare
feat: [SG-43419] Flow AM publish hooks migration (Phase 2) + single file mode - Add single_file_mode param to show_dialog() and AppDialog to restrict publisher to one file when republishing a Flow AM generic asset from Loader
Summary
Migrates Flow AM publish hooks from tk-config-flowam POC into upstream tk-multi-publish2 in two phases, eliminating the tk-framework-flowam dependency.
Phase 1 - Lift-and-shift the hook chain into hooks/flowam/, then refactored into a single self-contained DccFlowPublishPlugin + Desktop counterpart, each subclassing publish_file.py directly.
Phase 2 - Embed Flow AM logic directly into the stock collector.py, pre_publish.py, and publish_file.py hooks, gated on ctx.flow_project_id at runtime. Adds a self-contained python/tk_multi_publish2/flowam/ package for publish orchestration.
Also includes single_file_mode for the publisher dialog (SG-43419), used when republishing an existing Flow AM generic asset from the Desktop Loader.
Note: Non-Flow-AM projects are unaffected - all Flow AM branches are gated on ctx.flow_project_id and engine.flow_host.
Dependencies
Config requirements
The stock hooks now handle Flow AM natively - no hook chain overrides needed for DCC environments.
env/includes/desktop/project.yml:env/includes/maya/apps.yml (same for houdini, nuke):Test plan
TODO