Skip to content

feat(publish): let a destination declare its own expiry choices - #32264

Merged
KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
koushikginjupally:feat/publish-provider-expiry
Nov 11, 2026
Merged

KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
koushikginjupally:feat/publish-provider-expiry

Conversation

@koushikginjupally

@koushikginjupally koushikginjupally commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A user can choose how long a published link lives, from the periods the destination itself supports, and that choice reaches the destination.

A publish provider can declare SharingModel.supports_expiration = True, but nothing the user picks reaches it. For a built-in destination the Publish panel shows the deploy surface's "Persistent (no expiry)" / "72 hours (requires reaper)" control, then calls POST /api/artifacts/{slug}/publish with no TTL at all: neither the route, publish_sync.publish() nor PublishProvider.publish() has a TTL argument. A destination with its own expiry model (for example a paste service that keeps pages for 30 to 730 days and has no "never" option) can honour neither choice, and a user who picks "Persistent" gets a page that disappears after the destination's default period.

Why it matters

The control promises a lifetime that is never applied, so a link the user believes is permanent can vanish without warning, and a destination that does support several lifetimes cannot offer them. No provider in this repository sets supports_expiration, so the defect is latent here; it shows up as soon as an edition registers one that does.

Not a goal

  • Changing the expiry of an existing publication (an update_sharing extension).
  • Expiry for SHARED grants.
  • Recording or showing when a publication expires; a later change adds both together.
  • Changing the public-web deploy surface's TTL control.

What changed (motivation → approach → change)

A destination now states the lifetimes it can give a publication, the panel offers exactly those, and the chosen one reaches publish().

Part Change
Contract (publish_provider.py) SharingModel gains expiration_choices_days, allows_no_expiration and default_expiration_days, and refuses an inconsistent declaration when built. supports_expiration follows the choices unless a provider sets it, so expiry is declared once.
Engine (publish_sync.py) publish() takes expires_in_days (days, None for no expiry, or the destination default). It refuses an undeclared value with a 400, and any expiry on a re-publish with a 409, both before anything is uploaded, and passes the period to PublishProvider.publish() only for a destination that declares choices.
Route (publish_sharing.py, handlers/artifacts.py) The publish body accepts expires_in_days; a malformed value is a 400. The provider list carries the three new fields.
Panel (PublishHub.tsx, api/client/artifacts.ts, types/index.artifacts.ts) A built-in row with declared periods shows an "Expires" select on a first publish, repeats the choice on the confirm step and names it in the public-exposure acknowledgment. A built-in row never shows the deploy TTL control. The client sends expires_in_days only on a first publish to a row that offers a choice.

A re-publish that names an expiry comes from a panel that saw the artifact unpublished, for example two panels racing the first publish. Refusing it makes that panel reload instead of reporting a lifetime the destination never received. Passing the keyword only to a destination that declares choices keeps every existing provider's publish() signature valid. I chose a short declared list over a free-form day count because a list is easy to label and translate and cannot drift from what the destination accepts. The new strings are in every catalog (en-XA.json regenerated, both plural bases registered in pluralKeys.json), and docs/system-specs/modules/artifacts.md documents the contract.

Backwards compatibility

Compatible: every new field has a default that means "no expiry choice", the route key is optional, and publish() is called with the new keyword only when a destination declares choices. supports_expiration defaults to following the choices, which is False when none are declared, and an explicit value is kept, so personal_drive (which sets False) and edition providers that set it keep the same value.

Reader: website/src/components/PublishHub.tsx:ttlSelectableFor -- app -- PublishHub.ttlLeak.test.tsx (a built-in row no longer gets the deploy TTL control; no core publish ever carried ttl_hours, so that control never applied anything)
Reader: src/kiro_crew/dashboard/handlers/artifacts_parts/publish_sharing.py:_sharing_model_dict -- app -- test_publish_expiry_choice.py::test_the_provider_list_carries_the_choices (supports_expiration is still always a bool on the wire)

Tests

  • test/test_publish_expiry_choice.py: an inconsistent declaration is refused; supports_expiration follows the choices, keeps an explicit value and refuses False beside declared choices; the default, a picked period and no expiry reach the provider; an undeclared period or no expiry uploads nothing; a provider with the old publish() signature still publishes and refuses an explicit expiry; a re-publish naming an expiry is a conflict and moves no content, while one without still pushes; two first publishes racing with different expiries end with one publication and one conflict, in either order; the route passes absent, a number and null, and rejects a string, a bool, zero, a negative and a fraction; the provider list carries the fields. With the 409 guard removed, the re-publish and race tests fail.
  • website/src/test/PublishHub.expiryChoice.test.tsx: the option list and fallback rules, the control and the default sent, no key sent when nothing is declared or on a re-publish, and the period in the acknowledgment.
  • website/src/test/PublishHub.ttlLeak.test.tsx: a built-in row that declares supports_expiration no longer gets the deploy TTL control or its 72 hours. With the old ttlSelectableFor restored and the expiry dropped from the request, 4 tests across both files fail.

Determinism, test/test_publish_expiry_choice.py: 20 runs at -n0, 10 at -n 4 --dist loadgroup --max-worker-restart=2 beside test_publish_sync.py and test_artifact_publish_picker.py, and all node ids in a shuffled order: all green.

Manual verification

The Publish panel was driven in the real built SPA behind the repository's stubbed fixture server (website/scripts/lib/serve-dist.mjs), with a built-in destination declaring 30/90/365/730 days. The public repository has no provider that declares expiry choices, so a live publish was not run.

Screenshots / video

The "Expires" control on a first publish, open:

Expires control with the declared periods

The confirm step repeating the picked period:

Confirm step showing Expires: After 365 days

A destination that allows no expiry lists "Never", and the confirm step repeats it:

Expires control listing Never

Confirm step showing Expires: Never

On a public destination the acknowledgment names the period:

Acknowledgment: This link stays public for 90 days, then the destination removes it

Related Issues

Closes #32192

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@koushikginjupally

Copy link
Copy Markdown
Contributor Author

@cruisercohen the workflow runs for this fork PR are waiting for maintainer approval (every check on head 7c336f5 shows action_required). Could you approve them when you have a moment? This is the PR for #32192, which I claimed above.

@koushikginjupally
koushikginjupally force-pushed the feat/publish-provider-expiry branch from 7c336f5 to 5a4bb94 Compare November 7, 2026 10:55
@koushikginjupally

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/kas-auth.md, beside docs/system-specs/modules/artifacts.md which this PR changes (f80c7b8 -> 4312d22); CI re-running once the fork workflow runs are approved.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 8, 2026
@koushikginjupally

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/i18n/pluralKeys.json, which conflicted with this PR (both sides appended plural keys; kept both), and in the docs/system-specs/modules/ specs (4312d22 -> b7b7b6c); CI will re-run once the fork workflow runs are approved.

@koushikginjupally
koushikginjupally force-pushed the feat/publish-provider-expiry branch from 5a4bb94 to 98e8d6f Compare November 10, 2026 18:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Nov 10, 2026

@bolichen97 bolichen97 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving head 98e8d6f5b4. Since this touches publish and sharing, I checked whether an expiry can make a published artifact public longer or wider than intended. It can't:

  • Wider: expiry is a separate field. visibility and shared_with go through _validate_sharing_body exactly as before, and nothing in the expiry path reads or changes them.
  • Longer than declared: _validate_expiry_body accepts only a positive int or null (bool, float, string and "default" are a 400). resolve_expiration refuses any period the destination didn't declare, and null unless it declares allows_no_expiration. _first_publish_expiry runs before ensure_ready() and the upload, so a refused value uploads nothing (test_an_undeclared_choice_uploads_nothing).
  • Extended later: a re-publish never sends expires_in_days, so it can't lengthen a lifetime (test_a_republish_ignores_the_expiry_and_stays_idempotent).
  • Destinations without choices: they get no keyword, and an explicit expiry to them is a 400 (test_a_provider_without_choices_refuses_an_explicit_expiry).
  • expires_at is display-only. A provider-reported value is kept only if it parses as a timestamp, then re-serialized.

On this head: test/test_publish*.py gave 468 passed, and PublishHub.expiryChoice + PublishHub.ttlLeak gave 16 passed.

One non-blocking note: when a destination declares allows_no_expiration with default_expiration_days=None, a publish without the key never expires. That is the destination's declared default and the panel preselects it, so it's consistent. A destination author should know that "Never" becomes the silent default for API callers.

AI-assisted, sent by CommunityCrew

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of fe9b18643355ce63a905a790d009a4676ea98980 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The chosen expiry now reaches publish(), and a core row no longer shows a 72-hour control whose value never reached the destination. Existing providers keep their signature because the keyword is passed only to a destination that declares choices.

Notes

  • Two tests in PublishHub.ttlLeak.test.tsx now expect the opposite: a core row that declares supports_expiration used to get the TTL control and now doesn't. I read this as a deliberate reversal, not a gap. The base code's own comment already said "the core publish route carries no TTL", and the description says why the control never applied anything. A reviewer should still confirm it on purpose.
  • Nothing stores or shows when a publication expires, and the description defers that on purpose. Until it lands, the confirm step is the only place a user ever sees the lifetime they picked.

[DESIGN-REVIEWED] fe9b186

Description read

[DESCRIPTION-READ] a0ef1f550983368a8ef22461c05ee189dfaecda4e40dbb82ba72f28419621236

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of fe9b18643355ce63a905a790d009a4676ea98980 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. Every control this PR adds has a screenshot: the "Expires" select with and without "Never", the confirm-step line, and the 90-day acknowledgment. No blind reader has read them, because this lane reviews a fork; pushing the branch to this repository runs one.

Notes

  • In the 90-day acknowledgment (exposure_window_provider_expiry_*), "then the destination removes it" uses "destination", an internal word. The panel already names the service ("via Paste service"), so pass that name in instead: "…then Paste service removes it."

[UX-REVIEWED] fe9b186

Description read

[DESCRIPTION-READ] a1ee42c6ee1d3de658f81332eb325d1d8414c5b325357645d5ff291703854abb

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of fe9b18643355ce63a905a790d009a4676ea98980 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Issue #32192 is linked, the new path is reached only by a destination that declares choices, and the TTL pin it rewrites is explained in the description's Reader: line.

Notes

  • Item 1 — one consumer, generalized: no provider in src/ declares expiration_choices_days. I grepped supports_expiration|expiration_choices and found 0 producers; the only one, personal_drive.py:1913, sets supports_expiration=False. Every reader of the three fields is waiting on a provider from some edition.
  • Item 2 — oversized: supports_expiration: bool | None = None plus the __post_init__ derivation makes a three-state flag. It only lets a provider skip setting one bool that the choices already imply. offers_expiration_choice is a third spelling of bool(expiration_choices_days).
    Subtraction: keep supports_expiration: bool = False and delete the derive/contradiction branch and offers_expiration_choice. Read sm.expiration_choices_days directly in _first_publish_expiry.

What this change ships

Inventory (8 items) — 6 justified

Intent: let a user choose how long a published link lives, from the periods the destination supports, and have that choice reach the destination. This is an ADDITION.

  1. A provider can declare expiry periods, a "never" option and a default — one consumer, generalized: no in-tree provider declares them
  2. supports_expiration now follows the declared choices unless a provider sets it — oversized
  3. The Publish panel shows an "Expires" select on a first publish to a built-in row that declares periods — justified
  4. The confirm step and the public-exposure acknowledgment name the chosen period — justified
  5. A built-in row no longer shows the deploy "Persistent / 72 hours" control — justified
  6. The publish route accepts expires_in_days; a malformed value is a 400 — justified
  7. Re-publishing with an expiry is a 409, and an undeclared period is a 400, before anything is uploaded — justified
  8. The provider list carries the three new fields, and the screenshots are committed under temp-screenshots/ — justified

[FIRST-PRINCIPLES-REVIEWED] fe9b186

Description read

[DESCRIPTION-READ] 685945b499ca93654c32093cd324b7e572b5b5746283bcc45b15e203feb9dcdb

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed fe9b18643355ce63a905a790d009a4676ea98980 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fe9b186

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed fe9b18643355ce63a905a790d009a4676ea98980 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fe9b186

@bolichen97 bolichen97 closed this Nov 10, 2026
@bolichen97 bolichen97 reopened this Nov 10, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 10, 2026
@bolichen97 bolichen97 closed this Nov 10, 2026
@bolichen97 bolichen97 reopened this Nov 10, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

@koushikginjupally my approval stands on the safety side. The First Principles lane BLOCKs on 98e8d6f5b4, though, and that blocks readiness: expires_at (record field, PublishResult field, served in the summary) ships with no reader. It also suggests deriving supports_expiration from expiration_choices_days instead of keeping two declarations.

Two ways forward: drop expires_at (and its provider field) from this PR and add it with the change that shows it, or reply on the lane with the concrete reader it serves now. I fully re-ran CI on a merge ref that includes main's #34646 fix, so the backend shards should go green.

AI-assisted, sent by CommunityCrew

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changing my approval to a change request so the PR state matches the First Principles BLOCK, which I checked and agree with.

On head 98e8d6f5b4, the new publication expires_at is written (ArtifactPublication.expires_at, PublishResult.expires_at, _expiry_time, parse_publication, _publication_summary) and typed on the frontend (index.artifacts.ts), but nothing reads it. The existing expires_at readers in WebAppArtifactCard.tsx and ArtifactDeployPage.tsx read the web-app deploy lifecycle, a different field. The lane's second point holds too: supports_expiration is now "descriptive only" and could be derived from expiration_choices_days instead of being a second declaration.

Either of these clears it:

  1. Drop expires_at (the record field, the PublishResult field, _expiry_time and the summary key) from this PR, and add it with the change that shows it; or
  2. Add the reader in this PR, for example the Publish panel showing when the link expires, so the field ships with a use.

My safety review is unchanged: the expiry still can't make an artifact public longer or wider than intended. I'll re-approve once the lane passes.

AI-assisted, sent by CommunityCrew

@bolichen97

Copy link
Copy Markdown
Contributor

@koushikginjupally the GPT lane now has a second blocker, and its adjudication upheld it. I agree with it, so it belongs to my change request too.

Two panels publish the same unpublished artifact. One picks "Never", the other confirms 30 days. The second request takes the re-publish branch in _publish_unlocked (publish_sync.py:717), skips _first_publish_expiry, and reports success. The 30-day limit its user acknowledged never reaches the provider, so the link stays public with no expiry.

Fix, per the lane: when art.publication is not None and the request names an explicit expires_in_days, raise the existing PublishConflictError before pushing content, so the stale panel reloads. Please add a test for the race.

AI-assisted, sent by CommunityCrew

@koushikginjupally
koushikginjupally force-pushed the feat/publish-provider-expiry branch from 98e8d6f to fe9b186 Compare November 11, 2026 03:57
@koushikginjupally

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: re-publish expiry handling in _publish_unlocked

  • Reject stale expiry choices instead of reporting success

fixed in fe9b186: a re-publish that names expires_in_days now raises PublishConflictError (409) in _publish_unlocked before ensure_ready(), update_sharing or push_version, so no content moves and the stale panel reloads.
The panel sends no expiry on a re-publish (expiryOptionsFor(..., alreadyPublished) returns []), so ordinary re-publishes are unchanged: test_a_republish_without_an_expiry_still_pushes.
test_two_first_publishes_racing_cannot_both_report_their_expiry gathers a "Never" and a 30-day first publish; either order ends with one upload, the winner's expiry applied, and one PublishConflictError. With the guard removed it fails.

@koushikginjupally

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: persisted publication expires_at
resolution: removed

  • Persisted expires_at with no reader

fixed in fe9b186 by subtraction: ArtifactPublication.expires_at, its parse_publication line, the _publication_summary key, PublishResult.expires_at, _expiry_time, the expires_at? type field and their tests are gone. git diff origin/main...HEAD | grep -c expires_at is 0.
The Goal ("that choice reaches the destination") is met without them; recording and showing expiry is listed under Not a goal, to ship together in a later change.
Note on the lane's second point: supports_expiration is now bool | None = None and follows expiration_choices_days when unset, so expiry is declared once. An explicit value is kept (personal_drive sets False), and False beside declared choices is refused.

@koushikginjupally

Copy link
Copy Markdown
Contributor Author

@bolichen97 thanks for the safety review and the change request. Both points are addressed in fe9b186433:

  • expires_at with no reader: removed, along with the PublishResult field, _expiry_time and the summary key. Recording and showing when a link expires will come together in a later change.
  • Stale panel race: a re-publish that names an expiry is now a 409 before any content moves, so the stale panel reloads. test_two_first_publishes_racing_cannot_both_report_their_expiry covers it in either order.
  • supports_expiration duplication: it now defaults to None and follows expiration_choices_days, so a provider declares expiry once. An explicit value is kept so existing providers keep theirs (personal_drive sets False), and False beside declared choices is refused. It is always a bool on the wire.

I also fixed the three contract tests CI flagged (facade manifest and inventory for the new names), and added the screenshots the UX lane asked for: the "Never" option, the confirm step with "Expires: Never", and the public acknowledgment naming the period.

One thing I left out on purpose: once a destination removes an expired page, Kiro Crew still shows it as published. That already happens today for any destination with a built-in lifetime, so it isn't introduced here, and fixing it means making the published state expiry-aware. Happy to open an issue for that if you agree it should be tracked.

The fork workflow runs on the new head will need approval again. Thanks.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 908 lines, more than the 400 it may approve on its own.

The PR adds destination-declared expiry choices end to end, and every path holds up. SharingModel validates its declaration and fills in supports_expiration itself, which works because the dataclass is not frozen. The route accepts only a positive int, null or no key. publish_sync checks the value against the destination's declaration and passes the keyword only to destinations that declare choices, so personal_drive and older providers keep their signature. An expiry named on a re-publish is refused with a 409 inside the per-artifact lock, which fixes the earlier lane's race finding. Errors map to 400/409 through the existing _sync_error_response. In the panel, built-in rows drop the deploy TTL control, which never applied anything since the built-in publish carries no ttl_hours. The expiry choice is offered only on a first publish, is derived per row so a pick doesn't carry over to another row, and is named in the acknowledgment. All 13 catalogs, both plural keys and the facade inventory are updated, and the new tests would fail without the change. No blocking issues found.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit fe9b186433 · 908 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 11, 2026
@bolichen97 bolichen97 closed this Nov 11, 2026
@bolichen97 bolichen97 reopened this Nov 11, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 11, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving head fe9b186433, which replaces my change request. Both items are fixed:

  1. expires_at is gone from the record, PublishResult and the summary, and supports_expiration is now derived from expiration_choices_days.
  2. A re-publish that names an expiry raises PublishConflictError before any content moves. test_two_first_publishes_racing_cannot_both_report_their_expiry pins the two-panel race.

test_publish_expiry_choice.py + test_publish_sync.py gave 112 passed on this head. First Principles, GPT, Opus, UX, Design and Security Scope all pass. I'll merge it once PR Readiness passes.

AI-assisted, sent by CommunityCrew

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 11, 2026
@KiroCrewCaptain
KiroCrewCaptain merged commit c8bc573 into kirodotdev:main Nov 11, 2026
177 of 178 checks passed

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed on fe9b186. I traced the whole publish path. _validate_expiry_body returns a 400 for a bool, string, fraction, zero or negative value. A re-publish that names an expiry gets a 409 inside the per-slug lock, before any upload. A first publish with a period the destination did not declare gets a 400, and nothing is uploaded. The new keyword goes only to a destination that declares choices. The backend expiry tests pass at this head, and deleting the 409 guard makes exactly the two tests the PR names fail. The branch merges cleanly with current main.

Done well: you cut expires_at when nothing read it and moved it to "Not a goal". The keyword is passed only to providers that opt in, so every existing publish() signature keeps working, and a test pins that.

Security: the new input is expires_in_days in the publish POST body. Its type and range are checked before dispatch. Governance still runs first, and error text is redacted and audited. The public-exposure acknowledgment still gates the publish the same way; only its wording changes when a numeric expiry is picked. No provider in this repository declares choices, so the public build behaves as before.

Optional:

  • No test drives the rendered Expires select. Mocking useIsTouchDevice to true makes SimpleSelect render a native select (see DefaultSessionFolderSetting.test.tsx). That would let one test pick 730 and "never" and check that the POST body carries 730 and null.
  • The 409 guard is pinned only for a numeric expiry. If you change it to let None through, no test fails. Running the re-publish test with both 730 and None would pin both sides.
  • The PublishProvider.publish docstring says a declaring provider must "accept" the period. The acknowledgment tells the user the destination removes the link, so "accept and apply" would match that promise.

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish panel: let a provider declare its own expiry choices, and carry the choice to publish()

3 participants