Skip to content

Commit 34d0707

Browse files
feat: update contribution workflow based on guideline generated as comment (#251)
* feat: update contribution workflow based on guideline generated as content * fix: make step 5 shorter to fit inside * fix: remove extraneous line breaks * fix: make the written text match the flowchart * fix: further clarify steps * fix: typo * fix: note that generated guideline content regenerates if body updated * Clarifying timing Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: update section heading to sound better Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: update the table of contents entry to fit section header * fix: update voicing to be consistent Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: update casing consistency Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: update casing consistency Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: tense Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: clarify how to find .rst file in which to place guideline * fix: resolve odd formatting * Clarify wording Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * Clarify wording Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * Deleting unneeded bit Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * Removing bit not needed anymore Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: try GitHub's syntax for notes * chore: update to fit new fashion of adding individual guideline source files * docs: note that you need to include the newly added file to chapter index.rst * fix: links in table of contents Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: links in table of contents Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: clarify wording of how issues should become PRs Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: clean up run-on sentence Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: clarify which sections of comment to reference * fix: clarify flow for duplicative rules Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> * fix: simplify by breaking into two sentences Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com> --------- Co-authored-by: Félix Fischer <felix91gr@users.noreply.github.com>
1 parent 341529c commit 34d0707

File tree

1 file changed

+91
-29
lines changed

1 file changed

+91
-29
lines changed

CONTRIBUTING.md

Lines changed: 91 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
- [Table of Contents](#table-of-contents)
77
- [Contribution Workflow](#contribution-workflow)
88
- [Note on Chapter Layout](#note-on-chapter-layout)
9-
- [0) Bring up the idea for discussion](#0-bring-up-the-idea-for-discussion)
9+
- [0) Bring up the idea for discussion](#0-optional-bring-the-idea-up-for-discussion)
1010
- [1) Submit coding guideline issue](#1-submit-coding-guideline-issue)
1111
- [1.1) Finding the FLS ID](#11-finding-the-fls-id)
12-
- [2) Create a Draft with a Member](#2-create-a-draft-with-a-member)
13-
- [3) A Pull Request is generated](#3-a-pull-request-is-generated)
14-
- [4) Iterate on Feedback](#4-iterate-on-feedback)
15-
- [4.1) Apply changes to the Guideline's Issue](#41-apply-changes-to-the-guidelines-issue)
16-
- [4.2) Re-generate the Pull Request](#42-re-generate-the-pull-request)
17-
- [5) Your Guideline gets merged](#5-your-guideline-gets-merged)
12+
- [2) Guideline Generated as a Comment](#2-guideline-generated-as-a-comment)
13+
- [3) Create a Draft with a Member](#3-create-a-draft-with-a-member)
14+
- [4) Create the PR](#4-create-the-pr)
15+
- [5) Iterate on Feedback](#5-iterate-on-feedback)
16+
- [5.1) Member Begins Review](#51-member-begins-review)
17+
- [5.2) Update the PR Based on Feedback](#52-update-the-pr-based-on-feedback)
18+
- [6) Contributor Applies Feedback on Issue](#6-contributor-applies-feedback-on-issue)
19+
- [7) Contributor Applies Regenerated Guideline to PR](#7-contributor-applies-regenerated-guideline-to-pr)
20+
- [8) Your Guideline gets merged](#8-your-guideline-gets-merged)
1821
- [You just contributed a coding guideline!](#you-just-contributed-a-coding-guideline)
1922
- [Writing a guideline locally (less typical, not recommended)](#writing-a-guideline-locally-less-typical-not-recommended)
2023
- [Guideline template](#guideline-template)
@@ -35,19 +38,21 @@ flowchart TD
3538
Zulip --> CreateIssue{{"1: Contributor creates <br> issue"}}
3639
CreateIssue --> Issue["Coding Guideline Issue"]
3740
38-
%% short local loops (no long edges)
39-
S2{{"2: Review started <br> by subcommittee <br> member in <= 14 days <br><br> Contributor updates accordingly"}} --> Issue
41+
S2{{"2: reStructuredText <br> generated as comment <br> on issue"}} --> Issue
4042
Issue --> S2
4143
42-
Issue --> S3{{"3: Subcommitte member <br> assigns label<br>to generate PR"}} --> PR["Coding Guideline<br>Pull Request"]
44+
S3{{"3: Review started by subcommittee member in <= 14 days <br><br> Contributor updates accordingly"}} --> Issue
45+
Issue --> S3
4346
44-
S4{{"4: PR review started <br> by subcommittee member <br> in <= 14 days <br><br> Contributor discusses on PR"}} --> PR
45-
PR --> S4
47+
Issue --> S4{{"4: Contributor creates a PR using the reStructuredText generated for them on issue"}} --> PR["Coding Guideline<br>Pull Request"]
4648
47-
PR --> S5{{"5: Contributor applies <br> feedback to issue"}} --> Issue
48-
Issue --> S6{{"6: Subcommittee member <br> confirms changes;<br> regenerates PR"}} --> PR
49-
PR --> S7{{"7: Subcommittee member <br> approves & queues;<br>merges to main"}} --> Main[[main]]
50-
Main --> End(["8: End"])
49+
S5{{"5: <br> 5.1 PR review started by subcommittee member in <= 14 days <br><br> 5.2 Contributor discusses on PR with members and updates"}} --> PR
50+
PR --> S5
51+
52+
PR --> S6{{"(Optional) <br> 6: Contributor applies feedback to issue"}} --> Issue
53+
Issue --> S7{{"(Optional)<br> 7: Contributor applies updated reStructuredText to Pull request"}} --> PR
54+
PR --> S8{{"8: Subcommittee member <br> approves & queues;<br>merges to main"}} --> Main[[main]]
55+
Main --> End(["9: End"])
5156
```
5257

5358
### Note on Chapter Layout
@@ -75,29 +80,88 @@ Note that the FLS ID should be filled according to the FLS paragraph ID for whic
7580

7681
You would then pull `fls_4rhjpdu4zfqj` to place in the FLS ID field.
7782

78-
### 2) Create a Draft with a Member
7983

80-
A member of the Coding Guidelines Subcommittee should get you a first review with some feedback within 14 days of submission. You'll work with one or more members to flesh out the concept and ensure the guideline is well prepared.
84+
### 2) Guideline Generated as a Comment
85+
86+
A GitHub Action will fire, adding a comment to your newly created issue with
87+
the contents of the coding guideline prepared written out correctly
88+
in reStructuredText.
89+
90+
Note that if you later update the body of the coding guideline issue this will
91+
fire the GitHub Action again and update the original comment with the new
92+
contents converted to reStructuredText.
93+
94+
### 3) Create a Draft with a Member
95+
96+
Within 14 days of your submission, a member of the Coding Guidelines Subcommittee should give you a first review. You'll work with them (and other members) to flesh out the concept and ensure the guideline is well prepared for a Pull Request.
97+
98+
### 4) Create the PR
99+
100+
> [!NOTE]
101+
> Here's a list of recommended prerequisites that shall be fulfilled before turning an issue into a PR:
102+
>
103+
> * The new rule isn't already covered by another rule
104+
> * OR, in case there is(are) already another rule(s),
105+
> * The existing rule(s) need(s) to be linked to the new rule,
106+
> * AND the new rule needs to link to the existing rule(s).
107+
> * All sections contain some content
108+
> * Content written may be *incomplete*, but must not be *incorrect*
109+
> * `🧪 Code Example Test Results` section shows all example code compiles
110+
111+
As soon as these prerequisites are fulfilled, the draft shall be marked as PR-ready by a subcommittee member, by labeling the issue with `sign-off: create pr`. This denotes that you should create a Pull Request with your Guideline. Further discussion about the amount and correctness of its content shall then be done on the Pull Request itself.
112+
113+
The contents of the PR should be based on the bot comment containing the generated RST form of your guideline, as seen in [Step 2](#2-guideline-generated-as-a-comment). The comment has the exact file content you'll need.
114+
115+
In order to ensure your guideline appears when rendering the document, reference the generated comment from [Step 2](#2-guideline-generated-as-a-comment). All the steps necessary should appear below the headings `📁 Target Location` and `🗂️ Update Chapter Index`.
81116

82-
### 3) A Pull Request is generated
117+
Make sure to include this command in the body of your PR, where `xyz` is the number of the issue you opened in [Step 1](#1-submit-coding-guideline-issue):
83118

84-
Once an issue has been well-developed enough, a subcommittee member will mark the issue with the label `sign-off: create pr from issue` to generate a pull request. You will see a GitHub Workflow trigger and a pull request will be automatically created.
119+
> `closes #xyz`
85120
86-
### 4) Iterate on Feedback
121+
This will ensure issue `#xyz` is closed when your Pull Request gets merged.
122+
123+
124+
### 5) Iterate on Feedback
125+
126+
#### 5.1) Member Begins Review
87127

88128
The generated Pull Request may attract additional feedback or simply be an easier place to suggest targeted edits.
89129

90130
As the contributor of the coding guideline and opener of the issue, you'll respond to comments, discuss, all the normal things on the pull request.
91131

92-
#### 4.1) Apply changes to the Guideline's Issue
132+
#### 5.2) Update the PR Based on Feedback
133+
134+
If you agree with the suggested changes, you've got two options:
135+
136+
- Iterate directly on the Pull Request, if you're comfortable with reStructuredText to do so
137+
- If you'd rather make revisions in Markdown, you can return to the issue
138+
from [1) Submit coding guideline issue](#1-submit-coding-guideline-issue)
139+
to regenerate the reStructured Text guideline form by following steps
140+
outlined in
141+
[6) Contributor Applies Feedback on Issue](#6-contributor-applies-feedback-on-issue)
142+
and
143+
[7) Contributor Applies Regenerated Guideline to PR](#7-contributor-applies-regenerated-guideline-to-pr)
93144

94-
If you agree with the suggested changes, then rather than making changes on the opened pull request, you will return to the original issue you opened via the coding guideline issue template, and make the updates there.
145+
### 6) Contributor Applies Feedback on Issue
95146

96-
#### 4.2) Re-generate the Pull Request
147+
(Optional, if not comfortable with reStructured Text from
148+
[5.2) Update the PR Based on Feedback](#52-update-the-pr-based-on-feedback))
97149

98-
When you have completed all feedback given to you, ping one of the subcommittee members. They will then remove and affix the label `sign-off: create pr from issue` to push the changes made in the issue to the already opened pull request.
150+
The contributor edits the body of the issue summary, reflecting suggestions and then saves it.
151+
You will then momentarily see a new comment added to the issue containing the updated
152+
guideline content written in reStructured Text.
99153

100-
### 5) Your Guideline gets merged
154+
### 7) Contributor Applies Regenerated Guideline to PR
155+
156+
(Optional, if not comfortable with reStructured Text from
157+
[5.2) Update the PR Based on Feedback](#52-update-the-pr-based-on-feedback))
158+
159+
The contributor then copy + pastes the contents of the guideline from
160+
[6) Contributor Applies Feedback on Issue](#6-contributor-applies-feedback-on-issue)
161+
and overwrites the contents of their feature branch, so that the feedback is
162+
reflected into the Pull Request.
163+
164+
### 8) Your Guideline gets merged
101165

102166
Once the coding guideline contents have passed review, a subcommittee member will approve the pull request, and put it on the merge queue to be merged.
103167

@@ -108,9 +172,7 @@ That's it!
108172

109173
## Writing a guideline locally (less typical, not recommended)
110174

111-
While it is possible to create guidelines locally and open pull requests yourself, we encourage contributors to make use of the process described above since it handled some of the fiddly details for you as a guideline writer.
112-
113-
Generally speaking, pull requests for guidelines which do not follow the issue to pull request workflow described above will be closed with a recommendation to follow the workflow.
175+
While it is possible to create guidelines locally, we encourage contributors to make use of the process described above since it handles some of the fiddly details for you as a guideline writer.
114176

115177
### Guideline template
116178

0 commit comments

Comments
 (0)