Repository navigation
TASK-562 - Export a selection of components as a plan and import it as drafts #120
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
Open
MrLesk
wants to merge
6
commits into
main
Choose a base branch
from
task-562-plans
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,029
−70
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1146eeb
TASK-562 - Export a selection of components as a plan and import it a…
MrLesk 0fecb6b
TASK-562 - Export a selection of components as a plan and import it a…
MrLesk c3c8a6b
Merge remote-tracking branch 'origin/main' into remediate/120
MrLesk cf4d525
TASK-562 - Export a selection of components as a plan and import it a…
MrLesk be37bc2
TASK-562 - Export a selection of components as a plan and import it a…
MrLesk 2e07df3
TASK-562 - Export a selection of components as a plan and import it a…
MrLesk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Share architecture plans | ||
|
|
||
| A plan shares an intended architecture without source ownership or map layout. | ||
| Export the elements you want, then import them in another initialized Groma | ||
| project. Imported elements are ghosts under one draft record. | ||
|
|
||
| ```sh | ||
| # In the source repository, select two components. | ||
| groma plan export checkout payments --to plans/payment-plan | ||
|
|
||
| # In the destination repository, use its existing application container. | ||
| groma plan import ../source/plans/payment-plan --parent application | ||
| ``` | ||
|
|
||
| On the live browser map, select several components and use **Export as plan** | ||
| beside **Group as** and **Combine into**. Enter a new directory relative to the | ||
| repository; Groma writes the same bundle as the CLI. | ||
|
|
||
| The directory name becomes the plan title. Export requires a new directory. | ||
| The bundle contains an OKF `index.md`, a `plan.md` record, selected element | ||
| Markdown files, and flows whose steps stay entirely inside the selection. | ||
| Unselected parents are referenced by ID and must already exist at import. | ||
| `--parent` replaces these references with an existing destination parent; | ||
| normal C4 containment rules still apply. To carry a complete architecture into | ||
| an empty initialized project, explicitly select its system and containers as | ||
| well as its components. | ||
|
|
||
| An example `plan.md`: | ||
|
|
||
| ```markdown | ||
| --- | ||
| type: Groma Plan | ||
| title: payment-plan | ||
| groma: | ||
| parents: | ||
| - source-application | ||
| --- | ||
|
|
||
| Architecture to implement. | ||
| ``` | ||
|
|
||
| The selected `checkout` document remains normal architecture Markdown: | ||
|
|
||
| ```markdown | ||
| --- | ||
| type: C4 Component | ||
| title: Checkout | ||
| status: draft | ||
| groma: | ||
| id: checkout | ||
| parent: source-application | ||
| --- | ||
|
|
||
| Collects an order and asks Payments to authorize it. | ||
|
|
||
| ## Draft relationships | ||
|
|
||
| | Source | Target | Description | Technology | | ||
| | --- | --- | --- | --- | | ||
| | [checkout](checkout.md) | [payments](payments.md) | Requests authorization | HTTPS | | ||
| ``` | ||
|
|
||
| Both component documents live together at their source architecture paths | ||
| inside the bundle. Their parent is an ID reference, not a copied container. | ||
| Import computes their destination paths from the destination parent, keeps | ||
| IDs and overviews, and adds `groma.draft: payment-plan`. It also creates | ||
| `drafts/payment-plan.md`. Relationships remain draft rows with concept links. | ||
|
|
||
| A colliding element, flow or draft ID, or a missing parent, rejects the whole | ||
| import before any architecture document is written. Import never renames IDs. | ||
|
|
||
| Implement the imported responsibilities in source, run `groma scan`, and use | ||
| `groma accept <id>` for each matched ghost. The existing scanner matching rules | ||
| apply; import does not invent source paths or force a match. Scanning and | ||
| accepting elements do not accept their planned relationships. | ||
|
|
||
| The [Markdown contract](component-markdown.md#plan-bundles) defines the format. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| type: C4 Component | ||
| title: Architecture plans | ||
| status: stable | ||
| groma: | ||
| id: plan | ||
| parent: cli | ||
| code: | ||
| - scanner: typescript | ||
| file: src/plan.ts | ||
| group: Architecture records | ||
| description: Shares selected architecture as portable OKF drafts | ||
| --- | ||
|
|
||
| Exports selected C4 responsibilities, their internal relationships and flows as ordinary OKF Markdown without source ownership or layout. Import resolves existing parents, validates IDs and the complete architecture before saving, and writes ghosts at their canonical paths under one named draft record. The shared authoring API exposes the same operation to command-line users and browser multi-selection. Scanner matching and element acceptance retain their existing responsibilities. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.