[AISOS-2119] Josh-test - ignore#192
Closed
JoshSalomon wants to merge 3 commits into
Closed
Conversation
added 3 commits
July 21, 2026 07:01
Add INFO-level log emission when task implementation begins:
- Initialize feature_id, task_id_log, task_name with "N/A" defaults
- Update variables with actual values after Jira task retrieval
- Emit log with format: Implementation started: task_name="{name}" feature_id="{id}" task_id="{id}"
- Log is emitted before container execution begins
Also add unit tests for the new logging behavior:
- test_logs_implementation_started_with_correct_format
- test_start_log_emitted_before_container_execution
- test_start_log_uses_na_defaults_when_values_missing
Closes: AISOS-2257
Added structured logging at the end of task implementation using the
existing finally block. The end log is emitted at INFO level with the
format: Implementation completed: task_name="{task_name}" feature_id="{feature_id}" task_id="{task_id}"
Changes:
- Added logger.info() call in the finally block before jira.close()
- Uses the same logging variables (task_name, feature_id, task_id_log)
initialized with "N/A" defaults from AISOS-2257
The finally block ensures the end log is emitted on both success and
failure paths, providing symmetric bookends with the start log.
Closes: AISOS-2258
Added TestImplementationStructuredLogging test class with 6 test methods covering all structured logging scenarios for the implement_task workflow node: 1. test_start_log_emitted_with_task_details - Verifies INFO log with 'Implementation started' contains correct task_name, feature_id, task_id 2. test_end_log_emitted_on_success - Verifies INFO log with 'Implementation completed' after successful container run 3. test_end_log_emitted_on_failure - Mocks container to return success=False, verifies end log still emitted via finally block 4. test_feature_id_fallback_to_na - Creates state with ticket_key=None, verifies feature_id='N/A' in logs 5. test_task_name_fallback_to_na - Mocks Jira to raise exception before summary retrieval, verifies task_name='N/A' in end log 6. test_no_logs_when_no_current_task - State with current_task_key=None and empty task_keys, verifies no 'Implementation started/completed' logs (early exit path) All tests use: - Existing test fixtures (_make_state, _make_mock_jira, _make_successful_runner) - caplog fixture for log capture at INFO level - Existing mock patterns with patch() for JiraClient, ContainerRunner, get_settings Closes: AISOS-2259
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds structured logging to the task implementation workflow, enabling better observability and tracing of implementation runs. Each task implementation now emits symmetric start and end logs with consistent metadata (task_name, feature_id, task_id), making it easier to track implementation lifecycle, debug issues, and correlate logs across the system.
Changes
Structured Logging in Implementation Node
feature_id,task_id_log,task_name) initialized with "N/A" defaults before task executionImplementation started: task_name="{name}" feature_id="{id}" task_id="{id}"Implementation completed: task_name="{name}" feature_id="{id}" task_id="{id}"Unit Tests
TestImplementationStartLoggingtest class with 3 tests for start log behaviorTestImplementationStructuredLoggingtest class with 6 comprehensive tests covering:Implementation Notes
%sformat placeholders following Python logging best practices (deferred string interpolation)task_id_lognamed to avoid shadowing existing variable names in the modulejira.close()to add the end log, maintaining cleanup semanticsTesting
caplogfixture for log capture at INFO levelRelated Tickets
Generated by Forge SDLC Orchestrator