Skip to content

SG-43421 Add Flow AM publish hooks to hooks/flowam/#217

Open
chenm1adsk wants to merge 2 commits into
masterfrom
ticket/SG-43421-flowam-publish-hooks-phase1
Open

SG-43421 Add Flow AM publish hooks to hooks/flowam/#217
chenm1adsk wants to merge 2 commits into
masterfrom
ticket/SG-43421-flowam-publish-hooks-phase1

Conversation

@chenm1adsk
Copy link
Copy Markdown
Contributor

@chenm1adsk chenm1adsk commented May 27, 2026

Summary

Moves Flow AM publish hooks from tk-config-flowam POC into upstream tk-multi-publish2 as a lift-and-shift with no logic changes (Phase 1 of SG-43421). Currently the following hooks will only triggered with custom config. The trigger mechanism will be updated in phase2.

  • Adds hooks/flowam/collector_dcc.py - DCC-specific collector
  • Adds hooks/flowam/pre_publish.py - pre-publish Flow AM draft validation
  • Adds hooks/flowam/publish_alembic_derivative.py - Alembic derivative publish workflow
  • Adds hooks/flowam/publish_to_flow.py - base publish to Flow AM hook
  • Adds hooks/flowam/publish_to_flow_dcc.py - DCC-specific publish to Flow AM hook

Config requirements

More information on tk-config-flowam PR 242

env/includes/maya/apps.yml (same for houdini, nuke)

maya.apps.tk-multi-publish2:
  collector: "{self}/collector.py:{engine}/tk-multi-publish2/basic/collector.py:{self}/flowam/collector_dcc.py"
  pre_publish: "{self}/pre_publish.py:{self}/flowam/pre_publish.py"
  publish_plugins:
  - name: Publish to Flow AM
    hook: "{self}/publish_file.py:{self}/flowam/publish_to_flow.py:{self}/flowam/publish_to_flow_dcc.py:{engine}/tk-multi-publish2/basic/publish_session.py"
    settings: {}
  - name: Publish Alembic Derivative
    hook: "{self}/publish_file.py:{engine}/tk-multi-publish2/basic/publish_session.py:{self}/flowam/publish_alembic_derivative.py"
    settings: {}

env/includes/desktop/project.yml

tk-multi-publish2:
  collector: "{self}/collector.py:{engine}/tk-multi-publish2/flowam/collector.py"
  publish_plugins:
  - name: Publish to Flow AM
    hook: "{self}/publish_file.py:{self}/flowam/publish_to_flow.py:{engine}/tk-multi-publish2/flowam/publish_to_flow.py"
    settings: {}

Test plan

  • DCC (Maya) with Flow AM config - publish new assets / existing assets completes, Flow AM revision created
  • Desktop with Flow AM config - publish new assets / existing assets completes, Flow AM revision created
  • Non-Flow-AM project - publishes normally with no regression, hooks/flowam/ never invoked

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
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.81%. Comparing base (0e27293) to head (d85e923).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
+ Coverage   40.18%   40.81%   +0.62%     
==========================================
  Files          61       63       +2     
  Lines        5027     5109      +82     
==========================================
+ Hits         2020     2085      +65     
- Misses       3007     3024      +17     
Flag Coverage Δ
Linux 40.81% <ø> (+0.62%) ⬆️
Python-3.10 40.81% <ø> (+0.62%) ⬆️
Python-3.11 40.81% <ø> (+0.62%) ⬆️
Python-3.13 40.81% <ø> (+0.62%) ⬆️
Python-3.9 40.81% <ø> (+0.62%) ⬆️
Windows 40.81% <ø> (+0.62%) ⬆️
macOS 40.81% <ø> (+0.62%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chenm1adsk chenm1adsk marked this pull request as ready for review May 27, 2026 17:48
@chenm1adsk chenm1adsk requested a review from a team May 27, 2026 18:19
Copy link
Copy Markdown
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

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.

Comment thread hooks/flowam/publish_to_flow.py
@chenm1adsk
Copy link
Copy Markdown
Contributor Author

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.
For the loader, the trigger condition might be slightly different, but I thought that was the original idea as well.
Please let me know if I’m misunderstanding anything or if there are any gaps in my understanding.
cc: @yungsiow

Comment thread hooks/flowam/pre_publish.py
Comment thread hooks/flowam/publish_alembic_derivative.py Outdated
Comment thread hooks/flowam/publish_alembic_derivative.py
- 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
@chenm1adsk chenm1adsk force-pushed the ticket/SG-43421-flowam-publish-hooks-phase1 branch from 20fd6c2 to d85e923 Compare May 30, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants