Skip to content

feat(workflow): mark the pinned version in the revision history - #8577

Open
yangzhang75 wants to merge 1 commit into
apache:mainfrom
yangzhang75:pin/5-anchor
Open

yangzhang75 wants to merge 1 commit into
apache:mainfrom
yangzhang75:pin/5-anchor

Conversation

@yangzhang75

@yangzhang75 yangzhang75 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Which version is the public one should be answerable, and the answer should be a row the author
can already see — the version panel is where they go to look at, and restore, an earlier version.

  • A pin leaves an anchor in the revision history. Its delta is the identity patch, so replaying
    that row returns what was published however many edits pile up later. An existing version row
    cannot stand in: one replays to the content as it was before the change it records, so it
    names the wrong thing by exactly one save. Pinning again with nothing changed reuses the anchor
    rather than adding a twin, and workflow.published_version_id names it.
  • The anchor is a marker, not an edit. It is always shown, so the author can find and restore
    what the public has, but it must not start the panel's aggregation window — the save it was
    pinned from is seconds older and would otherwise be folded into it and disappear.
  • The public view is dated by the version on show, not by the author's most recent private
    edit, and the share dialog names the same date from the same row, so the two cannot disagree.
  • Pinning takes the row's lock first. Two pins racing would otherwise both read before either
    wrote, and both insert an anchor.

Any related issues, documentation, discussions?

Closes #7941
Part of #7828. Design discussion: #7128. Builds on #7853, #8575 and #8576, all merged.

How was this PR tested?

7 new cases in WorkflowPublishSpec and WorkflowVersionResourceSpec (572 in the dashboard
package):

  • an anchor the author can identify in the panel, and the save it was pinned from still visible
    beside it rather than folded into it;
  • pinning again unchanged reusing the anchor instead of adding a second one;
  • the version the pin was taken from surviving after the pin is dropped;
  • the public view dated by the pinned version, and the same date reported by the share dialog;
  • a workflow that is following carrying no anchor at all.

scalafmtCheckAll clean.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15
    You can notify them by mentioning @mengw15 in a comment.

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 4 better · 🔴 3 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main e9e5fda benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 396 0.242 25,414/32,743/32,743 us 🟢 -34.1% / 🔴 +130.8%
🟢 bs=100 sw=10 sl=64 847 0.517 117,634/132,951/132,951 us 🟢 -22.4% / 🔴 +38.0%
⚪ bs=1000 sw=10 sl=64 979 0.598 1,020,782/1,081,762/1,081,762 us ⚪ within ±5% / 🔴 +17.8%
Baseline details

Latest main e9e5fda from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 396 tuples/sec 422 tuples/sec 880.16 tuples/sec -6.2% -55.0%
bs=10 sw=10 sl=64 MB/s 0.242 MB/s 0.258 MB/s 0.537 MB/s -6.2% -55.0%
bs=10 sw=10 sl=64 p50 25,414 us 19,914 us 11,544 us +27.6% +120.1%
bs=10 sw=10 sl=64 p95 32,743 us 49,659 us 14,186 us -34.1% +130.8%
bs=10 sw=10 sl=64 p99 32,743 us 49,659 us 17,122 us -34.1% +91.2%
bs=100 sw=10 sl=64 throughput 847 tuples/sec 855 tuples/sec 1,151 tuples/sec -0.9% -26.4%
bs=100 sw=10 sl=64 MB/s 0.517 MB/s 0.522 MB/s 0.703 MB/s -1.0% -26.4%
bs=100 sw=10 sl=64 p50 117,634 us 112,772 us 89,900 us +4.3% +30.8%
bs=100 sw=10 sl=64 p95 132,951 us 171,371 us 96,346 us -22.4% +38.0%
bs=100 sw=10 sl=64 p99 132,951 us 171,371 us 110,344 us -22.4% +20.5%
bs=1000 sw=10 sl=64 throughput 979 tuples/sec 985 tuples/sec 1,189 tuples/sec -0.6% -17.7%
bs=1000 sw=10 sl=64 MB/s 0.598 MB/s 0.601 MB/s 0.726 MB/s -0.5% -17.6%
bs=1000 sw=10 sl=64 p50 1,020,782 us 1,015,251 us 873,675 us +0.5% +16.8%
bs=1000 sw=10 sl=64 p95 1,081,762 us 1,059,846 us 918,440 us +2.1% +17.8%
bs=1000 sw=10 sl=64 p99 1,081,762 us 1,059,846 us 953,075 us +2.1% +13.5%
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,505.04,200,128000,396,0.242,25413.82,32743.32,32743.32
1,100,10,64,20,2361.60,2000,1280000,847,0.517,117633.70,132951.15,132951.15
2,1000,10,64,20,20421.96,20000,12800000,979,0.598,1020781.53,1081762.01,1081762.01

@codecov-commenter

codecov-commenter commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.81%. Comparing base (e9e5fda) to head (208d04a).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8577   +/-   ##
=========================================
  Coverage     91.81%   91.81%           
- Complexity     5021     5022    +1     
=========================================
  Files          1277     1277           
  Lines         56381    56399   +18     
  Branches       7362     7362           
=========================================
+ Hits          51765    51784   +19     
  Misses         2762     2762           
+ Partials       1854     1853    -1     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from e9e5fda
agent-service 99.53% <ø> (ø) Carriedforward from e9e5fda
amber 85.79% <100.00%> (+0.01%) ⬆️
computing-unit-managing-service 64.05% <ø> (ø) Carriedforward from e9e5fda
config-service 87.73% <ø> (ø) Carriedforward from e9e5fda
file-service 82.31% <ø> (ø) Carriedforward from e9e5fda
frontend 96.54% <ø> (ø) Carriedforward from e9e5fda
notebook-migration-service 83.77% <ø> (ø) Carriedforward from e9e5fda
pyamber 98.50% <ø> (ø) Carriedforward from e9e5fda
workflow-compiling-service 78.30% <ø> (ø) Carriedforward from e9e5fda

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yangzhang75
yangzhang75 force-pushed the pin/5-anchor branch 3 times, most recently from 6c57b03 to c2e9a09 Compare September 28, 2026 21:13
@yangzhang75
yangzhang75 marked this pull request as ready for review October 6, 2026 18:42
@yangzhang75
yangzhang75 marked this pull request as draft October 7, 2026 01:36
@yangzhang75
yangzhang75 force-pushed the pin/5-anchor branch 3 times, most recently from 7385c46 to 699d08a Compare October 13, 2026 00:55
@yangzhang75
yangzhang75 force-pushed the pin/5-anchor branch 2 times, most recently from aac7861 to 43494d3 Compare October 18, 2026 22:08
@yangzhang75
yangzhang75 marked this pull request as ready for review November 2, 2026 09:12
@yangzhang75

Copy link
Copy Markdown
Contributor Author

/request-review: @aglinxinyuan

The author can pin a version, and their working copy then moves on. This
gives them a way back to what the public is seeing: pinning leaves an
anchor in the revision history they already use, and the panel marks it
as the one currently public, so restoring the published version is the
restore they already know.

The anchor is a version row whose delta is the identity patch, so
replaying it returns exactly what was pinned however many edits pile up
after. An existing row cannot stand in: a version row replays to the
content as it was *before* the change it records. Pinning content that is
already the pinned one reuses its anchor rather than adding a twin, and
the read that decides takes a row lock so two pins racing cannot both
insert.

Two consequences the anchor forces:

- It must not start the version panel's aggregation window. It lands
  seconds after the save it freezes, and the panel folds close-together
  versions into the newest, which would hide the author's own save behind
  a row they never made.
- The revision history is now readable only with granted access, or while
  nothing is pinned. Replaying a version folds deltas back from the
  author's current content, so listing versions of a pinned workflow would
  hand a public viewer the very edits the pin is holding back.

`publish-status` carries the pinned version's date, read from the version
row so the dialog and the panel print one value rather than two clocks'.

Co-Authored-By: Claude Opus 5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark the pinned version in the revision history

2 participants