Skip to content

feat: [SG-43418] Replace env var side channel with show_dialog parameters#141

Draft
chenm1adsk wants to merge 1 commit into
masterfrom
ticket/SG-43418-improve-loader-context-propagation
Draft

feat: [SG-43418] Replace env var side channel with show_dialog parameters#141
chenm1adsk wants to merge 1 commit into
masterfrom
ticket/SG-43418-improve-loader-context-propagation

Conversation

@chenm1adsk

@chenm1adsk chenm1adsk commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The Loader previously used TK_FLOWAM_REVISION_ID_* environment variables
to pass am_revision_id to the Publisher, which caused race conditions when
multiple Publisher dialogs were open simultaneously.

Replace with clean parameter passing via show_dialog(context, root_item_properties):

  • When publishing new generic asset: pass entity_ctx so Publisher can pre-fill the context widget and use task/entity for MEDM hierarchy placement.
  • When publishing existing generic asset revision: pass context=None and root_item_properties={"am_revision_id": revision_id} so the publish hook receives the correct asset identifier without env vars or shared state.

@chenm1adsk
chenm1adsk marked this pull request as draft June 8, 2026 20:07
Base automatically changed from ticket/SG-43460_migration_4 to ticket/SG-43458_migration_3 June 10, 2026 18:42
Base automatically changed from ticket/SG-43458_migration_3 to ticket/SG-43457_migration_2 June 10, 2026 18:43
Base automatically changed from ticket/SG-43457_migration_2 to ticket/SG-43456_migration_1 June 10, 2026 18:45
Base automatically changed from ticket/SG-43456_migration_1 to master July 8, 2026 16:57
@chenm1adsk
chenm1adsk force-pushed the ticket/SG-43418-improve-loader-context-propagation branch from 3f3a60f to 60f2295 Compare July 16, 2026 22:55
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.30%. Comparing base (4aff39a) to head (3c5e599).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #141   +/-   ##
=======================================
  Coverage   18.30%   18.30%           
=======================================
  Files          32       32           
  Lines        3070     3070           
=======================================
  Hits          562      562           
  Misses       2508     2508           
Flag Coverage Δ
Linux 18.30% <ø> (ø)
Python-3.10 18.30% <ø> (ø)
Python-3.11 18.30% <ø> (ø)
Python-3.13 18.30% <ø> (ø)
Python-3.9 18.30% <ø> (ø)
Windows 18.30% <ø> (ø)
macOS 18.30% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

…ters

The Loader previously used TK_FLOWAM_REVISION_ID_* environment variables
to pass am_revision_id to the Publisher, which caused race conditions when
multiple Publisher dialogs were open simultaneously.

Replace with clean parameter passing via show_dialog(context, root_item_properties):
- When publishing new generic asset: pass entity_ctx so Publisher can pre-fill the context widget and use task/entity for MEDM hierarchy placement.
- When publishing existing generic asset revision: pass context=None and root_item_properties={"am_revision_id": revision_id} so the publish hook receives the correct asset identifier without env vars or shared state.
@chenm1adsk
chenm1adsk force-pushed the ticket/SG-43418-improve-loader-context-propagation branch from a3f4e6a to 3c5e599 Compare July 20, 2026 20:29
@chenm1adsk chenm1adsk changed the title feat: [SG-43418] Pass task context and revision_id from Loader to Publisher feat: [SG-43418] Replace env var side channel with show_dialog parameters Jul 20, 2026
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.

1 participant