github.com/jaylevin/jenkins-library@v1.230.4/documentation/docs/steps/transportRequestReqIDFromGit.md (about)

     1  # ${docGenStepName}
     2  
     3  ## ${docGenDescription}
     4  
     5  !!! note "Executed on Jenkins Master"
     6      This step is executed on the Jenkins master only. On the master node the project's Git repository is fully available. If kubernetes is used, the Git repository would have to be stashed. Depending on the size of the repository, this would be quite expensive or not possible at all.
     7  
     8  ## Administering the Transport Request ID by Git Commit Messages
     9  
    10  The `transport request ID` identifies a container in the ABAP development system that can be used to document and transport changes within the landscape.
    11  If you upload your pipeline artifacts into such a container, please provide the transport request ID in an upload step.
    12  See [transportRequestUploadSOLMAN](transportRequestUploadSOLMAN.md).
    13  
    14  With `transportRequestReqIDFromGit`  you can retrieve the transport request ID from the commit message of the Git repository of your project. This way, you can address the transport request without having to change the setup of your pipeline.
    15  Please make sure that the ID is unique in the defined search range.
    16  
    17  ### Specifying the Git Commit Message
    18  
    19  `transportRequestReqIDFromGit` searches for lines that follow a defined pattern in the Git commit messages (`git log`) of your project.
    20  Only if necessary, specify the pattern with the label _transportRequestLabel_ (default=`TransportRequest`).
    21  Behind the label, enter a colon, blank spaces, and the identifier.
    22  
    23  ```
    24  Upload - define the transport request ID
    25  
    26      TransportRequest: ABCD10005E
    27  ```
    28  
    29  ### Specifying the Git Commit Range
    30  
    31  The Git commit messages to be considered are determined by the parameters _gitFrom_ (default=`origin/master`) and _gitTo_ (default=`HEAD`).
    32  The naming follows the Git revision range notation `git log <gitFrom>..<gitTo>`.
    33  All commit messages accessible from _gitTo_ but not from _gitFrom_ are taken into account.
    34  Choose the commit range accordingly, as the detection of multiple IDs causes the scan to fail.
    35  
    36  Keep the default values `HEAD` and `origin/master` in case you want to retrieve the ID within the scope of a pull request.
    37  The default values should be sufficient provided that
    38  
    39  * you commit the transport request ID into the pull request
    40  * you do not merge the `origin/master` before the scan
    41  * you do not change the transport request ID while developing
    42  
    43  This way, only the commits (`HEAD`) that have not yet entered the main branch `origin/master` are scanned.
    44  
    45  ```
    46  o 3d97415 (origin/master) merged last change
    47  |
    48  | o d99fbf7 (HEAD) feature fixes
    49  | |
    50  | o 5c380ea TransportRequest: ABCD10001E
    51  | |
    52  | o 0e82d9b new feature
    53  |/
    54  o 4378bb4 last change
    55  ```
    56  
    57  If you want to retrieve the ID from the main branch, be aware that former transport request IDs may already be in the history.
    58  Adjust _gitFrom_ so that it points to a commit before your ID definition.
    59  
    60  ```yaml
    61  steps:
    62    transportRequestReqIDFromGit:
    63      gitFrom: '4378bb4'
    64  ```
    65  
    66  ```
    67  o 3d97415 (origin/master) merge new feature
    68  |
    69  o d99fbf7 feature fixes
    70  |
    71  o 5c380ea adjust config.yaml
    72  |           TransportRequest: ABCD10001E
    73  |
    74  o 0e82d9b new feature
    75  |
    76  o 4378bb4 merged last change
    77  ```
    78  
    79  Define _gitTo_, if it cannot be ruled out that further transport request IDs have been merged in parallel.
    80  
    81  ```yaml
    82  steps:
    83    transportRequestReqIDFromGit:
    84      gitFrom: '4378bb4'
    85      gitTo: 'd99fbf7'
    86  ```
    87  
    88  ```
    89  o 3d97415 (origin/master) merge new feature
    90  |\
    91  . o d99fbf7 feature fixes
    92  . |
    93  . o 5c380ea adjust config.yaml
    94  . |           TransportRequest: ABCD10001E
    95  . |
    96  . o 0e82d9b new feature
    97  |/
    98  o 4378bb4 merged last change
    99  ```
   100  
   101  ## ${docGenParameters}
   102  
   103  ## ${docGenConfiguration}
   104  
   105  ## ${docJenkinsPluginDependencies}
   106  
   107  ## Example
   108  
   109  ```groovy
   110  transportRequestReqIDFromGit( script: this )
   111  ```