yangzhang75 opened a new pull request, #8575:
URL: https://github.com/apache/texera/pull/8575
### 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.
- **The seam** — `WorkflowAccessResource.hasGrantedAccess(wid, uid)`:
granted access, as opposed
to 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.
- **One copy, not four fields** — `WorkflowPublishService.PublicCopy`
carries the name, the
description, the content and the default view together, and `publicCopyOf`
hands them out as a
group, 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.
- **Routed through it** — opening a workflow, the hub's read of a public
workflow, Clone,
Duplicate, `/workflow_name`, `/workflow_description`, and the size a
listing shows.
- **The revision history is a door into the same room.** Replaying a version
folds deltas back
from the author's *current* content, so listing or checking out versions
would hand a public
viewer the drafts the pin is holding back. `canReadHistory` keeps the
history open to anyone
with 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.** `publicCopyOf` returns the working copy when nothing is
frozen, so with no UI to
pin 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. Stacked on #7853, which this needs
and which is under
review; until that merges, this PR shows its commit too and the review here
is the second one.
### How was this PR tested?
22 new cases in `WorkflowPublishSpec` (52 in the suite, 537 in the dashboard
package):
- the published version reaching a stranger while the author keeps their own
working copy;
- opening a pinned workflow serving the whole copy — its own title,
description and view — and
the author still opening everything they have;
- a collaborator with granted read access tracking the author's latest as
they keep editing;
- clone and duplicate taking the published copy, metadata included, while a
private workflow
still clones its working copy and a copy starts with no publish state of
its own;
- the size each case reports;
- the revision history: a public viewer is refused while a pin is in place,
a collaborator is
not, and a public workflow with nothing pinned keeps the history it has
today;
- a public copy of a workflow that is not public being refused rather than
falling through.
The history guard was checked by mutation: restoring `hasReadAccess` turns
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.
`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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]