Skip to content

Abort Handling and Revamp Test - #25

Open
balaji-digital-ai wants to merge 9 commits into
mainfrom
ReportRecords
Open

balaji-digital-ai wants to merge 9 commits into
mainfrom
ReportRecords

Conversation

@balaji-digital-ai

Copy link
Copy Markdown
Collaborator

No description provided.

@upwind-code-us

upwind-code-us Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Upwind Upwind Code Scan - ✅ Passed

0 newly introduced vulnerabilities · 0 resolved · 6 total in this PR vs main

Total breakdown: 🔶 2 High | 🟡 3 Medium | ⚪ 1 Unknown

View full analysis in Upwind Console

Scan completed in 21s

Scan history (6 scans)
Commit Scanned at New Resolved Net
f4eba2e 2026-10-29 04:57 UTC +1 0 +1
5e34d24 2026-10-29 05:40 UTC 0 0 0
0285914 2026-10-29 05:57 UTC 0 0 0
fc0118f 2026-10-29 06:17 UTC 0 0 0
5954d51 2026-10-29 06:28 UTC 0 0 0
6a8bf3c < 2026-10-29 07:32 UTC 0 0 0

Last scanned: 6a8bf3c · 2026-10-29 07:32 UTC

@upwind-code-us

upwind-code-us Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Passed

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 4s

Scan history (7 scans)
Commit Scanned at New Resolved Net
f4eba2e 2026-10-29 04:57 UTC — — —
f4eba2e 2026-10-29 04:57 UTC 0 0 0
5e34d24 2026-10-29 05:40 UTC 0 0 0
0285914 2026-10-29 05:57 UTC 0 0 0
fc0118f 2026-10-29 06:17 UTC 0 0 0
5954d51 2026-10-29 06:28 UTC 0 0 0
6a8bf3c < 2026-10-29 07:32 UTC 0 0 0

Last scanned: 6a8bf3c · 2026-10-29 07:32 UTC

@upwind-code-us

upwind-code-us Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Upwind Upwind Secrets Scan

0 newly introduced secrets · 0 resolved · 3 total in the files this PR changed vs main

Total breakdown: 🔶 2 SECRET | 🔶 1 PII

A secret that has been pushed remains in the repository's history even after the line is removed.

Scan completed in 2s.


Scan history (6 scans)
Commit Scanned at New Resolved Net
f4eba2e 2026-10-29 04:57 UTC 0 0 0
5e34d24 2026-10-29 05:40 UTC 0 0 0
0285914 2026-10-29 05:57 UTC 0 0 0
fc0118f 2026-10-29 06:17 UTC 0 0 0
5954d51 2026-10-29 06:28 UTC 0 0 0
6a8bf3c < 2026-10-29 07:32 UTC 0 0 0

Last scanned: 6a8bf3c · 2026-10-29 07:32 UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved output-context races can lose abort data or undermine safe serialization, while live-test timing and configuration defects can cause flaky failures or skip healthy environments.

5 open issues
What changed in this PR

This PR improves abort handling in the Release integration SDK and reorganizes its tests around isolated fixtures, focused unit tests, and end-to-end coverage.

Changes:

  • Adds a cooperative abort grace period, protects in-progress result reporting, and reconciles task exit codes.
  • Restores support for tasks that omit super().__init__().
  • Expands pytest coverage for task execution, encryption, Kubernetes integration, and API helpers, with updated developer documentation.
File Description
tests/​support.py Adds shared task IDs, input builders, and a minimal task.
tests/​release/​test_release_api_client.py Converts compatibility checks to pytest.
tests/​release/​integration/​test_wrapper.py Removes the old combined wrapper tests.
tests/​release/​integration/​test_wrapper_run.py Tests task loading, context wiring, and setup failures.
tests/​release/​integration/​test_wrapper_k8s.py Removes tests replaced by focused I/O coverage.
tests/​release/​integration/​test_wrapper_k8s_live.py Adds live Kubernetes and callback tests.
tests/​release/​integration/​test_wrapper_io.py Covers encrypted inputs, outputs, and callback retries.
tests/​release/​integration/​test_wrapper_execute_task.py Tests worker execution and exit-code reporting.
tests/​release/​integration/​test_wrapper_e2e.py Adds subprocess, encryption, masking, and signal tests.
tests/​release/​integration/​test_wrapper_abort.py Expands abort and report-state coverage.
tests/​release/​integration/​test_watcher.py Tests secret updates and watcher shutdown.
tests/​release/​integration/​test_reporting_records.py Checks reporting-record serialization.
tests/​release/​integration/​test_masked_io.py Covers masking behavior and a known limitation.
tests/​release/​integration/​test_k8s.py Tests Kubernetes configuration and client caching.
tests/​release/​integration/​test_job_data_encryptor.py Tests encryption, round trips, and tamper rejection.
tests/​release/​integration/​test_input_context.py Tests context parsing and secret extraction.
tests/​release/​integration/​test_ids.py Adds focused identifier-parsing tests.
tests/​release/​integration/​test_base_task.py Expands task lifecycle, output, and credential tests.
tests/​release/​integration/​test_api_base_task.py Broadens API helper and variable-type coverage.
tests/​release/​integration/​test_api_base_task_live.py Refactors live tests with configurable server settings.
tests/​release/​integration/​tasks/​secret_task.py Adds a masking-test task.
tests/​release/​integration/​tasks/​sample/​hello.py Adds a distinct script-location fixture.
tests/​release/​integration/​tasks/​hello.py Adds the standard greeting fixture.
tests/​release/​integration/​tasks/​failing_task.py Adds a predictable task-failure fixture.
tests/​release/​integration/​tasks/​cooperative_task.py Adds a cooperative abort fixture.
tests/​release/​integration/​tasks/​context_echo.py Adds a context-wiring fixture.
tests/​release/​integration/​tasks/​blocking_task.py Adds a non-cooperative abort fixture.
tests/​release/​integration/​src/​sample/​hello.py Removes the old nested greeting fixture.
tests/​release/​integration/​src/​hello.py Removes the old source-tree greeting fixture.
tests/​release/​integration/​output.json Removes the checked-in output artifact.
tests/​release/​integration/​input.json Removes input replaced by shared builders.
tests/​release/​integration/​hello.py Removes the old top-level greeting fixture.
tests/​release/​integration/​expected_output.json Removes expectations now asserted in tests.
tests/​release/​integration/​conftest.py Adds shared wrapper isolation and workspace fixtures.
tests/​release/​integration/​blocking_task.py Removes the old blocking fixture.
tests/​release/​integration/​__init__.py Adds an integration-test package marker.
tests/​release/​__init__.py Adds a release-test package marker.
tests/​__init__.py Adds a test package marker for shared imports.
README.md Summarizes abort improvements in the changelog.
pyproject.toml Enables strict pytest settings and registers markers.
docs/​examples.md Explains the cooperative abort grace period.
docs/​classes/​base_task.md Documents abort threading and timeout behavior.
docs/​abort-changes.md Records abort issues, fixes, and verification notes.
digitalai/​release/​integration/​wrapper.py Implements grace-period waiting and revised result reporting.
digitalai/​release/​integration/​base_task.py Adds lazy task-state initialization and abort guidance.
DEVELOPMENT.md Documents pytest commands, fixtures, and live-test settings.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The tests have scheduling- and environment-dependent failure paths, and kubeconfig setup errors can leave a live Kubernetes namespace and API client uncleaned.

4 open issues
4 resolved since last review

Review effort: Balanced

Comment thread tests/release/integration/conftest.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

An unbounded stderr flush can prevent process termination after an abort, and live-test setup fails on valid kubeconfigs that omit user credentials.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Bound abort-time stream flush to ensure process termination

digitalai/​release/​integration/​wrapper.py:164

This flush can block indefinitely after the abort grace period has expired. If the worker is stuck writing to a full stderr pipe, it holds the buffered stream's lock; the main thread then waits for that lock here and never reaches os._exit(1), even after reporting the result. Please bound the flush wait or skip blocked streams so an unresponsive worker cannot prevent process termination.

Medium severity Handle kubeconfigs with optional context users

tests/​release/​integration/​test_wrapper_k8s_live.py:73

A valid kubeconfig can omit both users and context.user, for example when targeting a local kubectl proxy. The cluster fixture can successfully probe and create its namespace with that configuration, but this lookup then raises KeyError, failing the live tests during setup. Treat the user as optional when copying the selected context.

3 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Boolean sys.exit arguments remain booleans, causing exitCode to serialize as true rather than the integer status 1 required by the result format.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The abort handler leaves deferred reporting retries unbounded when the callback is unavailable, preventing graceful exit and forcing the runner to kill the executor.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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