Repository navigation
feat(workflow): serve the pinned copy to public viewers - #8575
Conversation
Automated Reviewer SuggestionsBased on the
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🟢 | bs=10 sw=10 sl=64 | 458 | 0.28 | 21,391/29,240/29,240 us | 🟢 -17.8% / 🔴 +86.0% |
| 🔴 | bs=100 sw=10 sl=64 | 947 | 0.578 | 100,584/156,667/156,667 us | 🔴 +17.8% / 🔴 +48.7% |
| 🟢 | bs=1000 sw=10 sl=64 | 1,109 | 0.677 | 899,001/941,507/941,507 us | 🟢 -8.6% / 🟢 -8.7% |
Baseline details
Latest main 6a29c59 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 458 tuples/sec | 436 tuples/sec | 790.31 tuples/sec | +5.0% | -42.0% |
| bs=10 sw=10 sl=64 | MB/s | 0.28 MB/s | 0.266 MB/s | 0.482 MB/s | +5.3% | -42.0% |
| bs=10 sw=10 sl=64 | p50 | 21,391 us | 21,450 us | 12,375 us | -0.3% | +72.9% |
| bs=10 sw=10 sl=64 | p95 | 29,240 us | 35,571 us | 15,719 us | -17.8% | +86.0% |
| bs=10 sw=10 sl=64 | p99 | 29,240 us | 35,571 us | 19,058 us | -17.8% | +53.4% |
| bs=100 sw=10 sl=64 | throughput | 947 tuples/sec | 962 tuples/sec | 1,025 tuples/sec | -1.6% | -7.6% |
| bs=100 sw=10 sl=64 | MB/s | 0.578 MB/s | 0.587 MB/s | 0.626 MB/s | -1.5% | -7.6% |
| bs=100 sw=10 sl=64 | p50 | 100,584 us | 101,428 us | 98,759 us | -0.8% | +1.8% |
| bs=100 sw=10 sl=64 | p95 | 156,667 us | 132,990 us | 105,327 us | +17.8% | +48.7% |
| bs=100 sw=10 sl=64 | p99 | 156,667 us | 132,990 us | 120,491 us | +17.8% | +30.0% |
| bs=1000 sw=10 sl=64 | throughput | 1,109 tuples/sec | 1,108 tuples/sec | 1,059 tuples/sec | +0.1% | +4.7% |
| bs=1000 sw=10 sl=64 | MB/s | 0.677 MB/s | 0.676 MB/s | 0.646 MB/s | +0.1% | +4.7% |
| bs=1000 sw=10 sl=64 | p50 | 899,001 us | 894,071 us | 965,886 us | +0.6% | -6.9% |
| bs=1000 sw=10 sl=64 | p95 | 941,507 us | 1,030,449 us | 1,007,533 us | -8.6% | -6.6% |
| bs=1000 sw=10 sl=64 | p99 | 941,507 us | 1,030,449 us | 1,031,622 us | -8.6% | -8.7% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,436.66,200,128000,458,0.280,21390.84,29239.93,29239.93
1,100,10,64,20,2111.75,2000,1280000,947,0.578,100583.78,156666.52,156666.52
2,1000,10,64,20,18039.98,20000,12800000,1109,0.677,899001.42,941506.61,941506.61
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8575 +/- ##
============================================
- Coverage 92.61% 92.61% -0.01%
- Complexity 5059 5061 +2
============================================
Files 1258 1258
Lines 53780 53814 +34
Branches 6707 6714 +7
============================================
+ Hits 49811 49840 +29
- Misses 2313 2317 +4
- Partials 1656 1657 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6ff993b to
e1f144b
Compare
e1f144b to
aad6703
Compare
7824786 to
8af259c
Compare
With a version pinned, a workflow has two copies: the author's working copy and the frozen one on public show. This routes every read that serves a viewer without granted access through the frozen copy, and freezes the name and description with the graph. `WorkflowPublishService.publicCopyOf` returns the three fields as a group, so a surface cannot pick up the published graph under a title the author has not published; `WorkflowAccessResource.hasGrantedAccess` is the seam that decides which copy a caller gets. Granted access -- owner, shared, project member -- keeps tracking the author's latest, because sharing is not publishing. Name and description freeze because they are as public as the graph: if only the graph froze, a report about a title could be answered by editing the title while the pinned copy still advertised it. Routed through it: opening a workflow, the hub's read, Clone, Duplicate, `/workflow_name`, `/workflow_description` and the size a listing shows. A workflow that follows the author's latest -- every workflow today -- is served exactly what it is served now. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8af259c to
514191f
Compare
|
/request-review: @aglinxinyuan |
…pache#8576) ### What changes were proposed in this PR? A listing is where most people meet a workflow, so it has to agree with what opening it shows. This makes search and the hub match, display and link against the copy on show. - **Search matches the copy the caller may see.** One search returns both the caller's own workflows and public ones, so the filter is a disjunction of guarded filters — the working copy for rows they were granted, the frozen copy for rows they reach only because those are public. Written over bare columns rather than a `CASE`, so each side stays eligible for its own PGroonga index. A pinned workflow no longer turns up on keywords that exist only behind the pin, and the author still finds their own work on what they just typed. - **Listings show the frozen name and description** to a viewer without granted access — the same copy the detail page serves, so a card cannot advertise a title that opening it does not show. Both are NULL while following, which leaves the live values in place. - **The hub is the public shelf**, so everything on it is listed as the public sees it, for the author too: they are looking at the shelf, not at their own dashboard. - **One definition of "the public is behind".** `WorkflowPublishService.pinDiffersFromWorkingCopy` is the share dialog's comparison as a SQL condition, and the search projection and the hub listing both use it, so a card and the dialog cannot disagree about whether edits are held back. ### Any related issues, documentation, discussions? Closes apache#7940 Part of apache#7828. Design discussion: apache#7128. Builds on apache#7853 and apache#8575, both merged. ### How was this PR tested? 19 new cases in `WorkflowPublishSpec` plus `WorkflowSearchQueryBuilderSpec` and `UnifiedResourceSchemaSpec` (567 in the dashboard package): - search not matching a public workflow on anything that exists only in unpublished edits, and matching it on its published copy — content, name and description, each separately; - an unpinned public workflow still matching the author's latest, and the author still matching their own workflow on a name only they can see; - a listing showing a public viewer the published name and description, a collaborator the live ones, and a private workflow's own listing untouched; - the drift flag a card carries: true while a pin holds edits back, false for a workflow with nothing frozen, and equal to what the share dialog reports for the same workflow — including after a rename and after a change of view, the two fields most easily left out of one of the three places that answer this. The shared condition was checked by mutation: dropping the default-view term from it turns the card-versus-dialog case red. `scalafmtCheckAll` clean. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
What changes were proposed in this PR?
With a version pinned, a workflow has two copies. This routes every read that serves a viewer
without granted access through the frozen one.
WorkflowAccessResource.hasGrantedAccess(wid, uid): granted access, as opposedto being able to read a workflow only because it is public. An owner or a shared user keeps
tracking the author's latest, because sharing is not publishing. Everyone else is here only
because the workflow is public, and gets the public copy.
WorkflowPublishService.PublicCopycarries the name, thedescription, the content and the default view together, and
publicCopyOfhands them out as agroup, so no surface can serve the published graph under a title the author never published, or
open a form view over a copy whose content carries no form.
Duplicate,
/workflow_name,/workflow_description, and the size a listing shows.from the author's current content, so listing or checking out versions would hand a public
viewer the drafts the pin is holding back.
canReadHistorykeeps the history open to anyonewith granted access, and to everyone while nothing is pinned — the public copy is then the
author's latest and its history is the history of what everyone can already see.
A workflow that follows the author's latest — every workflow today — is served exactly what it
is served now.
publicCopyOfreturns the working copy when nothing is frozen, so with no UI topin from yet (that arrives later in the series), nothing anyone can see changes.
Any related issues, documentation, discussions?
Closes #7939
Part of #7828. Design discussion: #7128. Builds on #7853, now merged.
How was this PR tested?
22 new cases in
WorkflowPublishSpec(54 in the suite, 540 in the dashboard package):the author still opening everything they have;
still clones its working copy and a copy starts with no publish state of its own;
not, and a public workflow with nothing pinned keeps the history it has today;
The history guard was checked by mutation: restoring
hasReadAccessturns the leak case red,and the case was written from a reproduction — a stranger retrieving a version of a pinned
workflow and getting back an unpublished draft.
scalafmtCheckAllclean.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
🤖 Generated with Claude Code