generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 57
RHIDP-8627: Templates lifecycle management #1470
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
89a7cf7
Templates lifecycle management
pabel-rh 404431e
Added the specific catalog rules
pabel-rh 4267c4d
Incorporated Frank's comment
pabel-rh 2756bd4
Minor change
pabel-rh 6d7a81e
Minor change
pabel-rh f2b33db
Minor change
pabel-rh 92f9902
typo
pabel-rh 8302957
Minor comment
pabel-rh 490b1ab
Incorporated Judy's comments
pabel-rh 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
Some comments aren't visible on the classic Files Changed page.
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
12 changes: 12 additions & 0 deletions
12
assemblies/assembly-tracking-component-origin-and-software-template-version.adoc
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,12 @@ | ||
| :_mod-docs-content-type: ASSEMBLY | ||
|
|
||
| [id="tracking-component-origin-and-software-template-version"] | ||
| = Tracking Component origin and Software Template version | ||
|
|
||
| Platform engineers use custom actions within the Software Template scaffolding process to establish and track the dependency link between a generated entity (Component or Resource) and its source template. This relationship is called scaffolding provenance. | ||
|
|
||
| Platform administrators use the existing custom actions `catalog:scaffolded-from` and `catalog:template:version` in the scaffolder backend module. These actions track the template version and the corresponding entity version, which simplifies lifecycle management. | ||
|
|
||
| include::modules/tracking-component-origin-and-software-template-version/proc-configuring-provenance-and-software-template-versioning.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/tracking-component-origin-and-software-template-version/proc-viewing-software-template-dependencies.adoc[leveloffset=+1] | ||
66 changes: 66 additions & 0 deletions
66
...plate-version/proc-configuring-provenance-and-software-template-versioning.adoc
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,66 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="proc-configuring-provenance-and-software-template-versioning_{context}"] | ||
| = Configuring provenance and Software Template versioning {product} | ||
|
|
||
| As a platform engineer, you must modify the Software Template YAML definition to ensure the required provenance information is added during the scaffolding process. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have administrator rights to {product}. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Locate the Software Template object YAML file where you want to add the provenance information and add a step that uses the `catalog:scaffolded-from` action. This action links the resulting catalog entity back to the source template. | ||
| . Optional: To track the template version (for example, v1.0 versus v1.5), include the `catalog:template:version` action in the `steps` section. | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| This action reads a version parameter defined in the template and applies it as an annotation to the resulting catalog entity. | ||
| ==== | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| # Example: Adding the versioning action to the steps section | ||
pabel-rh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| steps: | ||
| - id: create-version-annotation | ||
| name: Create Template Version Annotation | ||
| action: catalog:template:version | ||
| input: | ||
| templateVersion: ${{ parameters.version }} # Reads the version parameter | ||
| - ... other steps ... | ||
| ---- | ||
|
|
||
| . In your `{product} app-config.yaml` file, modify the `catalog.rules` section to include a rule for Software Templates, and configure the `catalog.locations` section to point to the Software Template that you want to add, as shown in the following example: | ||
pabel-rh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,yaml] | ||
| ---- | ||
| # ... | ||
| catalog: | ||
| locations: | ||
| - type: url | ||
| target: https://<repository_url>/example-template.yaml | ||
| rules: | ||
| - allow: [Template] | ||
| # ... | ||
| ---- | ||
| where: | ||
|
|
||
| `catalog.rules.allow`:: To allow new Software Templates to be added to the catalog, you must add a `Template` rule. | ||
pabel-rh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `catalog.locations.type`:: If you are importing templates from a repository, such as GitHub or GitLab, use the `url` type. | ||
| `catalog.locations.target`:: Specify the URL for the template. | ||
|
|
||
| .Verification | ||
|
|
||
| After creating a component with the updated template, verify the provenance annotations in the resulting Catalog Entity YAML. | ||
|
|
||
| . In the {product} navigation menu, go to *Catalog* and locate the newly created catalog component. | ||
| . To view the underlying data that links the entity to the template, select the **INSPECT ENTITY** option. | ||
| . To verify provenance annotations, complete the following steps: | ||
| .. Select the *YAML Raw* or *JSON Raw* view and verify the presence of the data item for the `scaffoldedFrom` link. | ||
| .. Optional: If versioning was included, verify the presence of the `backstage.io/template-version` annotation. | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| If you publish the catalog component to an external repository (such as Git), the component file in that repository must also contain the `backstage.io/template-version` annotation. | ||
| ==== | ||
12 changes: 12 additions & 0 deletions
12
...-and-software-template-version/proc-viewing-software-template-dependencies.adoc
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,12 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="proc-viewing-software-template-dependencies_{context}"] | ||
| = Viewing Software Template dependencies | ||
|
|
||
| As a developer, you can track which entities were created from a specific Software Template. When a platform engineer configures provenance on a template, you can quickly identify the complete dependency and impact map of that template by viewing all linked components and resources in the Catalog. | ||
|
|
||
| .Procedure | ||
| To view all components created from a specific template, complete the following steps: | ||
|
|
||
| . In the {product} navigation menu, click *Catalog*, use the filters to find and select the Software Template you wish to inspect. | ||
| . In the Software Template detail page, click the *Dependencies* tab. This view lists all catalog entities (components, resources, systems, etc.) that reference this template, including any version information if configured. | ||
pabel-rh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
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.