/builds/gitlab-kitware-sciviz-ci/Documentation/dev/git/develop.md
Go to the documentation of this file.
1 Develop ParaView with Git
2 =========================
3 
4 This page documents how to develop ParaView using [GitLab][] and [Git][].
5 See the [README](README.md) for more information.
6 
7 [GitLab]: https://gitlab.kitware.com/
8 [Git]: http://git-scm.com
9 
10 Git is an extremely powerful version control tool that supports many
11 different "workflows" for individual development and collaboration.
12 Here we document procedures used by the ParaView development community.
13 In the interest of simplicity and brevity we do *not* provide an
14 explanation of why we use this approach.
15 
16 Initial Setup
17 -------------
18 
19 Before you begin, perform initial setup:
20 
21 1. Register [GitLab Access][] to create an account and select a user name.
22 
23 2. [Fork ParaView][] into your user's namespace on GitLab.
24 
25 3. Follow the [download instructions](download.md#clone) to create a
26  local clone of the main ParaView repository.
27 
28  $ git clone --recursive https://gitlab.kitware.com/paraview/paraview.git ParaView
29 
30  The main repository will be configured as your `origin` remote.
31 
32 4. Run the [developer setup script][] to prepare your ParaView work tree and
33  create Git command aliases used below:
34 
35  $ ./Utilities/SetupForDevelopment.sh
36 
37  This will prompt for your GitLab username and configure a remote
38  called `gitlab` to refer to your fork. It will also setup a data directory for you.
39  No need to do anything else.
40 
41 [GitLab Access]: https://gitlab.kitware.com/users/sign_in
42 [Fork ParaView]: https://gitlab.kitware.com/paraview/paraview/-/forks/new
43 [developer setup script]: /Utilities/SetupForDevelopment.sh
44 
45 Quick Start Guide
46 -----------------
47 
48 This is a quick start guide so that you can start contributing to ParaView easily.
49 To understand the process more deeply, you can jump to the [workflow](#workflow)
50 section.
51 
52 ### Developement
53 
54 Create a local branch for your changes:
55 
56 ```
57 git checkout -b your_branch
58 ```
59 
60 Make the needed changes in ParaView and use git locally to create logically separated commits.
61 There is no strict requirements regarding git commit messages syntax but a good rule of
62 thumb to follow is: `General domain: reason for change`, General domain being a class, a module
63 , a specific system like build or CI.
64 
65 ```
66 git commit -m "General domain: Short yet informative reason for the change"
67 ```
68 
69 Build ParaView following the [guide](Documentation/dev/build.md#) and fix any build warnings or issues that arise and seems related to your changes.
70 
71 ### Bringing in VTK changes
72 
73 If you are working on a change that is across both VTK and ParaView, you can work directly on the VTK that is
74 inside your repository of ParaView. Just follow the steps in the [VTK develop guide](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/git/develop.md#initial-setup)
75 starting at the usage of `SetupForDevelopment.sh` script.
76 
77 You can then develop in the VTK directory as if it was any VTK repository, where you can make changes, commit and push to your VTK fork.
78 
79 If you want to test the integration of your VTK changes in ParaView [continuous integration](continuous-integration), commit and push your changes
80 to your VTK fork, then commit the VTK submodule update with your changes in a separate commit in your ParaView branch. Your VTK commit will be found without issue.
81 
82 Once your VTK changes are merged into VTK master, you can cleanup your history and commit the submodule update cleanly like this
83 (this will remove local non commited changes and also rebase your branch on the last master):
84 
85 ```
86 cd VTK
87 git fetch origin
88 git checkout master
89 git pull
90 cd ../
91 git fetch origin
92 git rebase -i origin/master # delete any VTK submodule update commit
93 git submodule update
94 git bump VTK master
95 ```
96 
97 ### Testing
98 
99 Every change and new features needs to be tested. In ParaView, there are mainly two types of tests.
100 Python tests and XML tests. While both types of tests are as valid to add, XML tests should be preferred for standard
101 feature tests when possible as they exercise the ParaView user interface as well as core features.
102 
103 #### XML Tests
104 
105 First, as XML tests are impacted by ParaView's user settings, it is recommanded to always run `paraview` in dry run (option `--dr`).
106 
107 To add a XML test, use the `Tools -> Record Test` menu in ParaView. After specifying name for the XML test, a new window named
108 `Recording User Input` will pop up. This one will record every action you will perfom in ParaView to test his feature.
109 
110 It is also recommanded to lock the view size when we want to create a baseline, choose `Tools -> Lock View Size Custom...`
111 and set it to a 400x400 window as it works well.
112 
113 On top of recording actions, the most important feature in this window is the check mark button which allows you to:
114 - record the value of a property in the Properties Panel.
115 - save an intermediary baseline. (in that case, use `TESTS_WITH_INLINE_COMPARES`)
116 - check any value in the spreadsheet view.
117 
118 Advanced features are:
119 - `Continuous Flush`: writes events to file as soon as they are recorded. Especially useful when user environment isn't stable.
120 - `Record Interaction Timings`: record each pause between interactions as a pause event.
121 
122 It is also possible to stop the test recording by using the pause button and add comments in the XML test.
123 
124 Finally, you can save the XML test by using the `Stop recording` button.
125 
126 You may need to edit this file slightly to make it work as expected, do not hesitate to look at other files.
127 
128 Add the file to `Client/ParaView/Testing/XML` folder and list it in one of the `test.XXX.cmake` file.
129 Those files are conditionally used, typically depending on a build option.
130 Look at `Client/ParaView/Testing/XML/CMakeLists.txt` to find the appropriate one.
131 By default, tests should be added in `test.common.cmake`.
132 
133 There are different categories of tests depending on what you want to test :
134 - `DATA_WITH_BASELINES`: for general use case, in most of the case the safest bet is this category.
135 - `TESTS_WITH_INLINE_COMPARES`: for when you need to do multiple image comparison.
136 - `TESTS_WITHOUT_BASELINES`: in some context, a valid XML test can be made without baseline.
137 
138 You can then configure ParaView and run your test from the build directory and check that they pass:
139 
140 ```
141 cmake . && cmake --build .
142 ctest -VV -R yourTest
143 ```
144 
145 #### Python Tests
146 
147 To add a Python test, write a pvpython script testing the feature, add it in `Client/ParaView/Testing/Python` folder
148 and list it in `Client/ParaView/Testing/Python/CMakeLists.txt`. There are different categories of tests,
149 but the safest bet is probably the `paraview_add_test_python` category.
150 
151 ```
152 cmake . && cmake --build .
153 ctest -VV -R yourTest
154 ```
155 
156 ### Upload
157 
158 Push your changes to the gitlab fork that you created in the [initial setup](#initial-setup) stage:
159 
160 ```
161 git push gitlab
162 ```
163 
164 ### Data
165 
166 If your test uses new data or baselines, you will need to add it to your fork.
167 For data, add the file names to the list in the corresponding `Clients/ParaView/Testing/Python/CMakeLists.txt`
168 or `Clients/ParaView/Testing/XML/test.common.cmake` and drop the files in `Testing/Data/`.
169 For baselines, just drop the file in `Clients/ParaView/Testing/Data/Baseline/` and run the following commands from your build directory:
170 
171 ```
172 cmake . && cmake --build .
173 ```
174 
175 This will transform your files into .sha512 files. Check your test is passing by running from your build directory:
176 
177 ```
178 ctest -VV -R yourTest
179 ```
180 
181 If it passes, add these .sha512 files and commit them, then push with:
182 
183 ```
184 git gitlab-push
185 ```
186 
187 ### Create a Merge Request
188 
189 Once you are happy with the state of your development on your fork, the next step is to create a merge request back into the main ParaView repository.
190 
191 Open [](https://gitlab.kitware.com/username/paraview/-/merge_requests/new) in a browser, select your branch in the list and create a Merge Request against master.
192 
193 In the description, write an informative explanation of your added features or bugfix. If there is an associated issue, link it with the `#number` in the description.
194 
195 Tag some ParaView maintainers in the description to ensure someone will see it, eg: @cory.quammen, @ben.boeckel or @mwestphal.
196 
197 ### Robot Checks
198 
199 Once the MR is created, our gitlab robot will check multiple things and make automated suggestions. Please read them and try to follow the instructions.
200 The two standard suggestions are related to formatting errors and adding markdown changelog.
201 
202 To fix the formatting, just add a comment containing:
203 
204 ```
205 Do: reformat
206 ```
207 
208 Then, once the robot has fixed the formatting, fetch the changes locally (this will remove any local changes to your branch)
209 
210 ```
211 git fetch gitlab
212 git reset --hard gitlab/your_branch
213 ```
214 
215 To fix the changelog warning, create, add, commit and push a markdown (.md) file in `Documentation/release/dev` folder.
216 In this file, write a small markdown paragraph describing the development.
217 See other .md files in this folder for examples. It may look like this:
218 
219 ```
220 ## Development title
221 
222 A new feature that does this and that has been introduced.
223 This specific issue has been fixed in this particular way.
224 ```
225 
226 Suggestions and best practices on writing the changelog can be found in the `Documentation/release/dev/0-sample-topic.md` file.
227 This is an optional step but recommended to do for any new feature and user facing issues.
228 
229 ### Reviews
230 
231 ParaView maintainers and developers will review your MR by leaving comments on it. Try to follow their instructions and be patient.
232 It can take a while to get a MR into mergeable form. This is a mandatory step, and it is absolutely normal to get change requests.
233 
234 Review comments can be resolved, please resolve a comment once you've taken it into account and pushed related changes
235 or once you've reached an agreement with the commenter that nothing should be changed.
236 
237 Once a reviewer is happy with your changes, they will add a `+X` comment. You need at least one `+2` or higher to consider
238 merging the MR. Two `+1`s do not equal a `+2`. If a reviewer leave a `-1` comment, please discuss with them to understand what is the issue and how it could be fixed.
239 
240 Once you have pushed new changes, please tag reviewers again so that they can take a look.
241 If you do not tag reviewers, they may not know to revisit your changes. _Do not hesitate to tag them and ask for help_.
242 
243 ### Continuous Integration
244 
245 Before merging a MR, the ParaView continuous integration (CI) needs to run and be green.
246 For CI to be functional, please read and follow this [guide](https://discourse.vtk.org/t/the-ultimate-how-to-make-ci-work-with-my-fork-guide/7581).
247 It was written for VTK but is as valid for ParaView.
248 
249 To run the CI:
250  - Click on the Pipelines Tab
251  - Click on the last pipeline status badge
252  - Press the `Play all manual` arrows on top of the Build and Test stages
253 
254 Do not hesitate to tag a ParaView developer for help if needed.
255 
256 You then need to wait for CI to run, it can take a while, up to a full day.
257 
258 A successful CI should be fully green. If that is so, then your MR is ready !
259 
260 If not, you need to analyze the issues and fix them. Recover the failure information this way:
261 
262 Click on the pipelines tab, then on the last status badge, then on the `cdash-commit` job.
263 It will take you to the related CDash report where you will find all information.
264 
265 Everything in the CDash report should be green except the `NotRun` and `Time` column. Take a look into each issue and fix them locally.
266 If there are issues in the pipeline but nothing is visible in the CDash, please ask a maintainer for help to figure out if anything should be done.
267 You can always try to rerun the failed job by clicking on the arrow of the job in the pipeline.
268 
269 Once you have fixed some issues locally, commit and push them to gitlab, run the CI again and tag reviewers again for follow-up reviews.
270 
271 ### Merging
272 
273 Once the MR has green CI and you have at least one `+2`, you can ask for a merge. Before that please make sure that:
274  - Your commit history is logical (or squashed into a single commit) and cleaned up with good commit messages
275  - You are rebased on a fairly recent version of master
276 
277 If that is not the case, please rebase on master using the following commands:
278 
279 ```
280 git fetch origin
281 git rebase -i origin/master
282 git push gitlab -f
283 ```
284 
285 The interactive rebase will let you squash commits, reorganize commits and edit commit messages.
286 
287 After the force push, make sure to run CI again.
288 
289 Once all is done, tag a ParaView developer so that they can perform the merge command.
290 
291 __Congratulations ! You just contributed to ParaView !__
292 
293 Workflow
294 --------
295 
296 ParaView development uses a [branchy workflow][] based on topic branches.
297 Our collaboration workflow consists of three main steps:
298 
299 1. Local Development:
300  * [Update](#update)
301  * [Create a Topic](#create-a-topic)
302 
303 2. Code Review (requires [GitLab Access][]):
304  * [Share a Topic](#share-a-topic)
305  * [Create a Merge Request](#create-a-merge-request)
306  * [Review a Merge Request](#review-a-merge-request)
307  * [Revise a Topic](#revise-a-topic)
308 
309 3. Integrate Changes:
310  * [Merge a Topic](#merge-a-topic) (requires permission in GitLab)
311  * [Delete a Topic](#delete-a-topic)
312 
313 [branchy workflow]: http://public.kitware.com/Wiki/Git/Workflow/Topic
314 
315 Update
316 ------
317 
318 1. Update your local `master` branch:
319 
320  $ git checkout master
321  $ git pullall
322 2. Optionally push `master` to your fork in GitLab:
323 
324  $ git push gitlab master
325  to keep it in sync. The `git gitlab-push` script used to
326  [Share a Topic](#share-a-topic) below will also do this.
327 
328 Create a Topic
329 --------------
330 
331 All new work must be committed on topic branches.
332 Name topics like you might name functions: concise but precise.
333 A reader should have a general idea of the feature or fix to be developed given
334 just the branch name. Additionally, it is preferred to have an issue associated with
335 every topic. The issue can document the bug or feature to be developed. In such
336 cases, being your topic name with the issue number.
337 
338 1. To start a new topic branch:
339 
340  $ git fetch origin
341 
342  If there is an issue associated with the topic, assign the issue to yourself
343  using the "**Assignee**" field, and add the
344  `workflow:active-development` label to it.
345 
346 2. For new development, start the topic from `origin/master`:
347 
348  $ git checkout -b my-topic origin/master
349 
350  For release branch fixes, start the topic from `origin/release`, and
351  by convention use a topic name starting in `release-`:
352 
353  $ git checkout -b release-my-topic origin/release
354 
355  If subdmodules may have changed, the run:
356 
357  $ git submodule update
358 
359 3. Edit files and create commits (repeat as needed):
360 
361  $ edit file1 file2 file3
362  $ git add file1 file2 file3
363  $ git commit
364 
365  Caveats:
366  * To add data follow these [vtk instructions][].
367  * To add icons, Kitware's graphic designer may be able to help create an SVG icon.
368 
369  Commit messages must contain a brief description as the first line
370  and a more detailed description of what the commit contains. If
371  the commit contains a new feature, the detailed message must
372  describe the new feature and why it is needed. If the commit
373  contains a bug fix, the detailed message must describe the bug
374  behavior, its underlying cause, and the approach to fix it. If the
375  bug is described in the bug tracker, the commit message must
376  contain a reference to the bug number.
377 
378 4. Update a submodule if needed
379 
380  If you need to update a submodule (eg: VTK) in order to access a specific bugfix or features, first make sure
381  that the needed developments have been merged into the main branch of the submodule. You can then use the command:
382 
383  $ git bump my-submodule my-hash-or-branch
384 
385  `my-submodule` being the submodule folder (eg: VTK), `my-hash-or-branch` being either a hash or a branch provided
386  by any of your remote or your local repository, typically, `origin/master`.
387 
388  This will add a new commit which update the submodule and prefill the commit message with information about
389  the different commits in the submodule. Make sure to still add some information about the reason for the bump.
390 
391  Please note you can run CI on a submodule commit in another remote, see [continuous integration] for more info.
392 
393 4. Add some tests
394 
395  Every changes and new features need to be tested in ParaView. Depending on what you implement, you can perform
396  an image comparison with a baseline of expected result or checking a property at anytime.
397 
398  They are mainly 2 types of test in ParaView, python and XML testing. Generally we use a XML test, for more details
399  regarding this topic, it's highly recommanded to check this [section](#testing).
400 
401 5. Add release notes
402 
403  Notable changes should create a new file in `Documentation/release/dev/`
404  named `my-topic.md` (replace `my-topic` with the name of your topic).
405  This is not necessary for branches which are "trivial" such as fixing
406  typos, updating test baselines, or are developer-oriented.
407 
408 [vtk instructions]: https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/git/data.md
409 
410 Share a Topic
411 -------------
412 
413 When a topic is ready for review and possible inclusion, share it by pushing
414 to a fork of your repository in GitLab. Be sure you have registered and
415 signed in for [GitLab Access][] and created your fork by visiting the main
416 [ParaView GitLab][] repository page and using the "Fork" button in the upper right.
417 
418 [ParaView GitLab]: https://gitlab.kitware.com/paraview/paraview
419 
420 1. Checkout the topic if it is not your current branch:
421 
422  $ git checkout my-topic
423 
424 2. Check what commits will be pushed to your fork in GitLab:
425 
426  $ git prepush
427 
428 3. Push commits in your topic branch to your fork in GitLab:
429 
430  $ git gitlab-push
431 
432  Notes:
433  * If you are revising a previously pushed topic and have rewritten the
434  topic history, add `-f` or `--force` to overwrite the destination.
435  * If the topic adds data see [this note](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/git/data.md#push).
436  * The `gitlab-push` script also pushes the `master` branch to your
437  fork in GitLab to keep it in sync with the upstream `master`.
438 
439  The output will include a link to the topic branch in your fork in GitLab
440  and a link to a page for creating a Merge Request.
441 
442 Create a Merge Request
443 ----------------------
444 
445 (If you already created a merge request for a given topic and have reached
446 this step after revising it, skip to the [next step](#review-a-merge-request).)
447 
448 Visit your fork in GitLab, browse to the "**Merge Requests**" link on the
449 left, and use the "**New Merge Request**" button in the upper right to
450 reach the URL printed at the end of the [previous step](#share-a-topic).
451 It should be of the form:
452 
453  https://gitlab.kitware.com/<username>/paraview/-/merge_requests/new
454 
455 Follow these steps:
456 
457 1. In the "**Source branch**" box select the `<username>/paraview` repository
458  and the `my-topic` branch.
459 
460 2. In the "**Target branch**" box select the `paraview/paraview` repository and
461  the `master` branch. It should be the default.
462 
463  If your change is a fix for the `release` branch, you should still
464  select the `master` branch as the target because the change needs
465  to end up there too.
466 
467 3. Use the "**Compare branches**" button to proceed to the next page
468  and fill out the merge request creation form.
469 
470 4. In the "**Title**" field provide a one-line summary of the entire
471  topic. This will become the title of the Merge Request.
472 
473  Example Merge Request Title:
474 
475  Wrapping: Add Java 1.x support
476 
477 5. In the "**Description**" field provide a high-level description
478  of the change the topic makes and any relevant information about
479  how to try it.
480  * Use `@username` syntax to draw attention of specific developers.
481  This syntax may be used anywhere outside literal text and code
482  blocks. Or, wait until the [next step](#review-a-merge-request)
483  and add comments to draw attention of developers.
484  * If your change is a fix for the `release` branch, indicate this
485  so that a maintainer knows it should be merged to `release`.
486  * Optionally use a fenced code block with type `message` to specify
487  text to be included in the generated merge commit message when the
488  topic is [merged](#merge-a-topic).
489 
490  Example Merge Request Description:
491 
492  This branch requires Java 1.x which is not generally available yet.
493  Get Java 1.x from ... in order to try these changes.
494 
495  ```message
496  Add support for Java 1.x to the wrapping infrastructure.
497  ```
498 
499  Cc: @user1 @user2
500 
501 6. The "**Assign to**", "**Milestone**", and "**Labels**" fields
502  may be left blank.
503 
504 7. Use the "**Submit merge request**" button to create the merge request
505  and visit its page.
506 
507 Guidelines
508 ----------
509 For guidelines with respect to licensing, naming conventions, code formatting,
510 documentation and further, please check [guidelines](guidelines.md)
511 
512 Review a Merge Request
513 ----------------------
514 
515 Add comments mentioning specific developers using `@username` syntax to
516 draw their attention and have the topic reviewed. After typing `@` and
517 some text, GitLab will offer completions for developers whose real names
518 or user names match.
519 
520 Comments use [GitLab Flavored Markdown][] for formatting. See GitLab
521 documentation on [Special GitLab References][] to add links to things
522 like merge requests and commits in other repositories.
523 
524 When a merge request is ready for review, developers can use the
525 `triage:ready-for-review` to indicate the same to the reviewers. If reviewers
526 deems that it needs more work, they can add the `triage:needswork` label.
527 This can be repeated as many times as needed adding/removing labels as
528 appropriate.
529 
530 If a merge request is waiting on dashboards, use the `triage:pending-dashboards`
531 label.
532 
533 [GitLab Flavored Markdown]: https://gitlab.kitware.com/help/markdown/markdown
534 [Special GitLab References]: https://gitlab.kitware.com/help/markdown/markdown#special-gitlab-references
535 
536 ### Human Reviews ###
537 
538 Reviewers may add comments providing feedback or to acknowledge their approval.
539 
540 If a reviewer raises an issue via a thread, the contributor may resolve the thread if the
541 solution is indisputable. In case of cited lines within the issue, the
542 corresponding changes of the commit prior to a comment are shown. So it
543 is better to first push the change and then comment/resolve. When code is cited, the
544 last line is usually the line of interest, the above lines just provide the context.
545 Providing a comment just saying 'done' is unnecessary as GitLab
546 will indicate that the relevant code has changed.
547 
548 It shall be a common goal for reviewers and contributors to limit the amount of generated emails.
549 Therefore reviewers are encouraged to comment systematic issues (e.g. missing `this->`)
550 only once but to indicate the general application. Contributors do not need to comment on trivial
551 fixes (e.g. typos in comments) but may simply solved the threads after fixing.
552 
553 To raise the attention of individuals, e.g. a reviewer for another round of review, this person
554 can be pinged by addressing via `@` in a comment.
555 
556 #### Special Comments #####
557 
558 Lines of specific forms will be extracted during
559 [merging](#merge-a-topic) and included as trailing lines of the
560 generated merge commit message:
561 
562 The *leading* line of a comment may optionally be exactly one of the
563 following votes followed by nothing but whitespace before the end
564 of the line:
565 
566 * `-1` or `:-1:` indicates "the change is not ready for integration".
567 * `+1` or `:+1:` indicates "I like the change".
568  This adds an `Acked-by:` trailer to the merge commit message.
569 * `+2` indicates "the change is ready for integration".
570  This adds a `Reviewed-by:` trailer to the merge commit message.
571 * `+3` indicates "I have tested the change and verified it works".
572  This adds a `Tested-by:` trailer to the merge commit message.
573 
574 The middle lines of a comment may be free-form [GitLab Flavored Markdown][].
575 
576 Zero or more *trailing* lines of a comment may each contain exactly one
577 of the following votes followed by nothing but whitespace before the end
578 of the line:
579 
580 * `Rejected-by: me` means "The change is not ready for integration."
581 * `Acked-by: me` means "I like the change but defer to others."
582 * `Reviewed-by: me` means "The change is ready for integration."
583 * `Tested-by: me` means "I have tested the change and verified it works."
584 
585 Each `me` reference may instead be an `@username` reference or a full
586 `Real Name <user@domain>` reference to credit someone else for performing
587 the review. References to `me` and `@username` will automatically be
588 transformed into a real name and email address according to your
589 GitLab account profile.
590 
591 #### Fetching Changes ####
592 
593 One may fetch the changes associated with a merge request by using
594 the `git fetch` command line shown at the top of the Merge Request
595 page. It is of the form:
596 
597  $ git fetch https://gitlab.kitware.com/$username/paraview.git $branch
598 
599 This updates the local `FETCH_HEAD` to refer to the branch.
600 
601 There are a few options for checking out the changes in a work tree:
602 
603 * One may checkout the branch:
604 
605  $ git checkout FETCH_HEAD -b $branch
606  or checkout the commit without creating a local branch:
607 
608  $ git checkout FETCH_HEAD
609 
610 * Or, one may cherry-pick the commits to minimize rebuild time:
611 
612  $ git cherry-pick ..FETCH_HEAD
613 
614 ### Robot Reviews ###
615 
616 The "Kitware Robot" automatically performs basic checks including clang-format on the commits
617 and adds a comment acknowledging or rejecting the topic. This will be
618 repeated automatically whenever the topic is pushed to your fork again.
619 
620 Automatic formatting can be triggered by adding a comment with a single line.
621 
622  Do: reformat
623 
624 A re-check may be explicitly requested by
625 
626  Do: check
627 
628 A topic cannot be [merged](#merge-a-topic) until the automatic review
629 succeeds. It is necessary to correct the specific commit via rebase.
630 
631 ### Continuous Integration ###
632 
633 ParaView uses [GitLab CI][] to test merge requests, configured by the top-level
634 `.gitlab-ci.yml` file. Results may be seen both on the merge request's
635 pipeline page and on the [ParaView CDash Page][]. Filtered CDash results
636 showing just the pipeline's jobs can be reached by selecting the `cdash-commit`
637 job in the `External` stage of the pipeline. Note that due to GitLab changes,
638 the `External` stage may be in a separate pipeline for the same commit.
639 
640 Lint build jobs run automatically after every push. Actual CI jobs require a
641 manual trigger to run:
642 
643 * Merge request authors may visit their merge request's pipeline and click the
644  "Play" button on one or more jobs manually. If the merge request has the
645  "Allow commits from members who can merge to the target branch" check box
646  enabled, ParaView maintainers may use the "Play" button too.
647  When in doubt, it's a good idea to run a few jobs as smoke tests to catch
648  early build/test failures before a full CI run that would tie up useful resources.
649  Note that, as detailed below, a full CI run is necessary before the request
650  can be merged.
651 
652 * When working simultaneously on ParaView and a submodule, e.g., VTK, it may be useful
653  to run the CI before merging changes in the submodule in question. This is perfectly
654  supported, just push your change on your remote for the submodule and update the submodule
655  manually in a temporary commit, then run the CI. Make sure to remove this commit before the merge
656  and use `git bump` when performing the actual submodule update.
657 
658 * [ParaView GitLab Project Developers][] may trigger CI on a merge request by
659  adding a comment with a command among the [comment trailing
660  lines](#trailing-lines):
661 
662  Do: test
663 
664  `@kwrobot` will add an award emoji to the comment to indicate that it
665  was processed and also trigger all manual jobs in the merge request's
666  pipeline.
667 
668  The `Do: test` command accepts the following arguments:
669 
670  * `--named <regex>`, `-n <regex>`: Trigger jobs matching `<regex>` anywhere
671  in their name. Job names may be seen on the merge request's Pipelines tab.
672  * `--stage <stage>`, `-s <stage>`: Only affect jobs in a given stage. Stage
673  names may be seen on the merge request's Pipelines tab. Note that the
674  names are determined by what is in the `.gitlab-ci.yml` file and may be
675  capitalized in the web page, so lowercasing the webpage's display name for
676  stages may be required.
677  * `--action <action>`, `-a <action>`: The action to perform on the jobs.
678  Possible actions:
679 
680  * `manual` (the default): Start jobs awaiting manual interaction.
681  * `unsuccessful`: Start or restart jobs which have not completed
682  successfully.
683  * `failed`: Restart jobs which have completed, but without success.
684  * `completed`: Restart all completed jobs.
685 
686 If the merge request topic branch is updated by a push, a new manual trigger
687 using one of the above methods is needed to start CI again. Currently running
688 jobs will generally be canceled automatically.
689 
690 Before the merge, all the jobs must be run and reviewed, see below.
691 
692 If you have any question about the CI process, do not hesitate to ask a CI maintainer:
693  - ben.boeckel
694  - mwestphal
695 
696 [GitLab CI]: https://gitlab.kitware.com/help/ci/README.md
697 [ParaView CDash Page]: https://open.cdash.org/index.php?project=ParaView
698 [ParaView GitLab Project Developers]: https://gitlab.kitware.com/cmake/cmake/-/settings/members
699 
700 ### Reading CI Results ###
701 
702 Reading CI results is a very important part of the merge request process
703 and is the responsibility of the author of the merge request, although reviewers
704 can usually help. There are two locations to read the results, GitLab CI and CDash.
705 Both should be checked and considered clean before merging.
706 
707 To read GitLab CI result, click on the Pipelines tab then on the last pipeline.
708 It is expected to be fully green. If there is a yellow warning job, please consult CDash.
709 If there is a red failed job, click on it to see the reason for the failure.
710 It should clearly appears on the bottom of the log.
711 Possible failures are:
712  - Timeouts: please rerun the job and report to CI maintainers
713  - Memory related errors: please rerun the job and report to CI maintainers
714  - Testing errors: please consult CDash for more information, usually an issue in your code
715  - Non disclosed error: please consult CDash, usually a build error in your code
716 
717 To read the CDash results, on the job page, click on the "cdash-commit" external job which
718 will open the commit-specific CDash page. Once it is open, make sure to show "All Build" at the bottom left of the page.
719 CDash results display error, warnings, and test failures for all the jobs.
720 It is expected to be green *except* for the "NoRun" and "Test Timings" categories, which can be ignored.
721 
722  - Configure warnings: there **must** not be any; to fix before the merge
723  - Configure errors: there **must** not be any; to fix before the merge
724  - Build warnings: there **must** not be any; to fix before the merge. If unrelated to your code, rerun the job and report to CI maintainers.
725  - Build Errors: there **must** not be any; to fix before the merge. If unrelated to your code, report to CI maintainers.
726  - NotRun test: ignore; these tests have self-diagnosed that they are not relevant on the testing machine.
727  - Testing failure: there **should** not be any, ideally, to fix before the merge. If unrelated to your code, check the test history to see if it is a flaky test and report to CI maintainers.
728  - Testing success: if your MR creates or modifies tests, please check that your test are listed there.
729  - Test timings errors: can be ignored, but if it is all red, you may want to report it to CI maintainers.
730 
731 To check the history of a failing test, on the test page, click on the "Summary" link to see a summary of the test for the day,
732 then click on the date controls on the top of the page to go back in time.
733 If the test fails on other MRs or on master, this is probably a flaky test, currently in the process of being fixed or excluded.
734 A flaky test can be ignored.
735 
736 As a reminder, here is our current policy regarding CI results.
737 All the jobs must be run before merging.
738 Configure warnings and errors are not acceptable to merge and must be fixed.
739 Build warning and errors are not acceptable to merge and must be fixed.
740 Testing failure should be fixed before merging but can be accepted if a flaky test has been clearly identified.
741 
742 Revise a Topic
743 --------------
744 
745 If a topic is approved during GitLab review, skip to the
746 [next step](#merge-a-topic). Otherwise, revise the topic
747 and push it back to GitLab for another review as follows:
748 
749 1. Checkout the topic if it is not your current branch:
750 
751  $ git checkout my-topic
752 
753 2. To revise the `3`rd commit back on the topic:
754 
755  $ git rebase -i HEAD~3
756 
757  (Substitute the correct number of commits back, as low as `1`.)
758  Follow Git's interactive instructions.
759 
760 3. Return to the [above step](#share-a-topic) to share the revised topic.
761 
762 Merge a Topic
763 -------------
764 
765 Once review has concluded that the MR topic is ready for integration
766 (at least one `+2`), authorized developers may add a comment with a single
767 [*trailing* line](#trailing-lines):
768 
769  Do: merge
770 
771 to ask that the change be merged into the upstream repository. By
772 convention, do not request a merge if any `-1` or `Rejected-by:`
773 review comments have not been resolved and superseded by at least
774 `+1` or `Acked-by:` review comments from the same user.
775 
776 Developers are encouraged to merge their own merge requests on review. However,
777 please do not merge unless you are available to address any dashboard issues that may
778 arise. Developers who repeatedly ignore dashboard issues following their merges may
779 loose developer privileges to the repository temporarily (or permanently)!
780 
781 ### Merge Success ###
782 
783 If the merge succeeds the topic will appear in the upstream repository
784 `master` branch and the Merge Request will be closed automatically.
785 Any issues associated with the Merge Request will generally get closed
786 automatically. If not, the developer merging the changes should close such issues
787 and add a `workflow:customer-review` tag to the issue(s) addressed by the change.
788 Reporters and testers can then review the fix. Try to add enough information to
789 the Issue or the Merge Request to indicate how to test the functionality if not
790 obvious from the original Issue.
791 
792 ### Merge Failure ###
793 
794 If the merge fails (likely due to a conflict), a comment will be added
795 describing the failure. In the case of a conflict, fetch the latest
796 upstream history and rebase on it:
797 
798  $ git fetch origin
799  $ git rebase origin/master
800 
801 (If you are fixing a bug in the latest release then substitute
802 `origin/release` for `origin/master`.)
803 
804 Return to the [above step](#share-a-topic) to share the revised topic.
805 
806 Delete a Topic
807 --------------
808 
809 After a topic has been merged upstream the Merge Request will be closed.
810 Now you may delete your copies of the branch.
811 
812 1. In the GitLab Merge Request page a "**Remove Source Branch**"
813  button will appear. Use it to delete the `my-topic` branch
814  from your fork in GitLab.
815 
816 2. In your work tree checkout and update the `master` branch:
817 
818  $ git checkout master
819  $ git pull
820 
821 3. Delete the local topic branch:
822 
823  $ git branch -d my-topic
824 
825  The `branch -d` command works only when the topic branch has been
826  correctly merged. Use `-D` instead of `-d` to force the deletion
827  of an unmerged topic branch (warning - you could lose commits).
828 
829 Contribute VTK Changes
830 ----------------------
831 
832 If you have any VTK changes, then you are required to get your changes
833 incorporated into VTK using [VTK's development workflow][]. Once your VTK topic has
834 been approved and merged into VTK, then:
835 
836 1. Create a [ParaView topic](#create-a-topic) if you haven't already.
837 2. Add your VTK topic head (or the latest VTK
838  origin/master which includes your VTK topic head).
839 
840  $ cd VTK
841  $ git checkout master
842  $ cd ..
843  $ git add VTK
844  $ git commit
845 
846 3. Follow the merge process documented earlier.
847 
848 [VTK's development workflow]: https://gitlab.kitware.com/vtk/vtk/-/tree/master/Documentation/dev/git