Debian Codegraph @

ansible_collections/dellemc/powerflex/.github/Contributers_guide.md

raw symbols SCIP
1 **Open Source Contributor's guide**
2
3 # **Contributors**
4 Contributors are individuals willing to contribute to an open source project in GitHub in order to learn, teach, and gain experience. Contributors have the ability to:
5
6 Create issues
7
8 Create new feature requests
9
10 Contribute to fixing issues via pull request
11
12 Helping triage issues - although changing labels will be restricted, contributors can help identify duplicates and provide upvotes on issues Contributors must fork the repository and create a branch from main, which will contain code changes related to an issue.
13
14 # Branching
15 Repositories will use a scaled trunk branching strategy (short-lived branches) in combination with feature flags to allow frequent changes to the main branch without breaking the build with partial features.
16
17 Short-lived branches will be created for parts of a feature or a feature in its entirety (depending on the size of the feature)
18
19 The main branch is always releasable, meaning code being pushed to main is fully tested and reviewed to ensure it works and does not create and regressions
20
21 Maintainers can create branches directly off the main branch Contributors must fork the repository and create a branch from main
22
23
24
25
26
27 # Branch Naming
28
29
30 |**Branch Type**|**Example**|**Comment**|
31 | :- | :- | :- |
32 |main|main||
33 |Release|release-1.0|hotfix: release-1.1 patch: release-1.0.1|
34 |Feature|feature-9-olp-support|"9" referring to GitHub issue ID|
35 |Bug Fix|bugfix-110-remove-docker-compose|"110" referring to GitHub issue ID|
36 ## **Release Branches**
37 A release branch is a branch created from main that will be solely used to release a new version. A release branch follows these rules: Maintainers are the only ones that can create a release branch
38
39 The branch is named according to the branch naming conventions listed above
40
41 No changes are made directly on the feature branch. If there any critical defects, those commits can be cherry-picked from the main branch into the release branch
42
43 Only critical bug fixes will be merged into this branch Release branches are never deleted
44
45 Release branches are created 10 days prior to a release to allow time for longevity testing to be executed
46
47 A release can contain features and/or partial features from future release that will be labelled as "experimental features". Features designated for future releases are continually be worked on while also being merged into the main branch. These features will be optionally enabled during deployment using feature flags, if the user chooses to use them. This gives users early expose to features so they can use and test them providing valuable feedback.
48 ##
49 ## **Bug Fix Branches**
50 A bug fix branch is a branch which is created for the purpose of fixing a GitHub bug issue.
51
52 Maintainers can create bug fix branches from the main branch
53
54 Contributors can create bug fix branches after they have forked the repository
55
56 Bug fix branches are merged directly into the main branch once a pull request has been approved Bug fix branches are deleted once they have been merged to the main branch
57
58 ## **Feature Branches**
59 A feature branch is created for code changes related to a feature. This can either be dedicated for a full feature, if it is small, or for part of a feature. The goal is deliver feature value incrementally into the main branch so short lived branches delivering partial working feature functionality is the preference.
60
61 Maintainers can create feature branches from the main branch
62
63 Feature branches are merged directly into main once a pull request has been reviewed Feature branches are deleted once they have been merged to the main branch
64
65 ## **The Main Branch**
66 The main branch is where bug fixes and continuous feature value is being delivered. The main branch is ALWAYS releasable, meaning code being pushed to the main branch is fully tested and reviewed to ensure it works and does not create and regressions. When changes are merged into the main branch, a new "main" image will be created and pushed to Docker Hub. This provides continuous access to the latest and greatest features and fixes being worked on so users can use them and provide valuable feedback.
67
68 If a feature or partial feature branch is being merged to main, it must contain documentation updates with any new feature flags that have added or other feature flags that have been changed. The providers the user with information on how to enable/disable an experimental feature.
69
70
71
72
73 |**Feature Stage**|**Description**|
74 | :- | :- |
75 |Alpha|<p></p><p>Disabled by default</p><p>May contain only parts of a feature</p><p>Potentially buggy where enabling the feature may expose bugs Support for the feature may be dropped at any time without notice</p>|
76 |Beta|<p></p><p>Enabled by default</p><p>The entire feature has been implemented</p><p>The feature is well tested where enabling the feature is considered safe Support for the feature will not be dropped</p>|
77 |GA|<p></p><p>The feature is always enabled and it cannot be disabled via a feature flag The feature flag has been removed</p><p>Considered stable and will appear in many subsequent versions</p>|
78 |Deprecated|<p></p><p>Indicates the feature will be deprecated as of a certain version</p><p>When the specific version where it is to be deprecated is released, the feature is disabled and cannot be enabled</p>|
79
80 # Example Scenarios
81 ### **New Partial Feature Branch Merged to Main**
82 Lets consider a case where we are working on a partial feature branch for new feature after 1.0.0 has been released.
83
84 The branch contains a fully functional and tested part of the feature that is enabled/disabled by a new feature flag The branch contains an update to the feature flag documentation that has an entry for the feature flag
85
86 The feature flag is initially set with the Alpha stage
87
88 The first branch merged to the main branch for a particular feature must also contain a change to the feature flags document with the following set of information. In the example below we see a new feature flag in alpha stage that is disabled by default. The "Since" value represents the version that the feature (flag) was originally released in. If the feature (flag) has not been released yet, but is available in the main branch, we can use something like "N
89
90 /A" as a value.
91
92
93 |**Feature**|**Default**|**Stage**|**Since**|**Until**|
94 | :-: | :- | :- | :- | :- |
95 |new-feature|false|Alpha|N/A||
96
97 ### **New Release with Partial Feature Destined for Future Release**
98 Lets consider a case where a release branch is created for a 1.1.0 release. Given the previous example, the release branch will contain the partially developed "new-feature" which is disabled by default. In this case, the feature flag document would be updated to reflect the correct version that "new- feature" became available. If we know the release plan for "new-feature" going forward, we can also provide those details so users are aware. The example below illustrates the release plan for "new-feature" moving from Alpha to GA.
99
100
101 |**Feature**|**Default**|**Stage**|**Since**|**Until**|
102 | :-: | :- | :- | :- | :- |
103 |new-feature|false|Alpha|1.1.0|1.1.0|
104 |new-feature|true|Beta|1.2.0|1.3.0|
105 |new-feature|true|GA|1.4.0||
106
107 When a feature (flag) reaches the GA stage, all entries of the feature flag in the document must be removed. The feature becomes baked into the product at that point and is always enabled.
108
109 ### **Deprecating a Feature (Flag)**
110 Lets consider a case where a feature (flag) currently in the Beta stage needs to be deprecated. We would announce that as part of the feature flag documentation. Given that the current release is 1.2.0 and "new-feature" is enabled by default, we want to indicate that "new-feature" will become deprecated in version 1.4.0. The follow examples shows how this is done.
111
112
113 |**Feature**|**Default**|**Stage**|**Since**|**Until**|
114 | :- | :- | :- | :- | :- |
115
116
117 |new-feature|true|Beta|1.2.0|1.3.0|
118 | :- | :- | :- | :- | :- |
119 |new-feature||Deprecated|1.4.0||
120
121 This tells the user that the future release 1.4.0 will no longer contain "new-feature".
122
123
124 # **Pull Requests**
125 Once development on a branch is complete, a pull request is created in accordance with the contributing guide found in the appropriate GitHub repository. A pull request must always link to at least one GitHub issue. If that is not the case, create a GitHub issue and link it.
126
127 To increase the chance of having your pull request accepted, make sure your pull request follows these guidelines:
128
129 Title and description matches the implementation.
130
131 Commits within the pull request follow the formatting guidelines provided in the contributing guide
132
133 The pull request can close but may not always close a linked issue - partial feature request pull requests should not close a GitHub feature issue The pull request contains necessary tests that verify the intended behavior
134
135 Your branch must be up to date with the main branch before merging If the pull request fixes a bug:
136
137 The pull request description must include Fixes #<issue number>.
138
139 To avoid regressions, the pull request should include tests that replicate the fixed bug.
140
141 When a pull request is merged, all commits are squashed into a single one. It is encouraged to write informative commit messages, as they becomes a part of the Git commit body.
142
143 The following pull request template is currently being used and should be used for other open source projects
144
145
146 ## **GitHub Actions**
147 The following GitHub Actions are used to enforce quality gates when a pull request is created or when any commit is made to the pull request. These GitHub Actions enforce our minimum code quality requirements for any code that gets checked into. If any of the checks fail, it is expected that the contributor will look into the check log, understand the problem and resolve the issue. The maintainer is also responsible for reaching out to contributors when failed checks are noticed in order to help resolve them.
148
149 ### GitHub Repositories
150 The following GitHub actions are being used to enforce quality gates on GitHub repositories. No branch can be merged unless the following checks pass.
151
152
153 |**GitHub Action**|**Description**|
154 | :- | :- |
155 |Ansible Sanity tests|Inspects Ansible Sanity|
156 |[Malware](https://github.com/dell/common-github-actions/tree/main/malware-scanner) [Scanner](https://github.com/dell/common-github-actions/tree/main/malware-scanner)|Inspects source code for malwares|
157 |[Code](https://github.com/dell/common-github-actions/tree/main/code-sanitizer) [Sanitization](https://github.com/dell/common-github-actions/tree/main/code-sanitizer)|Analyzes source code for forbidden words and text. Forbidden words include such as non-inclusive language|
158 |[Test Coverage](https://github.com/dell/common-github-actions/tree/main/go-code-tester)|Runs ansible unit tests and check that code coverage per package meets a configured threshold (90%). Flags error if given pull request do not meet the test coverage threshold and blocks the merge of the pull request.|
159 |E2E tests|Captures the results of the maintainer triggered E2E tests executed against the pull request. The check will fail if the tests do not pass.|
160
161
162
163
164 **Ansible Code of Conduct:**
165
166 Every community can be strengthened by a diverse variety of viewpoints, insights, opinions, skillsets, and skill levels. However, with diversity comes the potential for disagreement and miscommunication. The purpose of this Code of Conduct is to ensure that disagreements and differences of opinion are conducted respectfully and on their own merits, without personal attacks or other behavior that might create an unsafe or unwelcoming environment.
167 For more details [Ansible Code of conduct](https://docs.ansible.com/ansible/latest/community/code\_of\_conduct.html) can be reffered.