Add script review page #304

Merged
itzaname merged 6 commits from feature/script-review into staging 2025-12-27 19:56:20 +00:00
Owner

Closes !2

Added review dashboard button as well.

image.png

image.png

Closes !2 Added review dashboard button as well. <img width="1313" alt="image.png" src="attachments/a2abd430-7ff6-431a-9261-82e026de58f5"> ![image.png](/attachments/e1ba3536-2869-4661-b46c-007ddaff8f3e)
itzaname added the frontend label 2025-12-27 16:40:29 +00:00
itzaname added 1 commit 2025-12-27 16:40:30 +00:00
Add script review page
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
1e7fd02de5
itzaname requested review from Quaternions 2025-12-27 16:40:30 +00:00
Owner

The script Name is a full path that is separated with dots and will be much longer than 'Script'. Example:

surf_projecto.surf_project.Ramps.ScaledModel.circlegroup.FlashingCircle.Circle1.Part.Script
The script Name is a full path that is separated with dots and will be much longer than 'Script'. Example: ``` surf_projecto.surf_project.Ramps.ScaledModel.circlegroup.FlashingCircle.Circle1.Part.Script ```
Author
Owner

The script Name is a full path that is separated with dots and will be much longer than 'Script'. Example:

surf_projecto.surf_project.Ramps.ScaledModel.circlegroup.FlashingCircle.Circle1.Part.Script

Was not missed during testing....

image.png
> The script Name is a full path that is separated with dots and will be much longer than 'Script'. Example: > ``` > surf_projecto.surf_project.Ramps.ScaledModel.circlegroup.FlashingCircle.Circle1.Part.Script > ``` Was not missed during testing.... <img width="1080" alt="image.png" src="attachments/085b6995-ee2d-4639-b810-b4a117c21586">
139 KiB
Quaternions requested changes 2025-12-27 17:53:54 +00:00
Dismissed
@@ -0,0 +412,4 @@
// If policy is Replace, create new script first
if (selectedPolicy === PolicyType.Replace) {
const createScriptResponse = await fetch('/v1/scripts', {
Owner

The replacement script may already exist in the database. Is importing siphash 2-4 even an option? Should this be handled in the backend and just transparently return the existing ID?

The replacement script may already exist in the database. Is importing siphash 2-4 even an option? Should this be handled in the backend and just transparently return the existing ID?
Author
Owner

That's a backend implementation detail. If the hash already exists it needs to just return the existing script id.

That's a backend implementation detail. If the hash already exists it needs to just return the existing script id.
Author
Owner

Will give it a shot. Going to attempt to make hash unique but I assume that's already blown up in the prod db: da48d1390e

Will give it a shot. Going to attempt to make hash unique but I assume that's already blown up in the prod db: https://git.itzana.me/StrafesNET/maps-service/commit/da48d1390ece86d75bed8683621fba898c762549
Owner

I wrote a repair tool to do consistency check. I just ran it and there was no duplicates so hopefully should be good to push to prod

I wrote a repair tool to do consistency check. I just ran it and there was no duplicates so hopefully should be good to push to prod
Quaternions marked this conversation as resolved
@@ -0,0 +431,4 @@
const result = await createScriptResponse.json();
toScriptID = result.ScriptID;
}
Owner

Replace action should also create an "Allowed" policy for the new script. This lets the validator auto-pass map fixes containing the new script.

Replace action should also create an "Allowed" policy for the new script. This lets the validator auto-pass map fixes containing the new script.
Author
Owner
https://git.itzana.me/StrafesNET/maps-service/commit/2eb581705d8c1e8b8e34aa180738d5be945d06cb
Quaternions marked this conversation as resolved
Owner

I can't review the full thing at the moment. Compare to my review tool for reference:

let reviewed_policy=match script_action{

I can't review the full thing at the moment. Compare to my review tool for reference: https://git.itzana.me/StrafesNET/remote-script-review/src/commit/ca5203068acf2bec25e5f0575064bce27bf38d7f/src/main.rs#L211
itzaname added 1 commit 2025-12-27 18:50:25 +00:00
Make editor full screen with no nav
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
a779276082
Owner

Please add a purge option to purge the script and policy from the database.

Please add a purge option to purge the script and policy from the database.
itzaname added 1 commit 2025-12-27 19:09:57 +00:00
Update script endpoint for dedupe
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
a399cb0146
itzaname added 1 commit 2025-12-27 19:31:31 +00:00
Create new policy for new script replacements
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2eb581705d
Quaternions requested changes 2025-12-27 19:35:08 +00:00
Dismissed
@@ -0,0 +465,4 @@
// Check if a policy already exists for this script hash
// I wouldn't expect this to be possible but it's a scary world out there
const existingPoliciesResponse = await fetch(
`/v1/script-policy?FromScriptHash=${newScriptHash}&Page=1&Limit=10`
Owner

Limit=10 can be Limit=1

Limit=10 can be Limit=1
itzaname marked this conversation as resolved
itzaname added 1 commit 2025-12-27 19:48:29 +00:00
Add purge feature
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
4cdd22ff52
Author
Owner

Please add a purge option to purge the script and policy from the database.

4cdd22ff52

image.png
image.png

> Please add a purge option to purge the script and policy from the database. https://git.itzana.me/StrafesNET/maps-service/commit/4cdd22ff52687ac713cab53605aa5c5ef41136ba ![image.png](/attachments/deb82895-07b3-442b-a646-1291e33ad71a) ![image.png](/attachments/b39b2f3e-9353-4f9d-b380-eead8442101d)
itzaname added 1 commit 2025-12-27 19:49:52 +00:00
Make limit 1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
41f96a2531
Author
Owner

Anything else? This should be ready.

Anything else? This should be ready.
itzaname requested review from Quaternions 2025-12-27 19:53:03 +00:00
Quaternions approved these changes 2025-12-27 19:56:00 +00:00
Owner

LGTM

LGTM
itzaname merged commit 7c5d8a2163 into staging 2025-12-27 19:56:20 +00:00
itzaname deleted branch feature/script-review 2025-12-27 19:56:20 +00:00
Sign in to join this conversation.