Skip to content

Conversation

@vijayvammi
Copy link
Collaborator

No description provided.

vijayvammi and others added 13 commits January 2, 2026 13:09
The async test was creating a PipelineContext but never calling
set_run_context(context), making it inconsistent with the sync test
logic. This fix adds the missing call to properly set up the context
before assertions.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Updated the _context property in BaseExecutor to use get_run_context()
with proper error handling. Updated tests to mock the new API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Updated all references from context.run_context to context.get_run_context()
with proper error handling. Also updated corresponding tests to mock the
new get_run_context() function.

Changes:
- ObjectParameter.description: Added get_run_context() with None check
- ObjectParameter.file_name: Added get_run_context() with RuntimeError
- ObjectParameter.get_value(): Added get_run_context() with RuntimeError
- ObjectParameter.put_object(): Added get_run_context() with RuntimeError
- RunLog.get_summary(): Added get_run_context() with RuntimeError
- BaseRunLogStore._context: Added get_run_context() with RuntimeError
- Updated test mocks to patch get_run_context() instead of run_context

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Updated all remaining production and test files to use the new
contextvars-based API:

Production files:
- runnable/catalog.py: Updated _context property to use
  get_run_context()
- runnable/nodes.py: Updated _context property with type checking
- runnable/sdk.py: Changed context.run_context assignment to
  set_run_context() and updated import
- runnable/utils.py: Updated get_git_code_identity to use
  get_run_context()
- extensions/pipeline_executor/__init__.py: Updated _context
  property with type checking
- extensions/job_executor/__init__.py: Updated _context property
  with type checking

Test files:
- tests/assertions.py: Updated load_run_log to use get_run_context()
- tests/test_job_examples.py: Updated cleanup to use
  set_run_context(None)
- tests/test_pipeline_examples.py: Updated cleanup to use
  set_run_context(None)
- tests/test_retries.py: Updated cleanup and load_run_log to use
  new API
- tests/runnable/test_catalog.py: Updated mock to patch
  get_run_context
- tests/runnable/test_utils.py: Updated mocks to patch
  get_run_context
- tests/extensions/catalog/test_any_path.py: Updated mock to patch
  get_run_context
- tests/extensions/catalog/test_file_system.py: Updated mock to
  patch get_run_context
- tests/extensions/job_executor/test_k8s_scheduling.py: Updated all
  mocks to patch get_run_context

All context.run_context direct access replaced with proper API
calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vijayvammi vijayvammi merged commit 5cea56b into main Jan 2, 2026
1 check passed
@vijayvammi vijayvammi deleted the remove-global-context branch January 2, 2026 15:17
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.

2 participants