Project

General

Profile

Development process » History » Version 22

Peter Amstutz, 03/04/2024 09:40 PM

1 1 Peter Amstutz
h1. Summary of Development Process
2
3
{{toc}}
4
5 22 Peter Amstutz
h1. Filing bugs and task scheduling
6 1 Peter Amstutz
7 20 Peter Amstutz
The Arvados project uses Redmine for organizing our work.  You are probably looking at the Redmine site right now.
8
9
h2. Where to create the ticket
10
11
Add issue using the "Issues" tab. 
12
13
Alternately, from the "Backlogs" interface, go to "Product backlog" and then "New story".
14
15
h2. Issue trackers
16
17
When filing an issue, use these guidelines to choose how it should be tracked:
18
19
|Bug|A flaw where the software does not behave as intended, or misleading/outdated documentation.|
20
|Feature|A well defined task taken to improve the software or documentation. This should be fully specified and actionable, otherwise use "Idea".|
21
|Support|An non-development action that needs to be performed to assist a user or customer, or an ops task to maintain internal or external systems.|
22
|Task|A task is a smaller unit of work attached to a feature or bug fix, most commonly used to communicate the state of code review on the task board.  *Note* this shows up in the "Tracker" drop-down for top level tickets but shouldn't be used unless you are filling in parent ticket.|
23
|Idea|An idea, concept, proposal or project to improve the software or documentation, which needs additional work to fully specify and/or broken down into concrete steps.|
24
25 21 Peter Amstutz
h2. Issue category
26
27
We use "category" to describe the part of the product most relevant to the bug or feature.  It is used to ensure that tickets are assigned to developers who are knowledgeable about that part of the product.
28
29 20 Peter Amstutz
h2. Writing good ticket descriptions
30
31
When submitting a ticket, outline (omitting empty/obvious sections):
32
33 8 Tom Clegg
* Background / context
34
* Current behavior
35
* Desired improvements
36
* Proposed implementation
37 1 Peter Amstutz
* Exclusions / clarifications
38
* Open questions
39 20 Peter Amstutz
40
h2. Ticket triage
41
42
At least once a week, the product manager will go through new tickets in "Product backlog".  (Maybe we should do this at a regular meeting?)
43
44 22 Peter Amstutz
If not done already, the ticket should be linked (using "Related to") to an "epic" or "request (tracking)" ticket (these are "idea" tickets).  If a ticket doesn't relate to any existing epics, it may represent a new project that needs to be added to "Epics".
45 20 Peter Amstutz
46
If a ticket is deemed sufficiently urgent/high priority, it will be scheduled for an upcoming sprint.
47 1 Peter Amstutz
48
Otherwise, following initial triage, the ticket should be added to the "Future" sprint.  This is the holding area for tickets that are not scheduled.  Because there are a very large number of tickets in this state, it is important to properly link tickets to epics or customer requests so they can be found again.
49 22 Peter Amstutz
50
h2. Ticket scheduling
51
52
If a ticket did not jump the line and be scheduled on a sprint, it will be pulled in during either the off week engineering meeting or during sprint preparation (the meeting on Tuesday the day before sprint turnover).  During these meeting we examine the current epics, customer priorities, and other internal priorities, look at tickets linked to those, and schedule them on an upcoming sprint.
53 8 Tom Clegg
54 1 Peter Amstutz
h1. Revision control
55
56
h2. Branches
57
58
* 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.
59
* Each story should be done in its own branch.
60
* Branch names are "####-story-summary" where #### is the redmine issue number followed by 3 or 4 words that summarize the story.
61
* Make your local branches track the main repository (@git push -u@)
62 9 Peter Amstutz
* Commit regularly, and push your branch to @git.arvados.org@ at the end of each day 
63
** Be paranoid, commits are cheap, pushing your commits to the remote repository is cheap, losing work is expensive
64 10 Peter Amstutz
** The preferred format of a commit message on a branch is like this (where 12345 should be replaced by the redmine issue number):
65
<pre>
66
12345: One line summary of changes in this commit
67
68
More detailed description of changes if relevant.
69
70
Arvados-DCO-1.1-Signed-off-by: Your Name <your.email@curii.com>
71
</pre>
72 1 Peter Amstutz
* Don't push uninvited changes to other developer's branches.
73
** 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.
74
75
h3. Merging
76
77 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).
78 1 Peter Amstutz
79
# @git remote -v@
80 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.
81
# @git checkout main@
82 1 Peter Amstutz
# @git pull --ff-only@
83 6 Ward Vandewege
#* This ensures your main is up to date. Otherwise "git push" below might fail, and you'll be backtracking.
84 1 Peter Amstutz
# @git merge --no-ff branchname@
85
#* *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.
86
#* In your merge commit message, *include the relevant story/issue number* (either "@refs #1234@" or "@closes #1234@").
87 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>)
88 10 Peter Amstutz
#* The preferred format of a merge commit message is like this:
89
<pre>
90
Merge branch '12345-story-summary'
91
92
refs #12345
93
94
Arvados-DCO-1.1-Signed-off-by: Your Name <your.email@curii.com>
95
</pre>
96 1 Peter Amstutz
# @git push@
97 3 Peter Amstutz
# Look for Jenkins' build results at https://ci.arvados.org .
98 1 Peter Amstutz
99
h3. Rejected pushes
100
101 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.
102 1 Peter Amstutz
103
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
104
105
  git commit --amend
106
107
to update the commit message on your last commit, if that is the offending one, or else you can use 
108
109
  git rebase --interactive
110
111
to rebase and fix up a commit message on an earlier commit.
112 6 Ward Vandewege
113 1 Peter Amstutz
h4. All merge commits to main must be from a feature branch into main
114 6 Ward Vandewege
115 1 Peter Amstutz
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.
116 6 Ward Vandewege
117 1 Peter Amstutz
h4. Merges between local and remote main branches will be rejected
118 6 Ward Vandewege
119 1 Peter Amstutz
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.
120
121
h4. Proper merge message format
122 6 Ward Vandewege
123 1 Peter Amstutz
All merge commits to main must include the text "Merge branch 'featurebranch'" or they will be rejected.
124
125 10 Peter Amstutz
h4. All commits to main include an issue number or explicitly say "no issue #"
126 1 Peter Amstutz
127 6 Ward Vandewege
All commits to main (both merges and single parent commits) must
128 11 Peter Amstutz
include the text "refs #", "closes #", "fixes #", or "no issue #" or they will be
129 1 Peter Amstutz
rejected.
130
131
h4. Avoid broken commit messages
132
133
Your commit message matches
134
135
  /Please enter a commit message to explain why this merge is necessary/
136
137
h2. Commit logs
138
139 5 Ward Vandewege
See https://dev.arvados.org/projects/arvados/wiki/Coding_Standards
140 1 Peter Amstutz
141
h2. Code review process
142
143
Code review has high priority! Branches shouldn't sit around for days waiting for review/merge.
144
145
When your branch is ready for review:
146
# Create/update a review task on the story so it looks like this:
147
#* subject = "review {branch name}"
148
#* state = in progress
149
#* assignee is not null
150 12 Tom Clegg
# Comment on the issue page (not the review page), including
151
#* branch name
152
#* commit hash
153
#* link to Jenkins test run
154
#* if appropriate, a brief description of what's in the branch (may be omitted if it's already in the commit messages, or if it would just be a copy of the issue subject/description)
155 1 Peter Amstutz
# Ping your reviewer (during daily standup, via e-mail and/or via chat).
156
157
Doing a review:
158 13 Peter Amstutz
# Reviewers are usually assigned at sprint kickoff, but if you don't have a reviewer, ask for a volunteer in chat and/or at daily stand-up.
159 1 Peter Amstutz
# 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.
160 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)
161 16 Peter Amstutz
# The reviewer goes through the [[#Ready-to-merge]] checklist
162 14 Peter Amstutz
# 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 by chat (or by some other means such as at daily standup).
163
#* In comments, it is helpful to indicate how strongly you feel how/important the comment is as "low", "medium", or "high"
164 7 Tom Clegg
#* low: nitpick not necessarily worth changing here if you don't feel like it, but I'm mentioning it to help improve habits
165
#* medium: suggestion/idea that you should at least acknowledge/respond to, even if we don't end up resolving it here
166 1 Peter Amstutz
#* high: we should make sure we both agree on how this is resolved before merging
167 7 Tom Clegg
# 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.
168 14 Peter Amstutz
# 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 (indicating by posting a comment with "LGTM" for "Looks Good To Merge")
169
# When the comments are all low priority, someone might write something like "LGTM if you fix this one typo", this indicates that once the minor comments are handled (fixed or responded to) that the branch should be merged without another review cycle.
170 1 Peter Amstutz
# Once the branch is merged, move the "review" task to "resolved".
171
172
To list unmerged branches:
173 6 Ward Vandewege
* Yours: @git branch --no-merged main@
174
* Everyone: @git branch -a --no-merged main@
175 1 Peter Amstutz
176
h2. Ready to merge
177
178 19 Peter Amstutz
See also the "Ready-to-merge-checklist":https://dev.arvados.org/projects/arvados/wiki/Coding_Standards#Ready-to-merge-checklist
179
180 1 Peter Amstutz
When merging, both the developer and the reviewer should be convinced that:
181 6 Ward Vandewege
* Current/recent main is merged. (Otherwise, you can't predict what merge will do.)
182 1 Peter Amstutz
* The branch is pushed to git.arvados.org
183
* The code is suitably robust.
184
* The code is suitably readable.
185
* 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?
186
* 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
187
* 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.
188
* 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!)
189
* 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.)
190
* New/fixed behavior is tested. (Although sometimes we decide not to block on inadequate testing infrastructure... that sucks!)
191
* New/changed behavior is documented. Search the doc site for relevant keywords to help you find the right sections.
192
* Whitespace errors are not committed. (Tab characters, spaces at EOL, etc.)
193 18 Peter Amstutz
* Git commit messages are descriptive. If they aren't, this is your last chance to rebase/reword.
194
* Code meets other [[arvados:Coding Standards]]
195
* For GUI work: user interface elements meet accessibility guidelines on the coding standards page
196 1 Peter Amstutz
197
h2. Handling pull requests from github
198
199
_This is only for contributions by *external contributors*, i.e., people who don't have permission to write directly to arvados.org repositories._
200
201 6 Ward Vandewege
First make sure your main is up to date.
202 1 Peter Amstutz
203 6 Ward Vandewege
    git checkout main; git pull --ff-only
204 1 Peter Amstutz
205
*Option 1:* On the pull request page on github, click the "You can also merge branches on the command line" link to get instructions.
206
207
* Don't forget to run tests.
208
209
*Option 2:* (a bit shorter)
210
211 6 Ward Vandewege
Say we have "chapmanb  wants to merge 1 commit into arvados:main from chapmanb:branchname"
212 1 Peter Amstutz
* @git fetch https://github.com/chapmanb/arvados.git branchname:chapmanb-branchname@
213
* @git merge --no-ff chapmanb-branchname@
214
* Use the commit message: @Merge branch 'branchname' from github.com/chapmanb. No issue #@
215
(or @refs #1234@ if there is an issue#)
216 6 Ward Vandewege
* Confirm diff: @git diff origin/main main@
217 1 Peter Amstutz
* Run tests
218
* @git push@
219
220
h1. Non-fast-forward push
221
222
Please don't get into a situation where this is needed.
223
224 6 Ward Vandewege
# On dev box: @git push -f git@github.com:arvados/arvados proper_head_commit:main proper_head_commit:staging@
225
# On dev box: @git push -f git@git.arvados.org:arvados.git proper_head_commit:main@
226
# As gitsync@dev.arvados.org: @cd /scm/arvados; git fetch origin; git checkout main; git reset --hard origin/main@
227 1 Peter Amstutz
228
(At least that's what TC did on 2016-03-10. We'll see how it goes.)
229
230
h1. Working with external upstream projects
231
232
Development process summary (1-6 should follow the guidelines above)
233
234
# Each feature is developed in a git branch named @<issue_number>-<summary>@, for example @12521-web-app-config@
235
# Each feature has a "Review" task.  You can see the features and review tasks on the task board.
236
# 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
237
# The reviewer responds on the issue page with questions or comments
238
# When the branch is ready to merge, the reviewer will add a comment "Looks Good To Me" (LGTM) on the issue page
239
# Merge the feature into into the Arvados main branch
240
# Push the feature branch to github and make a pull request (PR) of the branch against the external project upstream
241
# Handle code review comments/change requests from the external project team
242 6 Ward Vandewege
# Once the external project merges the PR, merge external project upstream main back into the feature branch
243 1 Peter Amstutz
# Determine if external project upstream brings any unrelated changes that breaks things for us
244
# If necessary, make fixes, make a new PR, repeat until stable
245 6 Ward Vandewege
# Merge the feature branch (now up-to-date with external project upstream) into Arvados main
246 1 Peter Amstutz
247
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.
248
249 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).
250 1 Peter Amstutz
251
252
h1. Scrum
253
254
h2. References
255
256
These books give us a reference point and vocabulary. 
257
258
* _Essential Scrum: A Practical Guide to the Most Popular Agile Process_ by Kenneth Rubin
259
* _User Stories Applied: For Agile Software Development_ by Mike Cohen
260
261
h2. Roles
262
263
264
h3. Product Owner
265
266
* Decide what goes on the backlog
267
* Decide backlog priorities
268
* Work with stakeholders to understand their requirements and priorities
269
* Encode stakeholder requirements/expectations as user stories
270
* Lead sprint planning meetings 
271
* Lead release planning meetings 
272
* Lead product planning meetings 
273
* Lead Sprint Kick-off Meetings
274
* Lead Sprint Review Meetings
275
* Decide on overall release schedule 
276
277
h3. Scrum Master
278
279
* Lead Daily Scrum Meeting
280
* Help to eliminate road blocks 
281
* Lead Sprint Retrospective Meetings
282
* Organize Sprint Schedule 
283
* Help team organize and stay on track with Scrum process
284
* Teach new engineers how Scrum works
285
286
h3. Top stakeholders
287
288
* Conduct market research 
289
* Synthesize market research into user stories 
290
* Work with Product Owner to prioritize stories
291
* Define overall business goals for product 
292
* Work with Product Owner to define overall release cycle 
293
* Organize User Input and dialog with users for engineering team 
294
* Contribute to backlog grooming 
295
* Bring voice of customer into planning process 
296
* Define user personas 
297
* Coordinate user communication 
298
* Develop technical marketing and sales materials 
299
* Assist sales team in presenting product value proposition
300
* Train sales in technical aspects of the product
301
302
h2. Definition of Done
303
304
An issue is resolved when:
305
306
* Code is written
307
* Existing code is refactored if appropriate
308
* Documentation is written/updated
309
* Acceptance tests are satisfied
310 6 Ward Vandewege
* Code is merged in main
311 1 Peter Amstutz
* All Jenkins jobs pass (test, build packages, deploy to dev clusters)
312
* Feature works on applicable dev clusters
313
314
h2. Standard Schedule
315
316
Sprints are two weeks long. They start and end on Wednesdays.
317
318
h3. Key meetings
319
320 2 Peter Amstutz
Every day:
321 1 Peter Amstutz
322
Daily Scrum (15 Minutes)
323
Who: Development team, product owner. Silent observers welcome.
324
* What did you do yesterday?
325
* What will you do today?
326
* What obstacles are in your way?
327
328
h4. Sprint review & kickoff (every 2 weeks on Wednesday):
329
330
Sprint Review (30 minutes)
331
Who: Development team, product owner, stakeholders.
332
* Demo of each feature built and relationship to stories
333
* Product owner explains which backlog items are done
334
* Development team demonstrates the work done, and answers questions about the sprint increment
335
* Product owner discusses the backlog as it stands. Revise expected completion dates based on recent progress (if needed)
336
* Review current product status in context of business goals
337
338
Sprint Retrospective (30 minutes)
339
Who: Development team, product owner.
340
* Review what processes worked well, and what didn't, in the sprint just finished
341
* Propose and agree to changes to improve future sprints
342
* Assign action items (meetings/tasks) to implement agreed-upon process improvements
343
344
Sprint Kick Off (1 hour)
345
Who: Development team, product owner.
346
* Add latest bugs or dependencies to sprint
347
* Create tasks for each story
348
* Assign a developer to each task
349
* Assign an on-call engineer for that sprint who will triage customer support requests
350
* Check that commitment level is realistic
351
352
h4. Planning (alternate Wednesdays mid-sprint)
353
354 2 Peter Amstutz
Roadmap review (1 hour)
355 1 Peter Amstutz
Who: Development team, product owner, stakeholders.
356 2 Peter Amstutz
* Report high level status of epics
357
* Prioritize epics
358
* Define new epics
359 1 Peter Amstutz
360 2 Peter Amstutz
Sprint Planning (1-2 hours)
361 1 Peter Amstutz
Who: Development team, product owner.
362 2 Peter Amstutz
* Discuss and get engineering team consensus on feature design & implementation strategy for tasks on current and upcoming epics