rsconnect-python icon indicating copy to clipboard operation
rsconnect-python copied to clipboard

connect: use the public /v1/tasks/{id} endpoint

Open aronatkins opened this issue 1 year ago • 1 comments

Intent

The v0 task is still returned by the v0 deploy endpoint.

  • poll-wait is an integer, not a float, and is used to configure the long-poll task requests against the Connect server.

  • task_get() calls /v1/tasks/{id}. It takes first and wait arguments, indicating the starting point for requested output and the duration for long-poll requests.

  • wait_for_task() does no sleeping, but asks task_get() to perform a long-poll with its wait argument.

  • output_task_log() sends every output line to the log callback. It previously used data abut the last-line to determine when to send lines, but that is unnecessary, as wait_for_task() requests only new lines from task_get().

  • RSConnectExecutor.delete_runtime_cache() returns its delete result and task for easier testing. It no longer stores state on the object.

fixes #608

Type of Change

  • [ ] Bug Fix
  • [ ] New Feature
  • [ ] Breaking Change

Approach

Automated Tests

Directions for Reviewers

  • deploy any content and confirm that the output is shown.
  • delete runtime caches and confirm that the output is shown.
  • queue and run any content rebuild and confirm that the output is shown.

Checklist

  • [x] I have updated CHANGELOG.md to cover notable changes.
  • [x] I have updated all related GitHub issues to reflect their current state.

aronatkins avatar Jun 28 '24 17:06 aronatkins

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
4799 3559 74% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/actions_content.py 65% 🟢
rsconnect/api.py 71% 🟢
rsconnect/main.py 61% 🟢
rsconnect/metadata.py 91% 🟢
rsconnect/models.py 92% 🟢
TOTAL 76% 🟢

updated for commit: c36af05 by action🐍

github-actions[bot] avatar Jul 03 '24 15:07 github-actions[bot]