Project

General

Profile

Development process » History » Version 2

Peter Amstutz, 05/28/2020 03:08 PM

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