Skip to content

Commit dbbd8e5

Browse files
committed
Addressed review comments
1 parent b49e923 commit dbbd8e5

File tree

2 files changed

+83
-21
lines changed

2 files changed

+83
-21
lines changed

content/contribute/contributing-and-managing-patterns.adoc

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,88 @@ include::modules/comm-attributes.adoc[]
1212
[id="contributing to patterns"]
1313
= Contributing to patterns
1414

15-
To contribute, add the upstream repository as an additional remote and work on a branch other than main. This approach allows you to merge changes into the main branch (reflected in GitOps workflows) and makes upstream contributions easier. Contributions from your forked main branch typically include:
15+
To contribute, add the upstream repository as an additional remote and work on a branch other than the main branch. Merge changes into the main branch to align with GitOps workflows. This approach simplifies upstream contributions. Contributions from your forked main branch typically include:
1616

1717
. Customizations to `values-global.yaml` and other installation-specific files.
1818
. Commits made by Tekton and other automated processes unique to your setup.
1919

20-
To isolate changes for upstream contributions (`hcp` is "Validated Patterns"), you can use a separate remote and branch name:
20+
*To isolate changes for upstream contributions*
2121

22+
. Run the following command to add the upstream repository as a remote:
23+
+
2224
[source,terminal]
2325
----
2426
$ git remote add hcp https://github.com/validatedpatterns/industrial-edge
27+
----
28+
29+
. Fetch branches from all remotes:
30+
+
31+
[source,terminal]
32+
----
2533
$ git fetch --all
34+
----
35+
36+
. Create a branch named `hcp-main` and track `hcp/main`:
37+
+
38+
[source,terminal]
39+
----
2640
$ git branch -b hcp-main -t hcp/main
27-
<make changes on the hcp-main branch>
41+
----
42+
43+
. Make your changes on the `hcp-main` branch as needed.
44+
45+
. Push your changes to your fork’s `hcp-main` branch:
46+
47+
+
48+
[source,terminal]
49+
----
2850
$ git push origin hcp-main
2951
----
3052

31-
To update `hcp-main` branch with upstream changes:
53+
*To update `hcp-main` branch with upstream changes*
54+
55+
. Run the following command to check out the `hcp-main` branch:
3256

57+
+
3358
[source,terminal]
3459
----
3560
$ git checkout hcp-main
36-
$ git pull --rebase
3761
----
3862

39-
To reflect these changes in your forked repository (useful for submitting a PR later):
63+
. Pull the latest changes from the upstream repository and rebase:
64+
+
65+
[source,terminal]
66+
----
67+
$ git pull --rebase
68+
----
4069

70+
. Reflect these changes in your forked repository (useful for submitting a PR later):
71+
+
4172
[source,terminal]
4273
----
4374
$ git push origin hcp-main
4475
----
4576

46-
To integrate upstream pattern changes into your local GitOps process:
77+
*To integrate upstream pattern changes into your local GitOps process*
4778

79+
. Run the following command to check out the main branch:
80+
+
4881
[source,terminal]
4982
----
5083
$ git checkout main
84+
----
85+
86+
. Merge changes from the `hcp-main` branch into your main branch:
87+
+
88+
[source,terminal]
89+
----
5190
$ git merge hcp-main
91+
----
92+
93+
. Push the merged changes to your fork’s main branch:
94+
+
95+
[source,terminal]
96+
----
5297
$ git push origin main
5398
----
5499

@@ -61,7 +106,7 @@ This workflow ensures that the `hcp-main` branch:
61106
[id="changing-subtrees"]
62107
== Changing subtrees
63108

64-
Our patterns use the Git subtree feature to promote modularity, enabling multiple patterns to share the same common base. Over time, we move more functionality into the common directory to isolate pattern-specific components as standard usage practices emerge. This approach strengthens the tools in the common directory, adds features, and simplifies the development of new patterns. Typically, we maintain the common subtree during routine updates, and pulling changes from upstream includes any updates from the common directory.
109+
The Git subtree feature promotes modularity by enabling multiple patterns to share a common base. Over time, functionality is moved into the common directory to isolate pattern-specific components as standard usage practices emerge. This approach strengthens tools in the common directory, adds features, and simplifies the development of new patterns. The common subtree is typically maintained during routine updates, and pulling changes from upstream includes any updates from the common directory.
65110

66111
You only need to modify subtrees if you want to test changes in the common area of the pattern repositories or contribute to the common repository alongside one of the patterns. Using the pattern alone does not require changing subtrees.
67112

@@ -82,7 +127,7 @@ $ git clone https://github.com/<your-workspace>/common
82127

83128
Make changes in your fork’s main branch or create a new branch for your modifications.
84129

85-
To track these changes in your fork of the pattern repository (e.g., `industrial-edge`), replace the common subtree with your forked version. To simplify this process use:
130+
To track these changes in your fork of the pattern repository (example, `industrial-edge`), replace the common subtree with your forked version. To simplify this process use:
86131

87132
[source,terminal]
88133
----
@@ -116,10 +161,10 @@ $ common/scripts/make_common_subtree.sh https://github.com/validatedpatterns/com
116161

117162
These are the default settings for the repository configuration.
118163

119-
[id="subtree-vs-submodule"]
120-
== Subtree vs. Submodule
164+
[id="subtree-compared-to-submodule"]
165+
== Subtree compared to Submodule
121166

122-
Ensuring patterns can be easily shared across multiple projects has always been a priority. While it is technically possible to share changes between unrelated Git repositories, this is a largely manual process prone to errors. We aim to offer a seamless "pull" experience, allowing a single `git pull` action to update shared pattern components. For repository sharing, we considered two main strategies: submodules and subtrees. Initially, we used submodules but later moved to subtrees.
167+
Ensuring patterns are easily shareable across multiple projects has been a key priority. While technically possible, sharing changes between unrelated Git repositories often involves a manual and error-prone process. The goal is to provide a seamless "pull" experience, where a single git pull action updates shared pattern components. For repository sharing, two main strategies were considered: submodules and subtrees. Initially, submodules were used, but the approach later transitioned to subtrees.
123168

124169
Subtrees integrate the history of another repository into a parent repository, offering many benefits of submodules without most of their drawbacks. Atlassian provides useful documentation on subtrees, which explains their advantages in more detail. For more information see, link:https://www.atlassian.com/blog/developer[Developer's blog] and link:https://www.atlassian.com/git/tutorials/git-subtree[Git subtree].
125170

@@ -131,7 +176,7 @@ Submodules presented unavoidable challenges, such as:
131176
* Submodules required mirroring more repositories in disconnected environments.
132177
* Working with forked submodules meant maintaining two separate repositories and multiple branches in each.
133178

134-
Subtrees also have challenges. For example, it is easier to diverge from the upstream version of the subtree, and users may not realize that a subtree is in use when cloning a repository. This can be considered a feature, but may lead to conflicts when updating to a newer version. Additionally, subtrees are less commonly understood, which can result in unexpected issues, such as:
179+
Subtrees also have challenges. For example, it is easier to diverge from the upstream version of the subtree, and users may not realize that a subtree is in use when cloning a repository. This can be considered a feature, but might lead to conflicts when updating to a newer version. Additionally, subtrees are less commonly understood, which can result in unexpected issues, such as:
135180

136181

137182
* Cherry picking from a subtree commit into the parent puts the change in the parent location, not the subtree.

content/learn/workflow.adoc

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,42 @@ Patterns are designed to be composed of multiple components, that consumers and
2222
+
2323
`git clone git@github.com:<your-workspace>/industrial-edge.git`
2424

25-
. Create a local copy of the Helm values file to safely include credentials.
25+
. If you want to customize credentials, create a local copy of the secrets values file. Do not push the secrets file to GitHub.
26+
27+
.. Create a local copy of the secrets template file:
28+
[source,terminal]
2629
+
27-
[NOTE]
28-
====
29-
Do not commit this file as it may contain sensitive credentials.
30-
====
30+
----
31+
$ cp values-secret.yaml.template ~/values-secret.yaml
32+
----
33+
.. Edit the file and securely add your cluster-specific credentials:
3134
+
3235
[source,terminal]
36+
3337
----
34-
$ cp values-secret.yaml.template ~/values-secret.yaml
3538
$ vi ~/values-secret.yaml
36-
----
39+
----
3740

38-
. Customize the deployment for your cluster.
41+
. Customize the deployment for your cluster. Customization involves updating the `values-global.yaml` file with configurations specific to your cluster environment.
42+
.. Edit the `values-global.yaml` file:
3943
+
4044
[source,terminal]
45+
+
4146
----
4247
$ vi values-global.yaml
48+
----
49+
.. Commit the updated `values-global.yaml` file to the repository:
50+
+
51+
[source,terminal]
52+
+
53+
----
4354
$ git commit values-global.yaml
55+
----
56+
.. Push the committed changes:
57+
+
58+
[source,terminal]
59+
60+
----
4461
$ git push
4562
----
4663

0 commit comments

Comments
 (0)