netcreateorg / netcreate-itest

Developing the 2.0 version of NetCreate
https://github.com/netcreateorg/netcreate-2018
Other
0 stars 0 forks source link

Feature: Provenance #213

Closed benloh closed 1 month ago

benloh commented 1 month ago

This introduces a revamped "Provenance" tab.

To implement this, we've introduced another major revision to the template format, and are adding a version designator to gracefully handle migrations in the future.

screenshot_1574

Breaking Changes

NOTE: the template format has changed, but the app should still gracefully load older projects. You may need to manually update the project's template to add new Provenance functionality. See Working with older projects below.

Significant Features

Minor Features

See also #37 and Provenance Ideas


To Test

The easiest way to test this is to create a new project. (_default.template.toml has been updated, so any new project should use the new template schema).

  1. ./nc.js --dataset=newtest
  2. Create a token and log in. (ncMakeTokens('new','a','newtest',2))
  3. Create a node
  4. Savet eh node
  5. Click on "Provenance" -- you should see "Info Source" and "HISTORY" sections with your login data as the created by and updated by author.

Working with older projects

Older projects (e.g. any project created before May 23, 2024), will still open.

If you want to add provenance fields to an older project you have two options:

  1. Create a new field, e.g. "Info Source", or
  2. Add isProvenance to an existing field to have it appear in the "PROVENANCE" tab. e.g. you can convert the old provenance field into an active provenance field by adding the isProvenance flag.

To Do

jdanish commented 1 month ago

I created a new network and node. The created by field seems correct but updated is not changing?

Screenshot 2024-05-23 at 2 49 32 PM
jdanish commented 1 month ago

So far, looks good. I assume this is on a list somewhere, but the main functionality missing is being able to filter by / view the dates of change / update. Otherwise, I'll keep banging but creating a new network and importing then tweaking an old one both appear to work AOK.

jdanish commented 1 month ago

Just noted that the imported template is not changing the template version. Is that meant to be hand-edited or it should update?

jdanish commented 1 month ago

Spoke too soon. In a network created after the code update (so version 2 template), added an edge and the user for update and add are not being filled, even though they filled for the node, and when I click on the provenance field I cannot type anything.

Screenshot 2024-05-23 at 3 08 30 PM
benloh commented 1 month ago

I created a new network and node. The created by field seems correct but updated is not changing?

Will look into this.

So far, looks good. I assume this is on a list somewhere, but the main functionality missing is being able to filter by / view the dates of change / update.

I think we probably want to implement historical dates before we spend time working on the filters because that will completely change how we handle dates.

Just noted that the imported template is not changing the template version. Is that meant to be hand-edited or it should update?

I guess I didn't anticipate this use model. So I'm assuming you had started with the old version template and then hand-editted the template with new fields?

Currently we're not migrating the data from a pre-2.0 template to a 2.0 template. I was assuming that you would want to retain the old functionality. So my goal with the migration was to just prevent things from breaking.

I suppose if we have a large corpus of projects that need migration we can add more explicit migration tools.

Currently the version needs to be hand updated. I didn't want that to be edited in the template editor.

Spoke too soon. In a network created after the code update (so version 2 template), added an edge and the user for update and add are not being filled, even though they filled for the node, and when I click on the provenance field I cannot type anything.

I'll look into this too. I expect there are a few more issues like this since I haven't done a full QA yet.

jdanish commented 1 month ago

Cool. I assumed you'd want to do the date format first but wanted to make sure nothing fell through the cracks.

Re: migration. No, there are only a few and I can update them by hand. I think this makes sense. In the future we'll want it to be automatic as we begin to expand our user base, but I'd rather do this by hand and have you do other more important things.

And all good re: issues - that's what QA is for!

dsriseah commented 1 month ago

Some weird behavior I noticed:

Testing New Project

On Autosave with one node, I noticed the server going haywire (launched from a terminal, node 18.18.2, arch i386)

ServerDB - AUTOSAVING! 1 NODES / 0 EDGES / 0 COMMENTS / 0 READBY <3
ServerDB - AUTOSAVING! 1 NODES / 0 EDGES / 0 COMMENTS / 0 READBY <3

--- rebuilding _ur_addons ---
    building core...
    building addons...
    triggering recompile...

[15 repetitions of the above]

13:17:35 - info: Installing packages with npm...

--- rebuilding _ur_addons ---
    building core...
    building addons...
    triggering recompile...

[endless repetitions]

I also noticed a recompile happening when trying to enter a date on provenance image and the app stopped responding image

A weird error after reloading, doing date entry, where it's defaulting to zero and the input rejection doesn't work because I can't delete the leading zero

image
benloh commented 1 month ago

Dates are broken at the moment. We're completely redoing date fields.

dsriseah commented 1 month ago

[moved to issue #222]

Speculation as to the cause of recompile loops

There is a watcher process that brunch-config.js defines: image

If you are writing data into the _ur or _ur_addons directory, you will trigger a recompile. Data should be written to the NetCreate runtime directory.

TO DEBUG

If you notice it happening again, you can console.log the event and path parameters of the on('all' on line 134 of brunch-config.js to see what is getting written.