Project

General

Profile

Development process » History » Version 9

Peter Amstutz, 06/27/2023 03:47 PM

1 1 Peter Amstutz
h1. Summary of Development Process
2
3
{{toc}}
4
5 8 Tom Clegg
h1. Issue descriptions
6
7
Consider starting with this outline (omitting empty/obvious sections):
8
* Background / context
9
* Current behavior
10
* Desired improvements
11
* Proposed implementation
12
* Exclusions / clarifications
13
* Open questions
14
15 1 Peter Amstutz
h1. Revision control
16
17
h2. Branches
18
19
* All development should be done in a branch.  The only exception to this should be trivial bug fixes.  What is trivial enough to not need review is the judgement of the developer, but when in doubt, ask for a review.
20
* Each story should be done in its own branch.
21
* Branch names are "####-story-summary" where #### is the redmine issue number followed by 3 or 4 words that summarize the story.
22
* Make your local branches track the main repository (@git push -u@)
23 9 Peter Amstutz
* Commit regularly, and push your branch to @git.arvados.org@ at the end of each day 
24
** Be paranoid, commits are cheap, pushing your commits to the remote repository is cheap, losing work is expensive
25 1 Peter Amstutz
* Don't push uninvited changes to other developer's branches.
26
** To contribute to another developer's branch, check with them first, or create your own branch ("####-story-summary-ABC" where ABC are your initials) and ask the other developer to merge your branch.
27
28
h3. Merging
29
30 6 Ward Vandewege
Branches should not be merged to main until they are ready (see [[Summary of Development Process#Ready to merge|Ready to merge]] below).
31 1 Peter Amstutz
32
# @git remote -v@
33 6 Ward Vandewege
** Make sure your @origin@ is git.arvados.org, not github. *Don't push directly to the github main* branch -- let git.arvados.org decide whether it's OK to push to github.
34
# @git checkout main@
35 1 Peter Amstutz
# @git pull --ff-only@
36 6 Ward Vandewege
#* This ensures your main is up to date. Otherwise "git push" below might fail, and you'll be backtracking.
37 1 Peter Amstutz
# @git merge --no-ff branchname@
38
#* *The @--no-ff@ part is important!* It ensures there is actually a commit representing this merge. This is your opportunity to record the name of your branch being merged, and the relevant story number. Without it, the git history looks like we all just mysteriously started developing at the tip of your (now unnamed) feature branch.
39
#* In your merge commit message, *include the relevant story/issue number* (either "@refs #1234@" or "@closes #1234@").
40 4 Nico César
#* In your merge commit message, *include Arvados-DCO-1.1-Signed-off-by line* (i.e. Arvados-DCO-1.1-Signed-off-by: Jane Doe <jane@example.com>)
41 1 Peter Amstutz
# @git push@
42 3 Peter Amstutz
# Look for Jenkins' build results at https://ci.arvados.org .
43 1 Peter Amstutz
44
h3. Rejected pushes
45
46 6 Ward Vandewege
We have a git hook in place that will reject pushes that do not follow these guidelines.  The goal of these policies is to ensure a clean linear history of changes to main with consistent cross referencing with issue numbers.  These policies apply to the commits listed on "git rev-list --first-parent" when pushing to main, and not to commits on any other branches.
47 1 Peter Amstutz
48
If you try to push a (set of) commit(s) that does not pass mustard, you will get a [POLICY] reject message on stdout, which will also list the offending commit. You can use
49
50
  git commit --amend
51
52
to update the commit message on your last commit, if that is the offending one, or else you can use 
53
54
  git rebase --interactive
55
56
to rebase and fix up a commit message on an earlier commit.
57
58 6 Ward Vandewege
h4. All merge commits to main must be from a feature branch into main
59 1 Peter Amstutz
60 6 Ward Vandewege
Merges that go the other way (from main to a feature branch) that get pushed to main as a result of a fast-forward push will be rejected.  In other words:  when merging to main, make sure to use --no-ff.
61 1 Peter Amstutz
62 6 Ward Vandewege
h4. Merges between local and remote main branches will be rejected
63 1 Peter Amstutz
64 6 Ward Vandewege
Merges between local and remote main branches (generally merges created by "git pull") will be rejected, in order to maintain a linear main history.  If this happens, you'll need to reset main to the remote head and then remerge or rebase.
65 1 Peter Amstutz
66
h4. Proper merge message format
67
68 6 Ward Vandewege
All merge commits to main must include the text "Merge branch 'featurebranch'" or they will be rejected.
69 1 Peter Amstutz
70 6 Ward Vandewege
h4. All commits to main include an issue number or explicitly say no issue #
71 1 Peter Amstutz
72 6 Ward Vandewege
All commits to main (both merges and single parent commits) must
73 1 Peter Amstutz
include the text "refs #", "closes #" or "no issue #" or they will be
74
rejected.
75
76
h4. Avoid broken commit messages
77
78
Your commit message matches
79
80
  /Please enter a commit message to explain why this merge is necessary/
81
82
h2. Commit logs
83
84 5 Ward Vandewege
See https://dev.arvados.org/projects/arvados/wiki/Coding_Standards
85 1 Peter Amstutz
86
h2. Code review process
87
88
Code review has high priority! Branches shouldn't sit around for days waiting for review/merge.
89
90
When your branch is ready for review:
91
# Create/update a review task on the story so it looks like this:
92
#* subject = "review {branch name}"
93
#* state = in progress
94
#* assignee is not null
95
# Ping your reviewer (during daily standup, via e-mail and/or via chat).
96
97
Doing a review:
98
# We will discuss/assign the review requests at daily stand-up.
99
# When you start the review, assign the review task to yourself and move the review task to "in progress" to make sure other people don't duplicate your effort.
100 6 Ward Vandewege
# The recommended process for reviewing diffs for a branch is @git diff main...branchname@.  The reviewer must make sure that their repository is up to date (or use @git diff origin/main...origin/branchname@). Note the 3 dots (not two)
101 7 Tom Clegg
# After doing a review, write up comments ("fix these problems" or "ready to merge") to the story page, make a note of the git commit revision that was reviewed, assign the review task back to the original developer, and notify the original developer on gitter (or by some other means).
102
#* In comments, preface each point with "low:", "medium:", or "high:"
103
#* low: nitpick not necessarily worth changing here if you don't feel like it, but I'm mentioning it to help improve habits
104
#* medium: suggestion/idea that you should at least acknowledge/respond to, even if we don't end up resolving it here
105
#* high: we should make sure we both agree on how this is resolved before merging
106 1 Peter Amstutz
# The original developer should address any outstanding problems/comments in the code, then write a brief response indicating which points were dealt with or intentionally rejected/not addressed.
107
# If the response involves more commits, do that, then goto "branch is ready for review". This process iterates until the branch is deemed ready to merge.
108
# Once the branch is merged, move the "review" task to "resolved".
109
110
To list unmerged branches:
111 6 Ward Vandewege
* Yours: @git branch --no-merged main@
112
* Everyone: @git branch -a --no-merged main@
113 1 Peter Amstutz
114
h2. Ready to merge
115
116
When merging, both the developer and the reviewer should be convinced that:
117 6 Ward Vandewege
* Current/recent main is merged. (Otherwise, you can't predict what merge will do.)
118 1 Peter Amstutz
* The branch is pushed to git.arvados.org
119
* The code is suitably robust.
120
* The code is suitably readable.
121
* The code is suitably scalable. For example, client code is not allowed to print or sort unbounded lists. If the code handles a list of items, consider what happens when the list is 10x as large as you expect. What about 100x? A million times?
122
* The code accomplishes what the story specified. If not, explain why (e.g., the branch is only part of the story, a better solution was found, etc.) in the issue comments
123
* New API names (methods, attributes, error codes) and behaviors are well chosen. It sucks to change them later, and have to choose between compatibility and greatness.
124
* Tests that used to pass still pass. (Be extremely careful when altering old tests to make them pass. Do not change existing tests to test new code. Add assertions and write new tests. If you change or remove an existing test, you are breaking behavior that someone already decided was worth testing!)
125
* Recent clients/SDKs work against the new API server. (Things rarely turn out well when we rely on all clients being updated at once in lockstep with the API server. Our test suite doesn't check this for us yet, so for now we have to pay attention.)
126
* New/fixed behavior is tested. (Although sometimes we decide not to block on inadequate testing infrastructure... that sucks!)
127
* New/changed behavior is documented. Search the doc site for relevant keywords to help you find the right sections.
128
* Whitespace errors are not committed. (Tab characters, spaces at EOL, etc.)
129
* Git commit messages are descriptive (see [[arvados:Coding Standards]]). If they aren't, this is your last chance to rebase/reword.
130
131
h2. Handling pull requests from github
132
133
_This is only for contributions by *external contributors*, i.e., people who don't have permission to write directly to arvados.org repositories._
134
135 6 Ward Vandewege
First make sure your main is up to date.
136 1 Peter Amstutz
137 6 Ward Vandewege
    git checkout main; git pull --ff-only
138 1 Peter Amstutz
139
*Option 1:* On the pull request page on github, click the "You can also merge branches on the command line" link to get instructions.
140
141
* Don't forget to run tests.
142
143
*Option 2:* (a bit shorter)
144
145 6 Ward Vandewege
Say we have "chapmanb  wants to merge 1 commit into arvados:main from chapmanb:branchname"
146 1 Peter Amstutz
* @git fetch https://github.com/chapmanb/arvados.git branchname:chapmanb-branchname@
147
* @git merge --no-ff chapmanb-branchname@
148
* Use the commit message: @Merge branch 'branchname' from github.com/chapmanb. No issue #@
149
(or @refs #1234@ if there is an issue#)
150 6 Ward Vandewege
* Confirm diff: @git diff origin/main main@
151 1 Peter Amstutz
* Run tests
152
* @git push@
153
154
h1. Non-fast-forward push
155
156
Please don't get into a situation where this is needed.
157
158 6 Ward Vandewege
# On dev box: @git push -f git@github.com:arvados/arvados proper_head_commit:main proper_head_commit:staging@
159
# On dev box: @git push -f git@git.arvados.org:arvados.git proper_head_commit:main@
160
# As gitsync@dev.arvados.org: @cd /scm/arvados; git fetch origin; git checkout main; git reset --hard origin/main@
161 1 Peter Amstutz
162
(At least that's what TC did on 2016-03-10. We'll see how it goes.)
163
164
h1. Working with external upstream projects
165
166
Development process summary (1-6 should follow the guidelines above)
167
168
# Each feature is developed in a git branch named @<issue_number>-<summary>@, for example @12521-web-app-config@
169
# Each feature has a "Review" task.  You can see the features and review tasks on the task board.
170
# When the feature branch is ready for review, update the title of the Review task to say "Review <branchname>" and move it from the *New* column the to *In Progress* column
171
# The reviewer responds on the issue page with questions or comments
172
# When the branch is ready to merge, the reviewer will add a comment "Looks Good To Me" (LGTM) on the issue page
173
# Merge the feature into into the Arvados main branch
174
# Push the feature branch to github and make a pull request (PR) of the branch against the external project upstream
175
# Handle code review comments/change requests from the external project team
176 6 Ward Vandewege
# Once the external project merges the PR, merge external project upstream main back into the feature branch
177 1 Peter Amstutz
# Determine if external project upstream brings any unrelated changes that breaks things for us
178
# If necessary, make fixes, make a new PR, repeat until stable
179 6 Ward Vandewege
# Merge the feature branch (now up-to-date with external project upstream) into Arvados main
180 1 Peter Amstutz
181
This process is intended to let us work independently of how quickly the external project team merges our PRs, while still maximizing the chance that they will be able to accept our PRs by limiting the scope to one feature at a time.
182
183 6 Ward Vandewege
This assumes using git merge commits and avoiding rebases, so we can easily perform merges back and forth between the three branches (Arvados main, feature, external project main).
184 1 Peter Amstutz
185
186
h1. Scrum
187
188
h2. References
189
190
These books give us a reference point and vocabulary. 
191
192
* _Essential Scrum: A Practical Guide to the Most Popular Agile Process_ by Kenneth Rubin
193
* _User Stories Applied: For Agile Software Development_ by Mike Cohen
194
195
h2. Roles
196
197
198
h3. Product Owner
199
200
* Decide what goes on the backlog
201
* Decide backlog priorities
202
* Work with stakeholders to understand their requirements and priorities
203
* Encode stakeholder requirements/expectations as user stories
204
* Lead sprint planning meetings 
205
* Lead release planning meetings 
206
* Lead product planning meetings 
207
* Lead Sprint Kick-off Meetings
208
* Lead Sprint Review Meetings
209
* Decide on overall release schedule 
210
211
h3. Scrum Master
212
213
* Lead Daily Scrum Meeting
214
* Help to eliminate road blocks 
215
* Lead Sprint Retrospective Meetings
216
* Organize Sprint Schedule 
217
* Help team organize and stay on track with Scrum process
218
* Teach new engineers how Scrum works
219
220
h3. Top stakeholders
221
222
* Conduct market research 
223
* Synthesize market research into user stories 
224
* Work with Product Owner to prioritize stories
225
* Define overall business goals for product 
226
* Work with Product Owner to define overall release cycle 
227
* Organize User Input and dialog with users for engineering team 
228
* Contribute to backlog grooming 
229
* Bring voice of customer into planning process 
230
* Define user personas 
231
* Coordinate user communication 
232
* Develop technical marketing and sales materials 
233
* Assist sales team in presenting product value proposition
234
* Train sales in technical aspects of the product
235
236
h2. Definition of Done
237
238
An issue is resolved when:
239
240
* Code is written
241
* Existing code is refactored if appropriate
242
* Documentation is written/updated
243
* Acceptance tests are satisfied
244 6 Ward Vandewege
* Code is merged in main
245 1 Peter Amstutz
* All Jenkins jobs pass (test, build packages, deploy to dev clusters)
246
* Feature works on applicable dev clusters
247
248
h2. Standard Schedule
249
250
Sprints are two weeks long. They start and end on Wednesdays.
251
252
h3. Key meetings
253
254 2 Peter Amstutz
Every day:
255 1 Peter Amstutz
256
Daily Scrum (15 Minutes)
257
Who: Development team, product owner. Silent observers welcome.
258
* What did you do yesterday?
259
* What will you do today?
260
* What obstacles are in your way?
261
262
h4. Sprint review & kickoff (every 2 weeks on Wednesday):
263
264
Sprint Review (30 minutes)
265
Who: Development team, product owner, stakeholders.
266
* Demo of each feature built and relationship to stories
267
* Product owner explains which backlog items are done
268
* Development team demonstrates the work done, and answers questions about the sprint increment
269
* Product owner discusses the backlog as it stands. Revise expected completion dates based on recent progress (if needed)
270
* Review current product status in context of business goals
271
272
Sprint Retrospective (30 minutes)
273
Who: Development team, product owner.
274
* Review what processes worked well, and what didn't, in the sprint just finished
275
* Propose and agree to changes to improve future sprints
276
* Assign action items (meetings/tasks) to implement agreed-upon process improvements
277
278
Sprint Kick Off (1 hour)
279
Who: Development team, product owner.
280
* Add latest bugs or dependencies to sprint
281
* Create tasks for each story
282
* Assign a developer to each task
283
* Assign an on-call engineer for that sprint who will triage customer support requests
284
* Check that commitment level is realistic
285
286
h4. Planning (alternate Wednesdays mid-sprint)
287
288 2 Peter Amstutz
Roadmap review (1 hour)
289 1 Peter Amstutz
Who: Development team, product owner, stakeholders.
290 2 Peter Amstutz
* Report high level status of epics
291
* Prioritize epics
292
* Define new epics
293 1 Peter Amstutz
294 2 Peter Amstutz
Sprint Planning (1-2 hours)
295 1 Peter Amstutz
Who: Development team, product owner.
296 2 Peter Amstutz
* Discuss and get engineering team consensus on feature design & implementation strategy for tasks on current and upcoming epics