Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation into Svelte re-write #1005

Draft
wants to merge 209 commits into
base: develop
Choose a base branch
from
Draft

Investigation into Svelte re-write #1005

wants to merge 209 commits into from

Conversation

chrisvire
Copy link
Member

No description provided.

@chrisvire chrisvire self-assigned this Nov 1, 2023
@chrisvire chrisvire force-pushed the develop branch 2 times, most recently from b3d0511 to eb5224e Compare February 29, 2024 17:05
@@ -51,5 +51,8 @@
"type": "module",
"volta": {
"node": "18.16.1"
},
"dependencies": {
"zod": "^3.23.8"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, all dependencies with Svelte-kit are devDependencies.

@@ -4,19 +4,31 @@

-->
<script lang="ts">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, "Internationalized" is probably not needed in the component name. Everything should internationalized.

FyreByrd and others added 30 commits December 2, 2024 08:55
…1-1 (#1053)

* Reset WorkflowInstances to 1-1 with Products

* Switch workflow methods back for 1-1

* Only write snapshot if needed

* Delete instance if terminal
* Update job execution to Micah's suggestion

* Rename/Reorganize jobs

* Create configuration object for default retries

* Reorganize queues

* Add a worker to actually process the default recurring queue

* Change queue name to enum type

* Add third queue for repeating jobs

While testing with actual builds, I noticed that we would get close to 20 individual check jobs, which really clogged up the administration dashboard.

* Rename queues per Micah's suggestion

* Disable namespace warning

* Remove bullmq page from admin settings

* Reorganize queues again

One queue/worker for each category of job

* Import workers as package

* Fix adapter issues

* Pass queue name to super constructor

* Remove queue name from child constructors

* Allow any return type for BullMQ jobs (only for debugging)

* Switch job executors to be just functions

---------

Co-authored-by: 7dev7urandom <[email protected]>
Handle old user logins
Many bug fixes
Cleanup and refactor code
Remove unnecessary components from project view
* Use SortTable for workflow-instances

* Server-side sort and search

* Fix i18n for workflow instances

* Add Project and Organization to display

* Add relative time to display

* Return instance and definition IDs in snapshot

* Simplify instances i18n

* Display org, project, workflow for specific

* Reorder columns, add project link

* Use product definitions

* Move workflow instances to own route

* Hide non-authorized routes in sidebar

* Componentize product details modal

* Add product details and change data layout

* Add link to Organization Projects

* Remove unnecessary check against page.size

* Fix horizontal scroll on mobile
* Add handler to get project access token

Any queries against this route are currently returning the login page instead of the expected response, so I have been unable to test this further. Will need to figure out later.

* Move api to unauthenticated endpoint

* Move original function behind wall, add proxy

* Attempt redirect

* Add legacy token verification

* Add project access token back to api

* Match output to SAB

* Reshape error messages to SAB expectations

* Write name for user access

* Return correct format for SAB to print error

---------

Co-authored-by: 7dev7urandom <[email protected]>
* Add stub for recurring system status check job

* SystemStatusCheck Job
* Rewrite ReassignUserTasks to ModifyUserTasks

Handles multiple potential use cases:
- Reassign tasks from one list of users to another.
- Delete all tasks for a product/project, optionally limit by user or user role.
- Create new tasks, optionally by user or role.
- Update tasks, optionally by user or role. (This is the main one used by workflow)

In all cases, can be applied to either a single product, or all products within a project. Will also refresh the PreExecuteEntries (i.e. blank-ish ProductTransitions that show the ideal path beyond the current workflow state).

Updated `databaseWrites/Projects.ts` and `workflow/index.ts` to use the new code.

* Remove UserTasks for deleted author

Will this result in the desired behavior if a user has multiple roles? What if, for some unfathomable reason, a user is both a project owner and an Author on the same project? As of right now, all tasks for that user in that project will be deleted, regardless of role. Should a user be prevented from having more than one role for a project?

* Improve return value

* Fixed a few things in the workflow logic for usertasks

Moved the delete tasks up so that they are properly deleted if the workflow is terminated.
Removed unneeded call to create ProductTransitions entries.

* Add roles column to UserTasks

* Properly handle task creation and deletion for authors

* Add/Remove tasks for OrgAdmins

* Fix orgadmin tasks

* Remove unnecessary data select

* Fix default for UserTasks.Role

* Show tasks in UI without duplicates
* Break bytesToHumanSize to lib/utils

* Display artifacts in product files

* Order builds correctly in display

* Break versionString into local function

* Show multiple, collapsable builds

* Close all but latest build by default

* Fix scrollbar

* Fix vertical layout

* X scroll for tables on mobile

* Paginate product files

* Show three builds per page by default

* Lighten active background on Pagination

* Collapse with click anywhere on header

* Don't collapse BuildArtifacts

* Add temporary fix for pluralization of product files

3 cheers for RegEx
* Add jobs for product creation, build, and publish

* Hook into jobs

* Add product creation to frontend

* Delete Product from BuildEngine

* Imitate correct build/publish failure output

* Handle post-build artifact creation

* Fix database write for artifacts

* Handle special artifact types in build

* Update ProductPublications in publish

* Move workflow creation call to products.create

Fix product validation

* Update Project DateActive

* Fix product form closing

* Handle no available product definitions

* Properly handle GOOGLE_PLAY_UPLOADED

- Tighten typing of environment
- Create bullmq job to get versionCode for GOOGLE_PLAY_UPLOADED, because XState won't properly handle asynchronous actions (ugh)

* Add environment population functions from DWKit

* Assign targets and env for build

* Assign targets and env for publish

* Add PWA properties to workflow definitions

* Fix environment merging

* remove async from workflow send

why was this async in the first place???
yes, it was my fault, but still, why???

* Add missing writes to WorkflowType

* Fix getWorkflowParameters with null Properties

* Use transitions for Project.DateActive

* Product icon in selector

* Remove unneeded TODO

* Investigate blank activity name at startup

The activityName was sometimes showing up blank. After investigating further, I was able to narrow it down to existing just at the start of a new product. This issue was sometimes persisting when the jobs backend was incorrect.

* Preserve artifact history

Had been deleting previous artifacts based on logic from S1 backend. This was determined to be unneeded, as the relevant code in S1 was determined to be unreachable after talking with @chrisvire

* Rename WorkflowContextBase to WorkflowInstanceContext

* Fix product creation workflow options init

* Create WorkflowInstance in database on create

* Log artifacts in build

* Fix lint errors in getWorkflowParameters

* Fix null description bug

* Fix check errors

* Fix errors in publish job

* Add close button to modal

* Don't close modal when going back from store

* Prevent cancel button from submitting form

* Fix styling in creation form

* Fix storeLanguage check in Product validation

* Remove store language from UI product creation

* Bump dev tsconfig for node-server to NodeNext

* Remove check for 'expired' status

* Switch updateProjectDateActive back

Switch updateProjectDateActive back to expected functionality based on S1.

I still don't fully understand under which conditions we would want to be running this. Right now I just have it to where it will execute each time a product is created, updated, or deleted.

* Remove duplicate function call

* Fix check errors with updateProjectDateActive

* Fix background color for visibility

* Add copy icon to copy project url

* Add link styling to console text

* Add close button to details modal

* Redirect to parent project on task submission

* More concise query for redirect

* Remove unnecessary IDs from task display

* Add background color to table header, and border to cells

* Create db wrappers for workflowInstances

Moved updateProjectDateActive to be handled by workflowInstances rather than products

* Configure option on SortTable to handle row click

Open artifact link in new tab when row is clicked.

* Add noStoresAvailable message to modal

* Make scope argument mandatory for get parameters

* Return params and env for debugging

* Rename targets and channel with "default" prefix

This is for clarification when looking at the job parameters

* Open console text in new tab

* Include Artifacts in Synchronize Data
* Add project create job

* Add Project Creation to UI

* Return Project.Id from databaseProxy/Projects#create

* Add TODO notes for Archive and Rebuild/Republish

* Rework new project page a bit, moved some code to common

* Add createMany for projects

* Import Projects

* Add front-end for archival and reactivation

* add project operation schema for archival etc.

* Rename verifyCanArchive to canModifyProject

* Handle project archival and reactivation

* Formatting

* Fix interaction with UserTasks

* Switch from goto to link

* Fix layout in new project page

* Return redirect if successfully created.

* Return redirect from import, fix issues

* Fix import layout, cancel redirects

* Fix check errors

* Hide repository URL if null

* Comment out task deletion on archival

Since this does not mimic S1 behavior, but would be desirable behavior in the future, I am commenting this out for now and instead opening an issue for discussion, per prior conversation on this topic.

* Fix project id for imports

* Remove unnecessary TODO

* Remove application type restrictions for new project

* Fix layout issue in add project

* Show basic errors and disable submit in add project

* Show basic errors and disable submit in import project

* Validate language tag for project creation and import

* Disable product creation if no project repo

- Disable `Add Product` button when parent project has no WorkflowProjectUrl. (WorkflowProjectUrl is set when project creation has been finished in BuildEngine).

* Remove unnecessary TODO

* Remove lastModified check

* Handle miscellaneous parse errors

* Reactive archival/reactivation

* Revert "Reactive archival/reactivation"

This reverts commit 3e653db.

* Rely on invalidation instead

* Change class:btn-disabled to disabled attr

* Fix project creation with other org

* Add extra error check for if system available

* Fix logic error in verifyCanViewAndEdit

project from db was called `org`
passed `org.Id` when needed to pass `project.OrganizationId`

* First attempts at claim ownership and project kebab

* Use details/summary instead of focus for kebab

* Componentize project action menu

* Properly hide/disable rebuild button

* Correctly clear selectedProjects

* Only show add/import on My Projects

* Color wait time red

* bulkAction projects is no longer optional
* Lighten neutral background in light theme

* Darken neutral slightly

* Make accent color blue

* Re-lighten neutral slightly

* Use suggested value for neutral
Validation would let project be created if any SuperAdmin exists. Fixed to allow if owner is SuperAdmin.

Also moved queries to variables so nested parentheses in the condition checking would be more readable.
Make product validation function more readable, similar to change in project validation.
`request` would return error if a system was marked as unavailable.
In the system status check job, systems were initialized to be marked unavailable. This meant that systems would never be successfully updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants