Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f3dc9c4 to
48ace2d
Compare
242fda8 to
25910f5
Compare
2693c74 to
9eac2b7
Compare
| const notify = useToastNotification(); | ||
| const navigate = useNavigate(); | ||
|
|
||
| const runNotes = useRef<string>(""); |
There was a problem hiding this comment.
Using ref here smells - why do we need it?
There was a problem hiding this comment.
Ok, moving annotations to "submitPipeline" as an initial payload will solve this problem automatically
There was a problem hiding this comment.
Due to the chaining of queries a useState was not updating correctly and thus passing stale values.
You are correct that using submitPipelineRun to save the annotation alongside the run in one go will fix this, however, submitting annotations via that API does not work as expected.
maxy-shpfy
left a comment
There was a problem hiding this comment.
I wish the API /api/pipeline_runs/?include_pipeline_names=true&include_execution_stats=true return some annotations as well so we can display notes in the list. - I believe that could be valuable in some cases.
| const { mutate: saveNotes } = useMutation({ | ||
| mutationFn: (runId: string) => | ||
| updateRunNotes(runId, backendUrl, runNotes.current), | ||
| }); | ||
|
|
There was a problem hiding this comment.
I would change that to send annotations immediately on Run creation, and not AFTER it was created - it will simplify the logic significantly. See https://github.com/TangleML/tangle-ui/blob/master/src/utils/submitPipeline.ts#L63-L65
There was a problem hiding this comment.
it will simplify the logic significantly
It does and I initially tried this. But unless I'm using or understanding the API incorrectly it does not work. Annotations set via submitPipelineRun do not appear when calling GET /api/pipeline_runs/{id}/annotations/ suggesting that the two sets of annotations are stored differently
There was a problem hiding this comment.
I see. Could we avoid it by a following logic:
1. On submit use TaskSpec annotations to set initial value of notes (in case of presence). This will simplify the entire submitter.
2. On Run View - display immutable notes from TaskSpec, and if user opts in to update notes AFTER - use annotations API. UI will prioritize Notes from API.
And as soon as backend fixes behavior - FE logic would stay exactly as is, no need to redo/refactor after.
There was a problem hiding this comment.
I'm not sure I like either of these solutions. We end up with annotations stored in different places or multiple times.
/api/pipeline_runs/{id}/annotations/ was specifically created for mutable annotations on runs, it would seem weird to avoid using it. It's annoying that the API doesn't behave as expected, but I'd rather use it in its current state than commit to data structures and flows that are completely different to what's intended.
maxy-shpfy
left a comment
There was a problem hiding this comment.
I believe you should send annotations immediately on the Run creation, and not AFTER it was created - it will simplify the logic significantly. See https://github.com/TangleML/tangle-ui/blob/master/src/utils/submitPipeline.ts#L63-L65
9eac2b7 to
9de647c
Compare
0384a19 to
5606e42
Compare
9de647c to
c4ee73e
Compare
|
^ I tried this. Unfortunately it seems that sending annotations alongside the However, I could have missed something or misunderstand the API, so we can pair on this to dive deeper. |
c4ee73e to
4aa5346
Compare
4aa5346 to
af329da
Compare
5606e42 to
5b52fc6
Compare
af329da to
a3c6427
Compare
5b52fc6 to
92da712
Compare
Yes, we should synchronize these things. TangleML/tangle#83
You're right. Created an issue to fix this: TangleML/tangle#84 P.S. History notes: |
discussed at release meeting
92da712 to
e8dfb04
Compare
a3c6427 to
54855f1
Compare
e8dfb04 to
015eaa5
Compare
54855f1 to
25c6200
Compare
25c6200 to
bac19b2
Compare

Description
Adds a free text field to pipeline runs context panel so users can note down any thoughts or comments.
If the viewing user is not the creator of the run they will not be able to edit the notes.
Also adds an input field to the "Submit Run with Task Arguments" dialog, so that users can enter notes at the time they submit the run.
pipeline-and-run-notes-demo.mov (uploaded via Graphite)
Related Issue and Pull requests
Closes https://github.com/Shopify/oasis-frontend/issues/157
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
Additional Comments