Skip to content

Commit 2401c4e

Browse files
committed
prerequisites refactor
1 parent 4fa4529 commit 2401c4e

41 files changed

Lines changed: 1340 additions & 550 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

common/schemas/entities.json

Lines changed: 246 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,6 @@
2626
"required": ["id", "username", "name", "tokenHash", "createdAt"],
2727
"additionalProperties": false
2828
},
29-
"Dependency": {
30-
"type": "object",
31-
"properties": {
32-
"id": {
33-
"type": "string",
34-
"description": "UUID primary key"
35-
},
36-
"stackName": {
37-
"type": "string",
38-
"description": "FK to {@link StackDefinition.name }"
39-
},
40-
"name": {
41-
"type": "string",
42-
"description": "Human-readable dependency name (e.g. \"Node.js\")"
43-
},
44-
"checkCommand": {
45-
"type": "string",
46-
"description": "Shell command to check if the dependency is satisfied (e.g. \"node --version\")"
47-
},
48-
"installationHelp": {
49-
"type": "string",
50-
"description": "Help text shown when the dependency check fails"
51-
},
52-
"createdAt": {
53-
"type": "string"
54-
},
55-
"updatedAt": {
56-
"type": "string"
57-
}
58-
},
59-
"required": ["id", "stackName", "name", "checkCommand", "installationHelp", "createdAt", "updatedAt"],
60-
"additionalProperties": false,
61-
"description": "Shareable dependency definition. Describes an external prerequisite (e.g. Node.js, Docker) that services may require. Included in stack exports and shared between installations."
62-
},
6329
"GitHubRepository": {
6430
"type": "object",
6531
"properties": {
@@ -185,12 +151,12 @@
185151
"type": "string",
186152
"description": "Optional FK to {@link GitHubRepository.id }"
187153
},
188-
"dependencyIds": {
154+
"prerequisiteIds": {
189155
"type": "array",
190156
"items": {
191157
"type": "string"
192158
},
193-
"description": "IDs of {@link Dependency } entities required by this service"
159+
"description": "IDs of {@link Prerequisite } entities required by this service"
194160
},
195161
"prerequisiteServiceIds": {
196162
"type": "array",
@@ -223,7 +189,7 @@
223189
"stackName",
224190
"displayName",
225191
"description",
226-
"dependencyIds",
192+
"prerequisiteIds",
227193
"prerequisiteServiceIds",
228194
"runCommand",
229195
"createdAt",
@@ -433,6 +399,246 @@
433399
"required": ["id", "serviceId", "processUid", "stream", "line", "createdAt"],
434400
"additionalProperties": false
435401
},
402+
"PrerequisiteType": {
403+
"type": "string",
404+
"enum": [
405+
"node",
406+
"yarn",
407+
"dotnet-sdk",
408+
"dotnet-runtime",
409+
"nuget-feed",
410+
"git",
411+
"github-cli",
412+
"env-variable",
413+
"custom-script"
414+
],
415+
"description": "The type of prerequisite that must be satisfied before a stack or service can run."
416+
},
417+
"PrerequisiteConfigMap": {
418+
"type": "object",
419+
"properties": {
420+
"node": {
421+
"type": "object",
422+
"properties": {
423+
"minimumVersion": {
424+
"type": "string"
425+
}
426+
},
427+
"required": ["minimumVersion"],
428+
"additionalProperties": false
429+
},
430+
"yarn": {
431+
"type": "object",
432+
"properties": {
433+
"minimumVersion": {
434+
"type": "string"
435+
}
436+
},
437+
"required": ["minimumVersion"],
438+
"additionalProperties": false
439+
},
440+
"dotnet-sdk": {
441+
"type": "object",
442+
"properties": {
443+
"version": {
444+
"type": "string"
445+
}
446+
},
447+
"required": ["version"],
448+
"additionalProperties": false
449+
},
450+
"dotnet-runtime": {
451+
"type": "object",
452+
"properties": {
453+
"version": {
454+
"type": "string"
455+
}
456+
},
457+
"required": ["version"],
458+
"additionalProperties": false
459+
},
460+
"nuget-feed": {
461+
"type": "object",
462+
"properties": {
463+
"feedUrl": {
464+
"type": "string"
465+
},
466+
"feedName": {
467+
"type": "string"
468+
}
469+
},
470+
"required": ["feedUrl"],
471+
"additionalProperties": false
472+
},
473+
"git": {
474+
"type": "object",
475+
"additionalProperties": {
476+
"not": {}
477+
}
478+
},
479+
"github-cli": {
480+
"type": "object",
481+
"additionalProperties": {
482+
"not": {}
483+
}
484+
},
485+
"env-variable": {
486+
"type": "object",
487+
"properties": {
488+
"variableName": {
489+
"type": "string"
490+
}
491+
},
492+
"required": ["variableName"],
493+
"additionalProperties": false
494+
},
495+
"custom-script": {
496+
"type": "object",
497+
"properties": {
498+
"script": {
499+
"type": "string"
500+
}
501+
},
502+
"required": ["script"],
503+
"additionalProperties": false
504+
}
505+
},
506+
"required": [
507+
"node",
508+
"yarn",
509+
"dotnet-sdk",
510+
"dotnet-runtime",
511+
"nuget-feed",
512+
"git",
513+
"github-cli",
514+
"env-variable",
515+
"custom-script"
516+
],
517+
"additionalProperties": false,
518+
"description": "Maps each prerequisite type to its type-specific configuration shape."
519+
},
520+
"PrerequisiteConfig": {
521+
"anyOf": [
522+
{
523+
"type": "object",
524+
"properties": {
525+
"minimumVersion": {
526+
"type": "string"
527+
}
528+
},
529+
"required": ["minimumVersion"],
530+
"additionalProperties": false
531+
},
532+
{
533+
"type": "object",
534+
"properties": {
535+
"minimumVersion": {
536+
"type": "string"
537+
}
538+
},
539+
"required": ["minimumVersion"],
540+
"additionalProperties": false
541+
},
542+
{
543+
"type": "object",
544+
"properties": {
545+
"version": {
546+
"type": "string"
547+
}
548+
},
549+
"required": ["version"],
550+
"additionalProperties": false
551+
},
552+
{
553+
"type": "object",
554+
"properties": {
555+
"version": {
556+
"type": "string"
557+
}
558+
},
559+
"required": ["version"],
560+
"additionalProperties": false
561+
},
562+
{
563+
"type": "object",
564+
"properties": {
565+
"feedUrl": {
566+
"type": "string"
567+
},
568+
"feedName": {
569+
"type": "string"
570+
}
571+
},
572+
"required": ["feedUrl"],
573+
"additionalProperties": false
574+
},
575+
{
576+
"type": "object",
577+
"additionalProperties": {
578+
"not": {}
579+
}
580+
},
581+
{
582+
"type": "object",
583+
"properties": {
584+
"variableName": {
585+
"type": "string"
586+
}
587+
},
588+
"required": ["variableName"],
589+
"additionalProperties": false
590+
},
591+
{
592+
"type": "object",
593+
"properties": {
594+
"script": {
595+
"type": "string"
596+
}
597+
},
598+
"required": ["script"],
599+
"additionalProperties": false
600+
}
601+
],
602+
"description": "Union of all possible prerequisite config shapes."
603+
},
604+
"Prerequisite": {
605+
"type": "object",
606+
"properties": {
607+
"id": {
608+
"type": "string",
609+
"description": "UUID primary key"
610+
},
611+
"stackName": {
612+
"type": "string",
613+
"description": "FK to {@link StackDefinition.name }"
614+
},
615+
"name": {
616+
"type": "string",
617+
"description": "Human-readable prerequisite name (e.g. \"Node.js >= 18\")"
618+
},
619+
"type": {
620+
"$ref": "#/definitions/PrerequisiteType",
621+
"description": "Discriminator that determines the check logic and config shape"
622+
},
623+
"config": {
624+
"$ref": "#/definitions/PrerequisiteConfig",
625+
"description": "Type-specific configuration (stored as JSON TEXT in the database)"
626+
},
627+
"installationHelp": {
628+
"type": "string",
629+
"description": "Help text shown when the prerequisite check fails"
630+
},
631+
"createdAt": {
632+
"type": "string"
633+
},
634+
"updatedAt": {
635+
"type": "string"
636+
}
637+
},
638+
"required": ["id", "stackName", "name", "type", "config", "installationHelp", "createdAt", "updatedAt"],
639+
"additionalProperties": false,
640+
"description": "Shareable prerequisite definition. Describes an external requirement (e.g. Node.js, Git, an env variable) that a stack or service may need to be satisfied before it can run. Included in stack exports and shared between installations."
641+
},
436642
"PublicApiToken": {
437643
"type": "object",
438644
"properties": {
@@ -566,12 +772,12 @@
566772
"type": "string",
567773
"description": "Optional FK to {@link GitHubRepository.id }"
568774
},
569-
"dependencyIds": {
775+
"prerequisiteIds": {
570776
"type": "array",
571777
"items": {
572778
"type": "string"
573779
},
574-
"description": "IDs of {@link Dependency } entities required by this service"
780+
"description": "IDs of {@link Prerequisite } entities required by this service"
575781
},
576782
"prerequisiteServiceIds": {
577783
"type": "array",
@@ -600,11 +806,11 @@
600806
"buildStatus",
601807
"cloneStatus",
602808
"createdAt",
603-
"dependencyIds",
604809
"description",
605810
"displayName",
606811
"id",
607812
"installStatus",
813+
"prerequisiteIds",
608814
"prerequisiteServiceIds",
609815
"runCommand",
610816
"runStatus",

0 commit comments

Comments
 (0)