|
| 1 | +== abapGit Examples |
| 2 | + |
| 3 | +=== One Way |
| 4 | + |
| 5 | +There are lots of ways to setup code reviews, this section introduces a simple implementation of the <<One Way Synchronization>>, with commits for each task release, the example can be extended according to the needs of each organization. |
| 6 | + |
| 7 | +A sample abapGit setup is provided at link:https://github.com/abapGit/abapgit-review-example[https://github.com/abapGit/abapgit-review-example], it can be installed via abapGit, and works together with GitHub. |
| 8 | + |
| 9 | +==== Setup |
| 10 | + |
| 11 | +GitHub setup required, |
| 12 | + |
| 13 | +. link:https://docs.github.com/en/github/getting-started-with-github/create-a-repo[Create repositories] |
| 14 | +. If needed, link:https://docs.github.com/en/github/administering-a-repository/about-protected-branches[setup branch protection] |
| 15 | +. link:https://docs.github.com/en/github/administering-a-repository/managing-the-automatic-deletion-of-branches[Enable automatic branch deletion] |
| 16 | + |
| 17 | +Multiple setup steps are required in the development system, |
| 18 | + |
| 19 | +. abapGit development edition link:https://docs.abapgit.org/guide-install.html#install-developer-version[installed] |
| 20 | +. Connectivity from the ABAP system to Github, link:https://docs.abapgit.org/guide-ssl-setup.html[SSL setup] |
| 21 | +. link:https://docs.abapgit.org/ref-exits.html#create_http_client[Background user authentication] |
| 22 | +. Online repositories are link:https://docs.abapgit.org/guide-online-install.html[created] and linked to the development packages |
| 23 | +. Enable abapGit link:https://docs.abapgit.org/ref-dot-abapgit.html#write-protected[write protection] for the repos |
| 24 | + |
| 25 | +==== Workflow |
| 26 | + |
| 27 | +For the release of each task, the following steps are performed: |
| 28 | + |
| 29 | +[plantuml,one-way-abapgit,svg,align="center"] |
| 30 | +.... |
| 31 | +@startuml |
| 32 | +scale 7/8 |
| 33 | +skinparam monochrome true |
| 34 | +
|
| 35 | +start |
| 36 | +:Determine repository; |
| 37 | +
|
| 38 | +if (Does branch exist?) then (no) |
| 39 | + :Create branch; |
| 40 | +else (yes) |
| 41 | +endif |
| 42 | +
|
| 43 | +:Push changes to branch; |
| 44 | +
|
| 45 | +if (Does PR exist?) then (no) |
| 46 | + :Create PR; |
| 47 | +else (yes) |
| 48 | +endif |
| 49 | +
|
| 50 | +stop |
| 51 | +@enduml |
| 52 | +.... |
| 53 | + |
| 54 | +For release of request, |
| 55 | + |
| 56 | +. Check PR is released, if not the request cannot be released |
| 57 | + |
| 58 | +// What happens if the PR is released but user wants to deliberately add further tasks (or accidentally does so)? see https://github.com/larshp/abapgit-review-example/issues/12 |
| 59 | + |
| 60 | +abapGit works on object level(`R3TR`), while the transport system works on subobject level(`LIMU`), if mirroring transports to git and subobjects exists in multiple transports, the abapGit based example will give an error. |
| 61 | + |
| 62 | +Transports must consistently match the git repositories, an error will be issued if a transport contains objects from multiple git repositories. |
| 63 | + |
| 64 | +The example is provided as a starting point, different organizations have different requirements and work processes, the example can be adjusted to fit any requirements. |
| 65 | + |
| 66 | +=== Two Way |
| 67 | + |
| 68 | +The developer uses the normal UI of abapGit, link:https://docs.abapgit.org/[pushing and pulling] all changes. |
| 69 | + |
| 70 | +If git is the only destination for the code, suggest disabling CTS transports to make it faster to do changes, eg. by developing in local packages. |
| 71 | + |
| 72 | +image::../images/abapgit1_107_0.png[abapGit UI] |
0 commit comments