Commit 116a032
feat: verify deployment on a draft, activate on success (#805)
* feat: verify deployment on a draft, activate on success (#769)
Deploy commands now deploy the new bundle as a draft (activate=false),
verify it by accessing its preview URL, and only activate it once the
verification succeeds. If verification fails, the bundle is left as a
draft and the previously-active bundle keeps serving, so a broken build
never becomes the active version.
This also fixes #768: --draft now verifies the draft bundle rather than
the currently-active content. --no-verify retains the old behavior of
activating immediately without verification.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: avoid double slash in access_content preview path
dirname("/__api__") returns "/", so joining it with "/content/..."
produced a "//content/..." path. Connect normalizes it, but it is sloppy
and made the verification request URL awkward to register in tests. Strip
the trailing slash from the base so root-hosted and path-prefixed servers
both produce a clean single-slash path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: integration tests for verify-before-activate
Add two live-Connect integration tests (run via posit-dev/with-connect)
that exercise the verify-before-activate guarantees and are expected to
fail without the changes on this branch:
- test_default_deploy_does_not_activate_broken_bundle (#769): a broken
redeploy fails and leaves the previously-active working bundle serving;
without the change the broken bundle is activated before verification.
- test_draft_deploy_verifies_the_draft_not_the_active_bundle (#768):
deploying a broken draft fails verification; without the change --draft
verified the still-good active content and reported success.
Both reuse the existing flask / flask-bad fixtures (flask-bad builds fine
but raises at startup).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: version-gate the verify-before-activate flow
Connect added the `activate` field on the deploy endpoint in 2025.06.0;
older servers reject the unknown field, which broke every deploy against
them once verify-before-activate became the default. Gate the draft-first
flow on server version: on Connect >= 2025.06.0 we deploy a draft, verify
it, and activate on success; on older servers (and shinyapps.io) we deploy
and activate in one step and verify the active content, as before.
Add a unit test for the fallback path on an unsupported server, and bump
the two live integration tests to require Connect 2025.06.0 since they
assert the verify-before-activate behavior.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: error clearly when --draft used against unsupported Connect
should_deploy_as_draft() returned True for --draft regardless of server
support, so --draft against Connect < 2025.06.0 still sent activate:false
and failed with a cryptic "unknown field" error. Raise a clear
RSConnectException instead; silently downgrading to a non-draft deploy
would activate the bundle, the opposite of --draft's intent. Add a unit
test for --draft on an unsupported server.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0e95952 commit 116a032
4 files changed
Lines changed: 519 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
| |||
413 | 414 | | |
414 | 415 | | |
415 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
416 | 440 | | |
417 | 441 | | |
418 | 442 | | |
| |||
599 | 623 | | |
600 | 624 | | |
601 | 625 | | |
602 | | - | |
| 626 | + | |
603 | 627 | | |
604 | | - | |
605 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
606 | 635 | | |
607 | 636 | | |
608 | 637 | | |
| |||
892 | 921 | | |
893 | 922 | | |
894 | 923 | | |
| 924 | + | |
895 | 925 | | |
896 | 926 | | |
897 | 927 | | |
| |||
1025 | 1055 | | |
1026 | 1056 | | |
1027 | 1057 | | |
| 1058 | + | |
1028 | 1059 | | |
1029 | 1060 | | |
1030 | 1061 | | |
| |||
1405 | 1436 | | |
1406 | 1437 | | |
1407 | 1438 | | |
| 1439 | + | |
1408 | 1440 | | |
1409 | 1441 | | |
1410 | 1442 | | |
| |||
1472 | 1504 | | |
1473 | 1505 | | |
1474 | 1506 | | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1475 | 1540 | | |
1476 | 1541 | | |
1477 | 1542 | | |
1478 | 1543 | | |
1479 | 1544 | | |
1480 | 1545 | | |
1481 | 1546 | | |
1482 | | - | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
1483 | 1575 | | |
1484 | 1576 | | |
1485 | 1577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
396 | 399 | | |
397 | 400 | | |
398 | 401 | | |
399 | 402 | | |
400 | 403 | | |
401 | | - | |
402 | | - | |
| 404 | + | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| |||
1541 | 1544 | | |
1542 | 1545 | | |
1543 | 1546 | | |
1544 | | - | |
| 1547 | + | |
1545 | 1548 | | |
1546 | 1549 | | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1547 | 1553 | | |
1548 | 1554 | | |
1549 | 1555 | | |
| |||
1709 | 1715 | | |
1710 | 1716 | | |
1711 | 1717 | | |
1712 | | - | |
| 1718 | + | |
1713 | 1719 | | |
1714 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
1715 | 1724 | | |
1716 | 1725 | | |
1717 | 1726 | | |
| |||
1797 | 1806 | | |
1798 | 1807 | | |
1799 | 1808 | | |
1800 | | - | |
| 1809 | + | |
1801 | 1810 | | |
1802 | 1811 | | |
1803 | 1812 | | |
1804 | 1813 | | |
1805 | 1814 | | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
1806 | 1818 | | |
1807 | 1819 | | |
1808 | 1820 | | |
| |||
1887 | 1899 | | |
1888 | 1900 | | |
1889 | 1901 | | |
1890 | | - | |
| 1902 | + | |
1891 | 1903 | | |
1892 | 1904 | | |
1893 | 1905 | | |
1894 | 1906 | | |
1895 | 1907 | | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
1896 | 1911 | | |
1897 | 1912 | | |
1898 | 1913 | | |
| |||
2095 | 2110 | | |
2096 | 2111 | | |
2097 | 2112 | | |
2098 | | - | |
| 2113 | + | |
2099 | 2114 | | |
2100 | 2115 | | |
2101 | 2116 | | |
2102 | 2117 | | |
2103 | 2118 | | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
2104 | 2122 | | |
2105 | 2123 | | |
2106 | 2124 | | |
| |||
2283 | 2301 | | |
2284 | 2302 | | |
2285 | 2303 | | |
2286 | | - | |
| 2304 | + | |
2287 | 2305 | | |
2288 | 2306 | | |
2289 | 2307 | | |
2290 | 2308 | | |
2291 | 2309 | | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
2292 | 2313 | | |
2293 | 2314 | | |
2294 | 2315 | | |
| |||
2389 | 2410 | | |
2390 | 2411 | | |
2391 | 2412 | | |
2392 | | - | |
| 2413 | + | |
2393 | 2414 | | |
2394 | 2415 | | |
2395 | 2416 | | |
2396 | 2417 | | |
2397 | 2418 | | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
2398 | 2422 | | |
2399 | 2423 | | |
2400 | 2424 | | |
| |||
2513 | 2537 | | |
2514 | 2538 | | |
2515 | 2539 | | |
2516 | | - | |
| 2540 | + | |
2517 | 2541 | | |
2518 | 2542 | | |
2519 | 2543 | | |
2520 | 2544 | | |
2521 | 2545 | | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
2522 | 2549 | | |
2523 | 2550 | | |
2524 | 2551 | | |
| |||
2747 | 2774 | | |
2748 | 2775 | | |
2749 | 2776 | | |
2750 | | - | |
| 2777 | + | |
2751 | 2778 | | |
2752 | 2779 | | |
2753 | 2780 | | |
2754 | 2781 | | |
2755 | 2782 | | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
2756 | 2786 | | |
2757 | 2787 | | |
2758 | 2788 | | |
| |||
2907 | 2937 | | |
2908 | 2938 | | |
2909 | 2939 | | |
2910 | | - | |
| 2940 | + | |
2911 | 2941 | | |
2912 | 2942 | | |
2913 | 2943 | | |
2914 | 2944 | | |
2915 | 2945 | | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
2916 | 2949 | | |
2917 | 2950 | | |
2918 | 2951 | | |
| |||
0 commit comments