Plan the default configuration files: working folder first, then the checkout
- --config and --env, else ./config.env and ./.env, else the checkout's - Files named before any request; a file from the working folder needs a yes - UC-002, US-002, MIL-007 criteria 9 and 10, models and contracts updated - Review record RC-029
This commit is contained in:
+21
-11
@@ -10,6 +10,7 @@
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-07 | Proposed | Jens Tirsvad Nielsen | S02 | Initial version | [1cd27f7] |
|
||||
| 2026-10-07 | Proposed | Jens Tirsvad Nielsen | S02 | Default configuration files: --config and --env, else ./config.env and ./.env in the working folder, else the checkout's | pending |
|
||||
|
||||
---
|
||||
|
||||
@@ -28,6 +29,7 @@ participant ":Launcher" as L
|
||||
participant ":ProjectCreator" as PC
|
||||
participant ":Checkout" as CK
|
||||
participant ":WorkingFolder" as WF
|
||||
participant ":ConfigFiles" as CF
|
||||
|
||||
Maintainer -> L : startFromWorkingFolder(configPath, envPath)
|
||||
activate L
|
||||
@@ -37,13 +39,20 @@ L -> CK : Checkout(path)
|
||||
L -> L : currentFolder()
|
||||
create WF
|
||||
L -> WF : WorkingFolder(path)
|
||||
alt the Checkout's own files are not found
|
||||
L -> L : locateConfigFiles(configPath, envPath, checkout, workingFolder)
|
||||
create CF
|
||||
L -> CF : ConfigFiles(configFile, envFile)
|
||||
alt a chosen file is in the working folder
|
||||
L -> Maintainer : confirm the files and the Gitea address
|
||||
Maintainer --> L : yes or no
|
||||
end
|
||||
alt the Checkout's own files, or both places for a config file, are not found
|
||||
L --> Maintainer : error naming the folder looked in
|
||||
end
|
||||
L -> PC : startProjectCreation(checkout, workingFolder, configPath, envPath)
|
||||
L -> PC : startProjectCreation(workingFolder, configFiles)
|
||||
activate PC
|
||||
alt config.env or .env not found, or a value malformed
|
||||
PC --> L : error naming the path or the key
|
||||
alt a value in config.env or .env is malformed
|
||||
PC --> L : error naming the key
|
||||
end
|
||||
PC --> L : promptSet
|
||||
deactivate PC
|
||||
@@ -56,9 +65,9 @@ deactivate L
|
||||
|
||||
| Pattern (GRASP / GoF) | Applied to | Rationale |
|
||||
| --- | --- | --- |
|
||||
| Information Expert | `Launcher.resolveCheckout` | The launcher knows how the script was invoked, so it is the one that can follow the command link |
|
||||
| Information Expert | `Launcher.resolveCheckout`, `Launcher.locateConfigFiles` | The launcher knows how the script was invoked, so it is the one that can follow the command link |
|
||||
| Controller | `Launcher` | One object takes the system operation and hands the work to `ProjectCreator`; `ProjectCreator` stays unaware of links |
|
||||
| Low Coupling | `ProjectCreator` receives `checkout` and `workingFolder` as values | The use case [UC-001] runs unchanged whatever way the script was started |
|
||||
| Low Coupling | `ProjectCreator` receives `workingFolder` and `configFiles` as values | The use case [UC-001] runs unchanged whatever way the script was started |
|
||||
|
||||
### Postcondition Coverage
|
||||
|
||||
@@ -67,14 +76,15 @@ deactivate L
|
||||
| P1 Run | `startFromWorkingFolder` (the run starts with it) |
|
||||
| P2 Checkout | `resolveCheckout(invocation)` and the creation of `Checkout` |
|
||||
| P3 WorkingFolder | `currentFolder()` and the creation of `WorkingFolder` |
|
||||
| P4 default directory under the WorkingFolder | `startProjectCreation(checkout, workingFolder, ...)`; the prompt default is built from `workingFolder` |
|
||||
| P5 Configuration | `startProjectCreation` loads `config.env` and `.env` from `checkout` or from the given paths (`load` of [SD-001]) |
|
||||
| P6 PromptSet | the returned `promptSet` |
|
||||
| Exceptions: files not found; configuration not found or malformed | the two `alt` fragments |
|
||||
| P4 default directory under the WorkingFolder | `startProjectCreation(workingFolder, configFiles)`; the prompt default is built from `workingFolder` |
|
||||
| P5 ConfigFiles | `locateConfigFiles(...)` and the creation of `ConfigFiles`; the paths are named before any request |
|
||||
| P6 Configuration | `startProjectCreation(workingFolder, configFiles)` loads the two files (`load` of [SD-001]) |
|
||||
| P7 PromptSet | the returned `promptSet` |
|
||||
| Exceptions: files not found, not confirmed, or malformed | the `alt` fragments |
|
||||
|
||||
### Responsibility Check
|
||||
|
||||
`Launcher` only finds the checkout and the working folder; it reads no configuration and makes no repository. `ProjectCreator` keeps every other responsibility of [SD-001].
|
||||
`Launcher` only finds the checkout, the working folder and the two files; it reads no configuration and makes no repository. `ProjectCreator` keeps every other responsibility of [SD-001].
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user