├── .abapgit.xml ├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── abaplint.json ├── img ├── STMS.png ├── ZABAPGIT_CI_JOB_SCHEDULER.png ├── ZABAPGIT_CI_result.png └── ZABAPGIT_CI_selection_screen.png └── src ├── package.devc.xml ├── zabapgit_ci 0ca50b9bb4169d30653f67020.sicf.xml ├── zabapgit_ci.prog.abap ├── zabapgit_ci.prog.xml ├── zabapgit_ci_category.dtel.xml ├── zabapgit_ci_check_create_tr.dtel.xml ├── zabapgit_ci_check_delete_tr.dtel.xml ├── zabapgit_ci_check_leftovers.dtel.xml ├── zabapgit_ci_cleanup.prog.abap ├── zabapgit_ci_cleanup.prog.xml ├── zabapgit_ci_clone.dtel.xml ├── zabapgit_ci_clone_url.dtel.xml ├── zabapgit_ci_create_package.dtel.xml ├── zabapgit_ci_description.dtel.xml ├── zabapgit_ci_do_not_purge.dtel.xml ├── zabapgit_ci_duration.dtel.xml ├── zabapgit_ci_job_scheduler.prog.abap ├── zabapgit_ci_job_scheduler.prog.xml ├── zabapgit_ci_jobs.prog.abap ├── zabapgit_ci_jobs.prog.xml ├── zabapgit_ci_log.para.xml ├── zabapgit_ci_logging.dtel.xml ├── zabapgit_ci_message.dtel.xml ├── zabapgit_ci_object_check.dtel.xml ├── zabapgit_ci_objs.tabl.xml ├── zabapgit_ci_pull.dtel.xml ├── zabapgit_ci_purge.dtel.xml ├── zabapgit_ci_repo.fugr.lzabapgit_ci_repotop.abap ├── zabapgit_ci_repo.fugr.lzabapgit_ci_repotop.xml ├── zabapgit_ci_repo.fugr.saplzabapgit_ci_repo.abap ├── zabapgit_ci_repo.fugr.saplzabapgit_ci_repo.xml ├── zabapgit_ci_repo.fugr.xml ├── zabapgit_ci_repo.fugr.zabapgit_ci_process_repo.abap ├── zabapgit_ci_repo_name.dtel.xml ├── zabapgit_ci_result.tabl.xml ├── zabapgit_ci_result_gen.tabl.xml ├── zabapgit_ci_result_header.tabl.xml ├── zabapgit_ci_results.prog.abap ├── zabapgit_ci_results.prog.xml ├── zabapgit_ci_skip.dtel.xml ├── zabapgit_ci_status.doma.xml ├── zabapgit_ci_status.dtel.xml ├── zabapgit_ci_syntax_check.dtel.xml ├── zabapgit_ci_test_slack.prog.abap ├── zabapgit_ci_test_slack.prog.xml ├── zabapgit_ci_update_abapgit.prog.abap ├── zabapgit_ci_update_abapgit.prog.xml ├── zabapgit_ci_update_abapgit_ci.prog.abap ├── zabapgit_ci_update_abapgit_ci.prog.xml ├── zabapgit_ci_update_repo.prog.abap ├── zabapgit_ci_update_repo.prog.xml ├── zci.tran.xml ├── zcic.tran.xml ├── zcij.tran.xml ├── zcir.tran.xml ├── zcl_abapgit_ci_alv_view.clas.abap ├── zcl_abapgit_ci_alv_view.clas.locals_def.abap ├── zcl_abapgit_ci_alv_view.clas.locals_imp.abap ├── zcl_abapgit_ci_alv_view.clas.xml ├── zcl_abapgit_ci_controller.clas.abap ├── zcl_abapgit_ci_controller.clas.xml ├── zcl_abapgit_ci_distributor.clas.abap ├── zcl_abapgit_ci_distributor.clas.xml ├── zcl_abapgit_ci_generic_tests.clas.abap ├── zcl_abapgit_ci_generic_tests.clas.xml ├── zcl_abapgit_ci_github_conn.clas.abap ├── zcl_abapgit_ci_github_conn.clas.testclasses.abap ├── zcl_abapgit_ci_github_conn.clas.xml ├── zcl_abapgit_ci_html.clas.abap ├── zcl_abapgit_ci_html.clas.locals_def.abap ├── zcl_abapgit_ci_html.clas.locals_imp.abap ├── zcl_abapgit_ci_html.clas.xml ├── zcl_abapgit_ci_job_scheduler.clas.abap ├── zcl_abapgit_ci_job_scheduler.clas.xml ├── zcl_abapgit_ci_latest_build.clas.abap ├── zcl_abapgit_ci_latest_build.clas.xml ├── zcl_abapgit_ci_log.clas.abap ├── zcl_abapgit_ci_log.clas.xml ├── zcl_abapgit_ci_repo.clas.abap ├── zcl_abapgit_ci_repo.clas.xml ├── zcl_abapgit_ci_repo_category.clas.abap ├── zcl_abapgit_ci_repo_category.clas.testclasses.abap ├── zcl_abapgit_ci_repo_category.clas.xml ├── zcl_abapgit_ci_repo_check.clas.abap ├── zcl_abapgit_ci_repo_check.clas.xml ├── zcl_abapgit_ci_repos.clas.abap ├── zcl_abapgit_ci_repos.clas.xml ├── zcl_abapgit_ci_resource.clas.abap ├── zcl_abapgit_ci_resource.clas.locals_def.abap ├── zcl_abapgit_ci_resource.clas.locals_imp.abap ├── zcl_abapgit_ci_resource.clas.xml ├── zcl_abapgit_ci_rest.clas.abap ├── zcl_abapgit_ci_rest.clas.xml ├── zcl_abapgit_ci_run_abapgit_ut.clas.abap ├── zcl_abapgit_ci_run_abapgit_ut.clas.xml ├── zcl_abapgit_ci_skip.clas.abap ├── zcl_abapgit_ci_skip.clas.xml ├── zcl_abapgit_ci_slack.clas.abap ├── zcl_abapgit_ci_slack.clas.xml ├── zcl_abapgit_ci_test_repos.clas.abap ├── zcl_abapgit_ci_test_repos.clas.testclasses.abap ├── zcl_abapgit_ci_test_repos.clas.xml ├── zif_abapgit_ci_definitions.intf.abap ├── zif_abapgit_ci_definitions.intf.xml ├── zif_abapgit_ci_repo_provider.intf.abap ├── zif_abapgit_ci_repo_provider.intf.xml ├── zif_abapgit_ci_test.intf.abap ├── zif_abapgit_ci_test.intf.xml ├── zif_abapgit_ci_view.intf.abap └── zif_abapgit_ci_view.intf.xml /.abapgit.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E 6 | /src/ 7 | PREFIX 8 | 9 | /.gitignore 10 | /LICENSE 11 | /README.md 12 | /package.json 13 | /.travis.yml 14 | /abaplint.json 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # 1 space indentation for xml files 7 | [*.xml] 8 | charset = utf-8 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | indent_style = space 13 | indent_size = 1 14 | 15 | # match the format used by abapGit 16 | [*.{abap,js,json,html,css}] 17 | charset = utf-8 18 | end_of_line = lf 19 | insert_final_newline = true 20 | trim_trailing_whitespace = true 21 | indent_size = 2 22 | indent_style = space 23 | 24 | # YAML and Bash Files 25 | [*.{yml,yaml,sh}] 26 | charset = utf-8 27 | end_of_line = lf 28 | insert_final_newline = true 29 | trim_trailing_whitespace = true 30 | indent_size = 2 31 | indent_style = space 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | deps1 2 | deps2 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Christian Günter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # abapGit CI backend 2 | 3 | Latest build: https://ci.abapgit.org 4 | 5 | This repo provides basic continous intergration capabilities for abapGit. 6 | 7 | For details, see the [abapGit Development Documentation](https://docs.abapgit.org/development/ci.html). 8 | 9 | ![Example](/img/ZABAPGIT_CI_result.png) 10 | -------------------------------------------------------------------------------- /abaplint.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "url": "https://github.com/abaplint/deps", 5 | "files": "/src/**/*.*", 6 | "folder": "/deps1" 7 | }, 8 | { 9 | "url": "https://github.com/abapGit/abapGit", 10 | "files": "/src/**/*.*", 11 | "folder": "/deps2" 12 | } 13 | ], 14 | "global": { 15 | "exclude": [], 16 | "files": "/src/**/*.*", 17 | "noIssues": [], 18 | "skipGeneratedBOPFInterfaces": false, 19 | "skipGeneratedFunctionGroups": false, 20 | "skipGeneratedGatewayClasses": false, 21 | "skipGeneratedPersistentClasses": false, 22 | "skipGeneratedProxyClasses": false, 23 | "skipGeneratedProxyInterfaces": false, 24 | "skipIncludesWithoutMain": false, 25 | "useApackDependencies": false 26 | }, 27 | "rules": { 28 | "7bit_ascii": true, 29 | "abapdoc": false, 30 | "align_parameters": false, 31 | "allowed_object_naming": true, 32 | "allowed_object_types": true, 33 | "ambiguous_statement": true, 34 | "avoid_use": { 35 | "break": true, 36 | "defaultKey": false, 37 | "define": true, 38 | "describeLines": true, 39 | "skipQuickFix": false, 40 | "statics": true, 41 | "testSeams": true 42 | }, 43 | "begin_end_names": true, 44 | "begin_single_include": true, 45 | "call_transaction_authority_check": true, 46 | "cds_comment_style": true, 47 | "cds_legacy_view": true, 48 | "cds_parser_error": true, 49 | "chain_mainly_declarations": true, 50 | "change_if_to_case": true, 51 | "check_abstract": true, 52 | "check_comments": false, 53 | "check_ddic": true, 54 | "check_include": true, 55 | "check_subrc": false, 56 | "check_syntax": true, 57 | "check_text_elements": true, 58 | "check_transformation_exists": true, 59 | "class_attribute_names": true, 60 | "classic_exceptions_overlap": true, 61 | "cloud_types": true, 62 | "colon_missing_space": true, 63 | "commented_code": true, 64 | "constant_classes": true, 65 | "constructor_visibility_public": true, 66 | "contains_tab": true, 67 | "cyclic_oo": true, 68 | "cyclomatic_complexity": true, 69 | "dangerous_statement": { 70 | "deleteDynpro": true, 71 | "deleteReport": false, 72 | "deleteTextpool": true, 73 | "dynamicSQL": true, 74 | "execSQL": true, 75 | "exportDynpro": true, 76 | "generateDynpro": true, 77 | "generateReport": true, 78 | "generateSubroutine": true, 79 | "insertReport": false, 80 | "kernelCall": true, 81 | "systemCall": true 82 | }, 83 | "db_operation_in_loop": false, 84 | "definitions_top": true, 85 | "description_empty": true, 86 | "double_space": true, 87 | "downport": true, 88 | "empty_line_in_statement": { 89 | "allowChained": true 90 | }, 91 | "empty_statement": true, 92 | "empty_structure": true, 93 | "exit_or_check": true, 94 | "expand_macros": true, 95 | "exporting": true, 96 | "forbidden_identifier": true, 97 | "forbidden_pseudo_and_pragma": true, 98 | "forbidden_void_type": true, 99 | "form_tables_obsolete": true, 100 | "fully_type_constants": true, 101 | "function_module_recommendations": false, 102 | "functional_writing": true, 103 | "global_class": true, 104 | "identical_conditions": true, 105 | "identical_contents": true, 106 | "identical_descriptions": true, 107 | "identical_form_names": true, 108 | "if_in_if": true, 109 | "implement_methods": true, 110 | "in_statement_indentation": false, 111 | "indentation": { 112 | "alignTryCatch": false, 113 | "globalClassSkipFirst": false, 114 | "ignoreExceptions": true, 115 | "ignoreGlobalClassDefinition": false, 116 | "ignoreGlobalInterface": false, 117 | "selectionScreenBlockIndentation": true 118 | }, 119 | "inline_data_old_versions": true, 120 | "intf_referencing_clas": true, 121 | "keep_single_parameter_on_one_line": true, 122 | "keyword_case": true, 123 | "line_break_multiple_parameters": true, 124 | "line_break_style": false, 125 | "line_length": true, 126 | "line_only_punc": true, 127 | "local_class_naming": true, 128 | "local_testclass_consistency": true, 129 | "local_variable_names": true, 130 | "main_file_contents": true, 131 | "many_parentheses": true, 132 | "max_one_method_parameter_per_line": true, 133 | "max_one_statement": true, 134 | "message_exists": true, 135 | "method_implemented_twice": true, 136 | "method_length": true, 137 | "method_overwrites_builtin": true, 138 | "method_parameter_names": true, 139 | "mix_returning": true, 140 | "modify_only_own_db_tables": { 141 | "exclude": [ 142 | "zabapgit_ci_cleanup.prog.abap", 143 | "zcl_abapgit_ci_repo.clas.abap" 144 | ], 145 | "ownTables": "^[yz]", 146 | "reportDynamic": true 147 | }, 148 | "msag_consistency": true, 149 | "names_no_dash": true, 150 | "nesting": true, 151 | "newline_between_methods": true, 152 | "no_aliases": true, 153 | "no_chained_assignment": true, 154 | "no_external_form_calls": { 155 | "exclude": [ 156 | "zabapgit_ci_results.prog.abap" 157 | ] 158 | }, 159 | "no_inline_in_optional_branches": false, 160 | "no_public_attributes": { 161 | "allowReadOnly": true, 162 | "ignoreTestClasses": false 163 | }, 164 | "no_yoda_conditions": true, 165 | "nrob_consistency": true, 166 | "object_naming": true, 167 | "obsolete_statement": true, 168 | "omit_parameter_name": true, 169 | "omit_preceding_zeros": true, 170 | "omit_receiving": true, 171 | "parser_702_chaining": true, 172 | "parser_error": true, 173 | "parser_missing_space": true, 174 | "pragma_style": true, 175 | "prefer_corresponding": true, 176 | "prefer_inline": false, 177 | "prefer_is_not": true, 178 | "prefer_raise_exception_new": true, 179 | "prefer_returning_to_exporting": true, 180 | "prefer_xsdbool": false, 181 | "preferred_compare_operator": true, 182 | "prefix_is_current_class": true, 183 | "reduce_string_templates": true, 184 | "release_idoc": true, 185 | "remove_descriptions": true, 186 | "rfc_error_handling": true, 187 | "select_add_order_by": true, 188 | "select_performance": false, 189 | "selection_screen_naming": false, 190 | "sequential_blank": true, 191 | "short_case": true, 192 | "sicf_consistency": true, 193 | "slow_parameter_passing": true, 194 | "space_before_colon": true, 195 | "space_before_dot": true, 196 | "sql_escape_host_variables": true, 197 | "start_at_tab": true, 198 | "static_call_via_instance": true, 199 | "superclass_final": true, 200 | "superfluous_value": true, 201 | "sy_modification": true, 202 | "tabl_enhancement_category": true, 203 | "try_without_catch": true, 204 | "type_form_parameters": true, 205 | "types_naming": false, 206 | "uncaught_exception": true, 207 | "unknown_types": true, 208 | "unnecessary_chaining": false, 209 | "unnecessary_pragma": true, 210 | "unnecessary_return": false, 211 | "unreachable_code": true, 212 | "unsecure_fae": true, 213 | "unused_ddic": true, 214 | "unused_methods": true, 215 | "unused_types": true, 216 | "unused_variables": true, 217 | "use_bool_expression": true, 218 | "use_class_based_exceptions": true, 219 | "use_line_exists": false, 220 | "use_new": false, 221 | "when_others_last": true, 222 | "whitespace_end": true, 223 | "xml_consistency": true 224 | }, 225 | "syntax": { 226 | "errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)", 227 | "globalConstants": [ 228 | "skwfc_obtype_loio" 229 | ], 230 | "globalMacros": [], 231 | "version": "v750" 232 | } 233 | } 234 | -------------------------------------------------------------------------------- /img/STMS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abapGit/CI/49c87ba0ccb27151790d325b1d2b18032223bb89/img/STMS.png -------------------------------------------------------------------------------- /img/ZABAPGIT_CI_JOB_SCHEDULER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abapGit/CI/49c87ba0ccb27151790d325b1d2b18032223bb89/img/ZABAPGIT_CI_JOB_SCHEDULER.png -------------------------------------------------------------------------------- /img/ZABAPGIT_CI_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abapGit/CI/49c87ba0ccb27151790d325b1d2b18032223bb89/img/ZABAPGIT_CI_result.png -------------------------------------------------------------------------------- /img/ZABAPGIT_CI_selection_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abapGit/CI/49c87ba0ccb27151790d325b1d2b18032223bb89/img/ZABAPGIT_CI_selection_screen.png -------------------------------------------------------------------------------- /src/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | abapGit CI 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/zabapgit_ci 0ca50b9bb4169d30653f67020.sicf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | /sap/zabapgit_ci/ 6 | 7 | ZABAPGIT_CI 8 | zabapgit_ci 9 | 10 | 11 | ZABAPGIT_CI 12 | E 13 | abapGit CI 14 | 15 | 16 | 17 | ZABAPGIT_CI 18 | 01 19 | A 20 | ZCL_ABAPGIT_CI_REST 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/zabapgit_ci.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI 7 | S 8 | 1 9 | X 10 | D$S 11 | X 12 | 13 | 14 | 15 | I 16 | B01 17 | Description 18 | 21 19 | 20 | 21 | I 22 | B02 23 | Publish Results 24 | 17 25 | 26 | 27 | I 28 | B03 29 | Slack Integration 30 | 27 31 | 32 | 33 | I 34 | B04 35 | Checks 36 | 16 37 | 38 | 39 | I 40 | B05 41 | Repositories 42 | 40 43 | 44 | 45 | I 46 | B06 47 | Troubleshooting 48 | 40 49 | 50 | 51 | I 52 | D01 53 | This report starts the abapGit CI process (https://github.com/abapGit/CI) 54 | 112 55 | 56 | 57 | I 58 | D03 59 | Tests repos are fetched from https://github.com/abapGit-tests 60 | 124 61 | 62 | 63 | I 64 | D04 65 | The following steps are executed for each repo 66 | 92 67 | 68 | 69 | I 70 | D05 71 | - create package (if needed) 72 | 56 73 | 74 | 75 | I 76 | D06 77 | - clone 78 | 15 79 | 80 | 81 | I 82 | D07 83 | - pull 84 | 14 85 | 86 | 87 | I 88 | D08 89 | - syntax check 90 | 22 91 | 92 | 93 | I 94 | D09 95 | - purge (uninstall) 96 | 27 97 | 98 | 99 | I 100 | O01 101 | You can optionally push the results to a Git repo. The results will be 102 | 132 103 | 104 | 105 | I 106 | O02 107 | stored in the MIME repository and then the file is pushed to the 108 | 128 109 | 110 | 111 | I 112 | O03 113 | specified git repository. 114 | 50 115 | 116 | 117 | R 118 | abapGit CI 119 | 10 120 | 121 | 122 | S 123 | CREATEP 124 | Create packages 125 | 23 126 | 127 | 128 | S 129 | GENERIC 130 | Generic checks 131 | 22 132 | 133 | 134 | S 135 | LAYER 136 | . 137 | 23 138 | D 139 | 140 | 141 | S 142 | NO_PURGE 143 | Do not purge repos 144 | 26 145 | 146 | 147 | S 148 | P_HIST 149 | Save results to history folder 150 | 38 151 | 152 | 153 | S 154 | P_LOG 155 | Log diffs, objects, messages 156 | 36 157 | 158 | 159 | S 160 | P_NOSKIP 161 | Ignore skipping repos 162 | 29 163 | 164 | 165 | S 166 | P_SAVE 167 | Save results without push 168 | 33 169 | 170 | 171 | S 172 | P_SYNC 173 | Synchronous processing 174 | 30 175 | 176 | 177 | S 178 | P_URL 179 | URL 180 | 11 181 | 182 | 183 | S 184 | REPO 185 | Repository checks 186 | 25 187 | 188 | 189 | S 190 | REPOL 191 | Check local packages ($___) 192 | 35 193 | 194 | 195 | S 196 | REPOT 197 | Check transp. packages (Z___) 198 | 37 199 | 200 | 201 | S 202 | SLACK 203 | Post errors to Slack channel 204 | 36 205 | 206 | 207 | S 208 | S_CATS 209 | Categories 210 | 18 211 | 212 | 213 | S 214 | S_REPOS 215 | Repo names 216 | 18 217 | 218 | 219 | S 220 | TOKEN 221 | Slack OAuth Token 222 | 25 223 | 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /src/zabapgit_ci_category.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CATEGORY 7 | E 8 | 55 9 | 10 10 | 20 11 | 40 12 | abapGit CI: Category 13 | Category 14 | Category 15 | Category 16 | Category 17 | E 18 | CHAR 19 | 000255 20 | 000255 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/zabapgit_ci_check_create_tr.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CHECK_CREATE_TR 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Create transport status 14 | Create TR 15 | Create TR 16 | Create TR 17 | Create TR 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_check_delete_tr.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CHECK_DELETE_TR 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Delete transport status 14 | Delete TR 15 | Delete TR 16 | Delete TR 17 | Delete TR 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_check_leftovers.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CHECK_LEFTOVERS 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Left overs status 14 | Leftovers 15 | Leftovers 16 | Leftovers 17 | Leftovers 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_cleanup.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CLEANUP 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 | I 17 | 001 18 | Mass uninstall abapGit repositories 19 | 70 20 | 21 | 22 | I 23 | 002 24 | Mass release transport requests 25 | 62 26 | 27 | 28 | R 29 | abapGit CI: Cleanup utility 30 | 27 31 | 32 | 33 | S 34 | P_ALL 35 | All-in-on clean-up 36 | 26 37 | 38 | 39 | S 40 | P_FORC 41 | Force deletion (ignore errors) 42 | 38 43 | 44 | 45 | S 46 | P_FORCE 47 | Force release (ignore errors) 48 | 37 49 | 50 | 51 | S 52 | P_LIST 53 | Show all leftovers 54 | 27 55 | 56 | 57 | S 58 | P_LOG 59 | Remove logs 60 | 19 61 | 62 | 63 | S 64 | P_OBJ 65 | Remove leftover objects 66 | 31 67 | 68 | 69 | S 70 | P_OTR 71 | Remove leftover texts (OTR) 72 | 35 73 | 74 | 75 | S 76 | P_PACK 77 | Remove empty packages 78 | 29 79 | 80 | 81 | S 82 | P_POPUP 83 | Prompt for transport 84 | 28 85 | 86 | 87 | S 88 | P_PREV 89 | Preview transports 90 | 26 91 | 92 | 93 | S 94 | P_PURGE 95 | Purge and delete repositories 96 | 37 97 | 98 | 99 | S 100 | P_REMOV 101 | Delete repositories 102 | 27 103 | 104 | 105 | S 106 | P_TRREL 107 | Release transports / tasks 108 | 34 109 | 110 | 111 | S 112 | P_TXT 113 | Transport short description 114 | 35 115 | 116 | 117 | S 118 | P_UNINST 119 | Uninstall repositories 120 | 30 121 | 122 | 123 | S 124 | S_PACK 125 | . 126 | 15 127 | D 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /src/zabapgit_ci_clone.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CLONE 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Clone status 14 | Clone 15 | Clone 16 | Clone 17 | Clone 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_clone_url.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CLONE_URL 7 | E 8 | CHAR255 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Clone URL 14 | Clone URL 15 | Clone URL 16 | Clone URL 17 | Clone URL 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_create_package.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_CREATE_PACKAGE 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Create package status 14 | Create Package 15 | Creat Pack 16 | Create Package 17 | Create Package 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_description.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_DESCRIPTION 7 | E 8 | CHAR255 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Test description 14 | Description 15 | Descript. 16 | Description 17 | Description 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_do_not_purge.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_DO_NOT_PURGE 7 | E 8 | XFELD 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Do not purge 14 | No Purge 15 | No Purge 16 | No Purge 17 | No Purge 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_duration.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_DURATION 7 | E 8 | 55 9 | 10 10 | 15 11 | 40 12 | abapGit CI: Duration 13 | Duration in Sec. 14 | Time (Sec) 15 | Duration in Sec 16 | Duration in Seconds 17 | E 18 | DEC 19 | 000008 20 | 000001 21 | 000011 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/zabapgit_ci_job_scheduler.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_job_scheduler 3 | *&---------------------------------------------------------------------* 4 | *& Schedule abapGit CI processes 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_job_scheduler. 8 | 9 | TABLES: sscrfields. 10 | 11 | SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE TEXT-000. 12 | SELECTION-SCREEN COMMENT: 13 | 1(79) comm1, 14 | /1(79) comm2, 15 | /1(79) comm3, 16 | /1(79) comm4, 17 | /1(79) comm6. 18 | SELECTION-SCREEN SKIP. 19 | SELECTION-SCREEN COMMENT: 20 | /1(79) comm5. 21 | SELECTION-SCREEN SKIP. 22 | SELECTION-SCREEN END OF BLOCK b0. 23 | 24 | SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001. 25 | SELECTION-SCREEN BEGIN OF LINE. 26 | SELECTION-SCREEN COMMENT 1(30) cvar1. 27 | PARAMETERS: p_var1 TYPE raldb-variant. 28 | SELECTION-SCREEN PUSHBUTTON 50(25) but1 USER-COMMAND cli1. 29 | SELECTION-SCREEN END OF LINE. 30 | SELECTION-SCREEN BEGIN OF LINE. 31 | SELECTION-SCREEN COMMENT 1(30) cvar2. 32 | PARAMETERS: p_var2 TYPE raldb-variant. 33 | SELECTION-SCREEN PUSHBUTTON 50(25) but2 USER-COMMAND cli2. 34 | SELECTION-SCREEN END OF LINE. 35 | SELECTION-SCREEN BEGIN OF LINE. 36 | SELECTION-SCREEN COMMENT 1(30) cvar3. 37 | PARAMETERS: p_var3 TYPE raldb-variant. 38 | SELECTION-SCREEN PUSHBUTTON 50(25) but3 USER-COMMAND cli3. 39 | SELECTION-SCREEN END OF LINE. 40 | SELECTION-SCREEN SKIP. 41 | SELECTION-SCREEN BEGIN OF LINE. 42 | SELECTION-SCREEN COMMENT 1(79) comm7. 43 | SELECTION-SCREEN END OF LINE. 44 | SELECTION-SCREEN BEGIN OF LINE. 45 | SELECTION-SCREEN COMMENT 1(30) cvar4. 46 | PARAMETERS: p_var4 TYPE raldb-variant. 47 | SELECTION-SCREEN PUSHBUTTON 50(25) but4 USER-COMMAND cli4. 48 | SELECTION-SCREEN END OF LINE. 49 | SELECTION-SCREEN BEGIN OF LINE. 50 | SELECTION-SCREEN COMMENT 1(30) cvar5. 51 | PARAMETERS: p_var5 TYPE raldb-variant. 52 | SELECTION-SCREEN PUSHBUTTON 50(25) but5 USER-COMMAND cli5. 53 | SELECTION-SCREEN END OF LINE. 54 | SELECTION-SCREEN BEGIN OF LINE. 55 | SELECTION-SCREEN COMMENT 1(30) cvar6. 56 | PARAMETERS: p_var6 TYPE raldb-variant. 57 | SELECTION-SCREEN PUSHBUTTON 50(25) but6 USER-COMMAND cli6. 58 | SELECTION-SCREEN END OF LINE. 59 | SELECTION-SCREEN END OF BLOCK b1. 60 | 61 | CLASS lcl_controller DEFINITION. 62 | 63 | PUBLIC SECTION. 64 | CLASS-METHODS: 65 | program_variant_f4 66 | IMPORTING 67 | iv_program TYPE sy-repid 68 | CHANGING 69 | cv_variant TYPE raldb-variant, 70 | 71 | at_selection_screen, 72 | 73 | check_variant 74 | IMPORTING 75 | iv_variant TYPE raldb-variant 76 | iv_report TYPE rsvar-report 77 | RAISING 78 | zcx_abapgit_exception. 79 | 80 | METHODS: 81 | start 82 | RAISING 83 | zcx_abapgit_exception. 84 | 85 | PRIVATE SECTION. 86 | METHODS: 87 | call_job_overview. 88 | 89 | ENDCLASS. 90 | 91 | CLASS lcl_controller IMPLEMENTATION. 92 | 93 | METHOD start. 94 | 95 | NEW zcl_abapgit_ci_job_scheduler( 96 | iv_variant_update_abapgit = p_var1 97 | iv_variant_update_abapgit_ci = p_var2 98 | iv_variant_run_abapgit_ci = p_var3 99 | iv_variant_cleanup1_abapgit_ci = p_var4 100 | iv_variant_cleanup2_abapgit_ci = p_var5 101 | iv_variant_cleanup3_abapgit_ci = p_var6 102 | )->schedule_jobs( ). 103 | 104 | MESSAGE |Job scheduled successfully| TYPE 'S'. 105 | 106 | IF zcl_abapgit_ui_factory=>get_frontend_services( )->gui_is_available( ). 107 | call_job_overview( ). 108 | ENDIF. 109 | 110 | ENDMETHOD. 111 | 112 | METHOD program_variant_f4. 113 | 114 | CALL FUNCTION 'RS_VARIANT_CATALOG' 115 | EXPORTING 116 | report = iv_program 117 | IMPORTING 118 | sel_variant = cv_variant 119 | EXCEPTIONS 120 | no_report = 1 121 | report_not_existent = 2 122 | report_not_supplied = 3 123 | no_variants = 4 124 | no_variant_selected = 5 125 | variant_not_existent = 6 126 | OTHERS = 7. 127 | 128 | IF sy-subrc <> 0. 129 | MESSAGE ID sy-msgid 130 | TYPE 'S' 131 | NUMBER sy-msgno 132 | DISPLAY LIKE sy-msgty 133 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 134 | ENDIF. 135 | 136 | ENDMETHOD. 137 | 138 | 139 | METHOD at_selection_screen. 140 | 141 | DATA: lv_report TYPE rsvar-report, 142 | lv_variant TYPE rsvar-variant. 143 | 144 | CASE sscrfields-ucomm. 145 | WHEN 'CLI1'. 146 | 147 | lv_report = zcl_abapgit_ci_job_scheduler=>co_report-update_abapgit. 148 | lv_variant = p_var1. 149 | 150 | WHEN 'CLI2'. 151 | 152 | lv_report = zcl_abapgit_ci_job_scheduler=>co_report-update_abapgit_ci. 153 | lv_variant = p_var2. 154 | 155 | WHEN 'CLI3'. 156 | 157 | lv_report = zcl_abapgit_ci_job_scheduler=>co_report-run_abapgit_ci. 158 | lv_variant = p_var3. 159 | 160 | WHEN 'CLI4'. 161 | 162 | lv_report = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci. 163 | lv_variant = p_var4. 164 | 165 | WHEN 'CLI5'. 166 | 167 | lv_report = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci. 168 | lv_variant = p_var5. 169 | 170 | WHEN 'CLI6'. 171 | 172 | lv_report = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci. 173 | lv_variant = p_var6. 174 | 175 | WHEN OTHERS. 176 | 177 | RETURN. 178 | 179 | ENDCASE. 180 | 181 | CALL FUNCTION 'RS_VARIANT_SCREEN' 182 | EXPORTING 183 | report = lv_report 184 | variant = p_var1 185 | IMPORTING 186 | variant = p_var1. 187 | 188 | ENDMETHOD. 189 | 190 | 191 | METHOD call_job_overview. 192 | 193 | DATA: ls_jobsel_params TYPE btcselect. 194 | 195 | ls_jobsel_params-abapname = |*ZABAPGIT_CI*|. 196 | ls_jobsel_params-jobname = |*ABAPGIT*CI*|. 197 | ls_jobsel_params-username = sy-uname. 198 | ls_jobsel_params-from_date = sy-datum. 199 | ls_jobsel_params-to_date = sy-datum + 1. 200 | ls_jobsel_params-from_time = sy-uzeit - 30. 201 | ls_jobsel_params-to_time = |235959|. 202 | ls_jobsel_params-prelim = abap_true. 203 | ls_jobsel_params-schedul = abap_true. 204 | ls_jobsel_params-ready = abap_true. 205 | ls_jobsel_params-running = abap_true. 206 | ls_jobsel_params-finished = abap_true. 207 | ls_jobsel_params-aborted = abap_true. 208 | 209 | CALL FUNCTION 'BP_JOB_MAINTENANCE_SM37B' 210 | EXPORTING 211 | o_jobsel_params = ls_jobsel_params 212 | EXCEPTIONS 213 | unknown_selection_error = 1 214 | OTHERS = 2. 215 | 216 | IF sy-subrc <> 0. 217 | MESSAGE ID sy-msgid 218 | TYPE 'S' 219 | NUMBER sy-msgno 220 | DISPLAY LIKE sy-msgty 221 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 222 | ENDIF. 223 | 224 | ENDMETHOD. 225 | 226 | 227 | METHOD check_variant. 228 | 229 | DATA: lv_rc TYPE sy-subrc. 230 | 231 | IF iv_variant IS INITIAL. 232 | RETURN. 233 | ENDIF. 234 | 235 | CALL FUNCTION 'RS_VARIANT_EXISTS' 236 | EXPORTING 237 | report = iv_report 238 | variant = iv_variant 239 | IMPORTING 240 | r_c = lv_rc 241 | EXCEPTIONS 242 | not_authorized = 1 243 | no_report = 2 244 | report_not_existent = 3 245 | report_not_supplied = 4 246 | OTHERS = 5. 247 | 248 | IF sy-subrc <> 0 OR lv_rc > 0. 249 | MESSAGE |Variant { iv_variant } doesn't exist for report { iv_report }| TYPE 'E'. 250 | ENDIF. 251 | 252 | ENDMETHOD. 253 | 254 | ENDCLASS. 255 | 256 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var1. 257 | lcl_controller=>program_variant_f4( 258 | EXPORTING 259 | iv_program = zcl_abapgit_ci_job_scheduler=>co_report-update_abapgit 260 | CHANGING 261 | cv_variant = p_var1 ). 262 | 263 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2. 264 | lcl_controller=>program_variant_f4( 265 | EXPORTING 266 | iv_program = zcl_abapgit_ci_job_scheduler=>co_report-update_abapgit_ci 267 | CHANGING 268 | cv_variant = p_var2 ). 269 | 270 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var3. 271 | lcl_controller=>program_variant_f4( 272 | EXPORTING 273 | iv_program = zcl_abapgit_ci_job_scheduler=>co_report-run_abapgit_ci 274 | CHANGING 275 | cv_variant = p_var3 ). 276 | 277 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var4. 278 | lcl_controller=>program_variant_f4( 279 | EXPORTING 280 | iv_program = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci 281 | CHANGING 282 | cv_variant = p_var4 ). 283 | 284 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var5. 285 | lcl_controller=>program_variant_f4( 286 | EXPORTING 287 | iv_program = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci 288 | CHANGING 289 | cv_variant = p_var5 ). 290 | 291 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var6. 292 | lcl_controller=>program_variant_f4( 293 | EXPORTING 294 | iv_program = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci 295 | CHANGING 296 | cv_variant = p_var6 ). 297 | 298 | AT SELECTION-SCREEN ON p_var1. 299 | lcl_controller=>check_variant( iv_report = zcl_abapgit_ci_job_scheduler=>co_report-update_abapgit 300 | iv_variant = p_var1 ). 301 | 302 | AT SELECTION-SCREEN ON p_var2. 303 | lcl_controller=>check_variant( iv_report = zcl_abapgit_ci_job_scheduler=>co_report-update_abapgit_ci 304 | iv_variant = p_var2 ). 305 | 306 | AT SELECTION-SCREEN ON p_var3. 307 | lcl_controller=>check_variant( iv_report = zcl_abapgit_ci_job_scheduler=>co_report-run_abapgit_ci 308 | iv_variant = p_var3 ). 309 | 310 | AT SELECTION-SCREEN ON p_var4. 311 | lcl_controller=>check_variant( iv_report = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci 312 | iv_variant = p_var4 ). 313 | 314 | AT SELECTION-SCREEN ON p_var5. 315 | lcl_controller=>check_variant( iv_report = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci 316 | iv_variant = p_var5 ). 317 | 318 | AT SELECTION-SCREEN ON p_var6. 319 | lcl_controller=>check_variant( iv_report = zcl_abapgit_ci_job_scheduler=>co_report-cleanup_abapgit_ci 320 | iv_variant = p_var6 ). 321 | 322 | AT SELECTION-SCREEN. 323 | lcl_controller=>at_selection_screen( ). 324 | 325 | INITIALIZATION. 326 | comm1 = TEXT-c01. 327 | comm2 = TEXT-c02. 328 | comm3 = TEXT-c03. 329 | comm4 = TEXT-c04. 330 | comm5 = TEXT-c05. 331 | comm6 = TEXT-c06. 332 | comm7 = TEXT-c07. 333 | 334 | cvar1 = TEXT-v01. 335 | cvar2 = TEXT-v02. 336 | cvar3 = TEXT-v03. 337 | cvar4 = TEXT-v04. 338 | cvar5 = TEXT-v05. 339 | cvar6 = TEXT-v06. 340 | 341 | but1 = |{ icon_change } { TEXT-b01 }|. 342 | but2 = |{ icon_change } { TEXT-b01 }|. 343 | but3 = |{ icon_change } { TEXT-b01 }|. 344 | but4 = |{ icon_change } { TEXT-b01 }|. 345 | but5 = |{ icon_change } { TEXT-b01 }|. 346 | but6 = |{ icon_change } { TEXT-b01 }|. 347 | 348 | START-OF-SELECTION. 349 | TRY. 350 | NEW lcl_controller( )->start( ). 351 | 352 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 353 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 354 | ENDTRY. 355 | -------------------------------------------------------------------------------- /src/zabapgit_ci_job_scheduler.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_JOB_SCHEDULER 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 | I 17 | 000 18 | Description 19 | 21 20 | 21 | 22 | I 23 | 001 24 | Program Variants 25 | 25 26 | 27 | 28 | I 29 | B01 30 | Maintain variant 31 | 26 32 | 33 | 34 | I 35 | C01 36 | This report schedules abapGit CI reports: 37 | 82 38 | 39 | 40 | I 41 | C02 42 | 1. Update abapGit repo 43 | 44 44 | 45 | 46 | I 47 | C03 48 | 2. Update abapGit CI repo 49 | 50 50 | 51 | 52 | I 53 | C04 54 | 3. Run abapGit CI 55 | 27 56 | 57 | 58 | I 59 | C05 60 | You can schedule this report to run the abapGit CI chain periodically 61 | 96 62 | 63 | 64 | I 65 | C06 66 | 4. Clean-up abapGit CI tests 67 | 50 68 | 69 | 70 | I 71 | C07 72 | Enter up to three variants to run clean-up tasks: 73 | 60 74 | 75 | 76 | I 77 | V01 78 | ZABAPGIT_CI_UPDATE_ABAPGIT 79 | 26 80 | 81 | 82 | I 83 | V02 84 | ZABAPGIT_CI_UPDATE_ABAPGIT_CI 85 | 29 86 | 87 | 88 | I 89 | V03 90 | ZABAPGIT_CI 91 | 11 92 | 93 | 94 | I 95 | V04 96 | ZABAPGIT_CI_CLEANUP 97 | 29 98 | 99 | 100 | I 101 | V05 102 | ZABAPGIT_CI_CLEANUP 103 | 29 104 | 105 | 106 | I 107 | V06 108 | ZABAPGIT_CI_CLEANUP 109 | 29 110 | 111 | 112 | R 113 | abapGit CI: Schedule job sequence 114 | 33 115 | 116 | 117 | S 118 | P_VAR1 119 | ZABAPGIT_CI_UPDATE_ABAPGIT 120 | 34 121 | 122 | 123 | S 124 | P_VAR2 125 | ZABAPGIT_CI_UPDATE_ABAPGIT_CI 126 | 37 127 | 128 | 129 | S 130 | P_VAR3 131 | ZABAPGIT_CI 132 | 19 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /src/zabapgit_ci_jobs.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_jobs 3 | *&---------------------------------------------------------------------* 4 | *& Display abapGit CI jobs 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_jobs. 8 | 9 | DATA gs_jobsel TYPE btcselect. 10 | 11 | gs_jobsel-jobname = 'ZABAPGIT_CI*'. 12 | gs_jobsel-username = '*'. 13 | gs_jobsel-from_date = sy-datum - 1. 14 | gs_jobsel-to_date = sy-datum. 15 | gs_jobsel-aborted = abap_true. 16 | gs_jobsel-finished = abap_true. 17 | gs_jobsel-ready = abap_true. 18 | gs_jobsel-running = abap_true. 19 | gs_jobsel-prelim = abap_true. 20 | gs_jobsel-schedul = abap_true. 21 | 22 | CALL FUNCTION 'BP_JOB_MAINTENANCE_SM37B' 23 | EXPORTING 24 | o_jobsel_params = gs_jobsel 25 | EXCEPTIONS 26 | unknown_selection_error = 1 27 | OTHERS = 2. 28 | IF sy-subrc <> 0. 29 | MESSAGE 'Selection error' TYPE 'E'. 30 | ENDIF. 31 | -------------------------------------------------------------------------------- /src/zabapgit_ci_jobs.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_JOBS 7 | 1 8 | E 9 | X 10 | X 11 | 12 | 13 | 14 | R 15 | abapGit CI: Display jobs 16 | 24 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/zabapgit_ci_log.para.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_LOG 7 | 8 | 9 | ZABAPGIT_CI_LOG 10 | E 11 | abapGit CI: Log Setting (ENQ, DIFF, MSG, OBJ, SYNTAX, TADIR) 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/zabapgit_ci_logging.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_LOGGING 7 | E 8 | XFELD 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Logging 14 | Logging 15 | Logging 16 | Logging 17 | Logging 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_message.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_MESSAGE 7 | E 8 | CHAR255 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Error message 14 | Error Message 15 | Error Msg 16 | Error Message 17 | Error Message 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_object_check.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_OBJECT_CHECK 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Object check status 14 | Object Check 15 | Obj.Check 16 | Object Check 17 | Object Check 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_objs.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_OBJS 7 | E 8 | TRANSP 9 | X 10 | abapGit CI: Object List per Test Case 11 | A 12 | 1 13 | 14 | 15 | ZABAPGIT_CI_OBJS 16 | A 17 | 1 18 | APPL0 19 | N 20 | 21 | 22 | 23 | MANDT 24 | X 25 | MANDT 26 | 0 27 | X 28 | E 29 | 30 | 31 | NAME 32 | X 33 | ZABAPGIT_CI_REPO_NAME 34 | 0 35 | X 36 | E 37 | 38 | 39 | PHASE 40 | X 41 | 0 42 | C 43 | 000040 44 | X 45 | CHAR 46 | 000020 47 | CHAR 48 | Check Phase 49 | 50 | 51 | ID 52 | X 53 | 0 54 | X 55 | 000004 56 | X 57 | INT4 58 | 000010 59 | INT4 60 | 61 | 62 | PGMID 63 | PGMID 64 | 0 65 | E 66 | 67 | 68 | OBJECT 69 | TROBJTYPE 70 | 0 71 | D 72 | E 73 | 74 | 75 | OBJ_NAME 76 | SOBJ_NAME 77 | 0 78 | E 79 | 80 | 81 | DEVCLASS 82 | DEVCLASS 83 | 0 84 | D 85 | E 86 | 87 | 88 | KORRNUM 89 | KORRNUM 90 | 0 91 | E 92 | 93 | 94 | DELFLAG 95 | OBJDELFLAG 96 | 0 97 | X 98 | F 99 | E 100 | 101 | 102 | GENFLAG 103 | GENFLAG 104 | 0 105 | X 106 | F 107 | E 108 | 109 | 110 | PATH 111 | 0 112 | g 113 | 000008 114 | STRG 115 | STRG 116 | 117 | 118 | SRCSYSTEM 119 | SRCSYSTEM 120 | 0 121 | E 122 | 123 | 124 | MASTERLANG 125 | MASTERLANG 126 | 0 127 | D 128 | E 129 | X 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /src/zabapgit_ci_pull.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_PULL 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Pull status 14 | Pull 15 | Pull 16 | Pull 17 | Pull 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_purge.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_PURGE 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Purge status 14 | Purge 15 | Purge 16 | Purge 17 | Purge 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo.fugr.lzabapgit_ci_repotop.abap: -------------------------------------------------------------------------------- 1 | FUNCTION-POOL zabapgit_ci_repo. "MESSAGE-ID .. 2 | 3 | * INCLUDE LZABAPGIT_CI_REPOD... " Local class definition 4 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo.fugr.lzabapgit_ci_repotop.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | LZABAPGIT_CI_REPOTOP 7 | S 8 | D$ 9 | I 10 | S 11 | X 12 | D$S 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo.fugr.saplzabapgit_ci_repo.abap: -------------------------------------------------------------------------------- 1 | ******************************************************************* 2 | * System-defined Include-files. * 3 | ******************************************************************* 4 | INCLUDE lzabapgit_ci_repotop. " Global Declarations 5 | INCLUDE lzabapgit_ci_repouxx. " Function Modules 6 | 7 | ******************************************************************* 8 | * User-defined Include-files (if necessary). * 9 | ******************************************************************* 10 | * INCLUDE LZABAPGIT_CI_REPOF... " Subroutines 11 | * INCLUDE LZABAPGIT_CI_REPOO... " PBO-Modules 12 | * INCLUDE LZABAPGIT_CI_REPOI... " PAI-Modules 13 | * INCLUDE LZABAPGIT_CI_REPOE... " Events 14 | * INCLUDE LZABAPGIT_CI_REPOP... " Local class implement. 15 | * INCLUDE LZABAPGIT_CI_REPOT99. " ABAP Unit tests 16 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo.fugr.saplzabapgit_ci_repo.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | SAPLZABAPGIT_CI_REPO 7 | S 8 | D$ 9 | F 10 | S 11 | E 12 | X 13 | D$S 14 | X 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo.fugr.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | abapGit CI: Repo processing 6 | 7 | LZABAPGIT_CI_REPOTOP 8 | SAPLZABAPGIT_CI_REPO 9 | 10 | 11 | 12 | ZABAPGIT_CI_PROCESS_REPO 13 | R 14 | abapGit CI repo processing 15 | 16 | 17 | CS_CI_REPO 18 | ZABAPGIT_CI_RESULT 19 | 20 | 21 | 22 | 23 | CS_CI_REPO 24 | P 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo.fugr.zabapgit_ci_process_repo.abap: -------------------------------------------------------------------------------- 1 | FUNCTION zabapgit_ci_process_repo. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" CHANGING 5 | *" VALUE(CS_CI_REPO) TYPE ZABAPGIT_CI_RESULT 6 | *"---------------------------------------------------------------------- 7 | 8 | TRY. 9 | 10 | NEW zcl_abapgit_ci_repo( )->run( CHANGING cs_ci_repo = cs_ci_repo ). 11 | 12 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 13 | 14 | zcl_abapgit_ci_repos=>fail_message( 15 | EXPORTING 16 | iv_message = lx_error->get_text( ) 17 | CHANGING 18 | cs_ci_repo = cs_ci_repo ). 19 | 20 | ENDTRY. 21 | 22 | ENDFUNCTION. 23 | -------------------------------------------------------------------------------- /src/zabapgit_ci_repo_name.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_REPO_NAME 7 | E 8 | CHAR40 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Repo name 14 | Repo Name 15 | Repo Name 16 | Repo Name 17 | Repo Name 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_result.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_RESULT 7 | E 8 | INTTAB 9 | abapGit CI: Repo result 10 | E 11 | 1 12 | 13 | 14 | 15 | NAME 16 | ZABAPGIT_CI_REPO_NAME 17 | 0 18 | E 19 | 20 | 21 | PACKAGE 22 | DEVCLASS 23 | 0 24 | D 25 | E 26 | 27 | 28 | LAYER 29 | DEVLAYER 30 | 0 31 | D 32 | E 33 | 34 | 35 | SKIP 36 | ZABAPGIT_CI_SKIP 37 | 0 38 | X 39 | F 40 | E 41 | 42 | 43 | CREATE_PACKAGE 44 | ZABAPGIT_CI_CREATE_PACKAGE 45 | 0 46 | X 47 | F 48 | E 49 | 50 | 51 | CLONE 52 | ZABAPGIT_CI_CLONE 53 | 0 54 | X 55 | F 56 | E 57 | 58 | 59 | PULL 60 | ZABAPGIT_CI_PULL 61 | 0 62 | X 63 | F 64 | E 65 | 66 | 67 | SYNTAX_CHECK 68 | ZABAPGIT_CI_SYNTAX_CHECK 69 | 0 70 | X 71 | F 72 | E 73 | 74 | 75 | OBJECT_CHECK 76 | ZABAPGIT_CI_OBJECT_CHECK 77 | 0 78 | X 79 | F 80 | E 81 | 82 | 83 | CHECK_CREATE_TRANSPORT 84 | ZABAPGIT_CI_CHECK_CREATE_TR 85 | 0 86 | X 87 | F 88 | E 89 | 90 | 91 | PURGE 92 | ZABAPGIT_CI_PURGE 93 | 0 94 | X 95 | F 96 | E 97 | 98 | 99 | CHECK_DELETE_TRANSPORT 100 | ZABAPGIT_CI_CHECK_DELETE_TR 101 | 0 102 | X 103 | F 104 | E 105 | 106 | 107 | CHECK_LEFTOVERS 108 | ZABAPGIT_CI_CHECK_LEFTOVERS 109 | 0 110 | X 111 | F 112 | E 113 | 114 | 115 | DURATION 116 | ZABAPGIT_CI_DURATION 117 | 0 118 | E 119 | 120 | 121 | STATUS 122 | ZABAPGIT_CI_STATUS 123 | 0 124 | X 125 | F 126 | E 127 | 128 | 129 | MESSAGE 130 | ZABAPGIT_CI_MESSAGE 131 | 0 132 | E 133 | 134 | 135 | CLONE_URL 136 | ZABAPGIT_CI_CLONE_URL 137 | 0 138 | E 139 | 140 | 141 | DO_NOT_PURGE 142 | ZABAPGIT_CI_DO_NOT_PURGE 143 | 0 144 | X 145 | F 146 | E 147 | 148 | 149 | CATEGORY 150 | ZABAPGIT_CI_CATEGORY 151 | 0 152 | E 153 | 154 | 155 | LOGGING 156 | ZABAPGIT_CI_LOGGING 157 | 0 158 | X 159 | F 160 | E 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /src/zabapgit_ci_result_gen.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_RESULT_GEN 7 | E 8 | INTTAB 9 | abapGit CI: Generic result 10 | E 11 | 1 12 | 13 | 14 | 15 | DESCRIPTION 16 | ZABAPGIT_CI_DESCRIPTION 17 | 0 18 | E 19 | 20 | 21 | DURATION 22 | ZABAPGIT_CI_DURATION 23 | 0 24 | E 25 | 26 | 27 | STATUS 28 | ZABAPGIT_CI_STATUS 29 | 0 30 | X 31 | F 32 | E 33 | 34 | 35 | MESSAGE 36 | ZABAPGIT_CI_MESSAGE 37 | 0 38 | E 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/zabapgit_ci_result_header.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_RESULT_HEADER 7 | E 8 | INTTAB 9 | abapGit CI: Result header 10 | E 11 | 1 12 | 13 | 14 | 15 | TITLE 16 | ZABAPGIT_CI_DESCRIPTION 17 | 0 18 | E 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_results.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_results 3 | *&---------------------------------------------------------------------* 4 | *& View abapGit CI results (https://ci.abapgit.org/ or MIME repository) 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_results. 8 | 9 | SELECTION-SCREEN BEGIN OF SCREEN 1001. 10 | * dummy for triggering screen 11 | SELECTION-SCREEN END OF SCREEN 1001. 12 | 13 | CLASS lcl_mime DEFINITION. 14 | 15 | PUBLIC SECTION. 16 | 17 | CLASS-METHODS get_content 18 | IMPORTING 19 | iv_loio TYPE sdok_loid 20 | RETURNING 21 | VALUE(rv_content) TYPE xstring. 22 | 23 | PRIVATE SECTION. 24 | 25 | CLASS-METHODS get_url 26 | IMPORTING 27 | iv_loio TYPE sdok_loid 28 | RETURNING 29 | VALUE(rv_url) TYPE string. 30 | 31 | ENDCLASS. 32 | 33 | CLASS lcl_mime IMPLEMENTATION. 34 | 35 | METHOD get_content. 36 | 37 | DATA li_api TYPE REF TO if_mr_api. 38 | 39 | DATA(lv_url) = get_url( iv_loio ). 40 | 41 | li_api = cl_mime_repository_api=>if_mr_api~get_api( ). 42 | li_api->get( 43 | EXPORTING 44 | i_url = lv_url 45 | IMPORTING 46 | e_content = rv_content 47 | EXCEPTIONS 48 | parameter_missing = 1 49 | error_occured = 2 50 | not_found = 3 51 | permission_failure = 4 52 | OTHERS = 5 ). 53 | ASSERT sy-subrc = 0. 54 | 55 | ENDMETHOD. 56 | 57 | METHOD get_url. 58 | 59 | DATA: 60 | ls_smimloio TYPE smimloio, 61 | ls_io TYPE skwf_io, 62 | lv_url TYPE skwf_url. 63 | 64 | SELECT SINGLE * FROM smimloio INTO @ls_smimloio WHERE loio_id = @iv_loio. 65 | ASSERT sy-subrc = 0. 66 | 67 | ls_io-objtype = skwfc_obtype_loio. 68 | ls_io-class = ls_smimloio-lo_class. 69 | ls_io-objid = ls_smimloio-loio_id. 70 | 71 | CALL FUNCTION 'SKWF_NMSPC_IO_ADDRESS_GET' 72 | EXPORTING 73 | io = ls_io 74 | IMPORTING 75 | url = lv_url. 76 | 77 | rv_url = lv_url. 78 | 79 | ENDMETHOD. 80 | 81 | ENDCLASS. 82 | 83 | CLASS lcl_gui DEFINITION. 84 | 85 | PUBLIC SECTION. 86 | METHODS on_event 87 | FOR EVENT sapevent OF zif_abapgit_html_viewer 88 | IMPORTING 89 | !action 90 | !frame 91 | !getdata 92 | !postdata 93 | !query_table. 94 | 95 | METHODS startup 96 | RAISING 97 | zcx_abapgit_exception. 98 | 99 | METHODS cache_mime 100 | IMPORTING 101 | iv_loio TYPE csequence 102 | RETURNING 103 | VALUE(rv_url) TYPE string 104 | RAISING 105 | zcx_abapgit_exception. 106 | 107 | METHODS show_mime 108 | IMPORTING 109 | iv_loio TYPE csequence 110 | RAISING 111 | zcx_abapgit_exception. 112 | 113 | METHODS handle_action 114 | IMPORTING 115 | !iv_action TYPE c 116 | !iv_getdata TYPE c OPTIONAL 117 | !it_postdata TYPE cnht_post_data_tab OPTIONAL ##NEEDED. 118 | 119 | METHODS back 120 | RETURNING 121 | VALUE(rv_exit) TYPE abap_bool 122 | RAISING 123 | zcx_abapgit_exception. 124 | 125 | METHODS free 126 | RAISING 127 | zcx_abapgit_exception. 128 | 129 | PRIVATE SECTION. 130 | 131 | DATA mi_html_viewer TYPE REF TO zif_abapgit_html_viewer. 132 | 133 | ENDCLASS. 134 | 135 | CLASS lcl_gui IMPLEMENTATION. 136 | 137 | METHOD startup. 138 | 139 | DATA: 140 | ls_event TYPE cntl_simple_event, 141 | lt_events TYPE cntl_simple_events. 142 | 143 | mi_html_viewer = zcl_abapgit_ui_core_factory=>get_html_viewer( ). 144 | 145 | ls_event-eventid = mi_html_viewer->c_id_sapevent. 146 | ls_event-appl_event = abap_true. 147 | APPEND ls_event TO lt_events. 148 | 149 | mi_html_viewer->set_registered_events( lt_events ). 150 | SET HANDLER on_event FOR mi_html_viewer. 151 | 152 | ENDMETHOD. 153 | 154 | METHOD cache_mime. 155 | 156 | TYPES ty_hex TYPE x LENGTH 1000. 157 | 158 | DATA: 159 | lv_size TYPE i, 160 | lt_xdata TYPE STANDARD TABLE OF ty_hex WITH DEFAULT KEY. 161 | 162 | DATA(lv_xdata) = lcl_mime=>get_content( iv_loio ). 163 | 164 | zcl_abapgit_convert=>xstring_to_bintab( 165 | EXPORTING 166 | iv_xstr = lv_xdata 167 | IMPORTING 168 | ev_size = lv_size 169 | et_bintab = lt_xdata ). 170 | 171 | mi_html_viewer->load_data( 172 | EXPORTING 173 | iv_type = 'text' 174 | iv_subtype = 'html' 175 | iv_size = lv_size 176 | IMPORTING 177 | ev_assigned_url = rv_url 178 | CHANGING 179 | ct_data_table = lt_xdata ). 180 | 181 | ENDMETHOD. 182 | 183 | METHOD show_mime. 184 | 185 | mi_html_viewer->show_url( cache_mime( iv_loio ) ). 186 | 187 | ENDMETHOD. 188 | 189 | METHOD on_event. 190 | 191 | handle_action( 192 | iv_action = action 193 | iv_getdata = getdata 194 | it_postdata = postdata ). 195 | 196 | ENDMETHOD. 197 | 198 | METHOD handle_action. 199 | 200 | TRY. 201 | IF iv_action = 'go-back'. 202 | back( ). 203 | ENDIF. 204 | CATCH cx_root ##NO_HANDLER. 205 | ENDTRY. 206 | 207 | ENDMETHOD. 208 | 209 | METHOD back. 210 | 211 | rv_exit = abap_true. 212 | 213 | ENDMETHOD. 214 | 215 | METHOD free. 216 | 217 | SET HANDLER on_event FOR mi_html_viewer ACTIVATION space. 218 | mi_html_viewer->close_document( ). 219 | mi_html_viewer->free( ). 220 | FREE mi_html_viewer. 221 | 222 | ENDMETHOD. 223 | 224 | ENDCLASS. 225 | 226 | DATA go_gui TYPE REF TO lcl_gui. 227 | 228 | INITIALIZATION. 229 | 230 | DATA lt_ucomm TYPE TABLE OF sy-ucomm. 231 | 232 | PERFORM set_pf_status IN PROGRAM rsdbrunt IF FOUND. 233 | 234 | APPEND 'CRET' TO lt_ucomm. "Button Execute 235 | APPEND 'SPOS' TO lt_ucomm. "Button Save 236 | 237 | CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' 238 | EXPORTING 239 | p_status = sy-pfkey 240 | TABLES 241 | p_exclude = lt_ucomm. 242 | 243 | PERFORM remove_toolbar IN PROGRAM zabapgit IF FOUND USING '1001'. 244 | 245 | AT SELECTION-SCREEN ON EXIT-COMMAND. 246 | 247 | CASE sy-ucomm. 248 | WHEN 'CBAC' OR 'CCAN'. "Back & Escape 249 | IF go_gui->back( ) = abap_true. 250 | go_gui->free( ). 251 | ELSE. 252 | LEAVE TO SCREEN 1001. 253 | ENDIF. 254 | ENDCASE. 255 | 256 | START-OF-SELECTION. 257 | 258 | CREATE OBJECT go_gui. 259 | 260 | go_gui->startup( ). 261 | 262 | go_gui->show_mime( '0242AC1100021EEBB1BBC829FAE4FE35' ). 263 | 264 | CALL SELECTION-SCREEN 1001. 265 | -------------------------------------------------------------------------------- /src/zabapgit_ci_results.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_RESULTS 7 | 1 8 | E 9 | X 10 | X 11 | 12 | 13 | 14 | R 15 | abapGit CI: Results 16 | 20 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/zabapgit_ci_skip.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_SKIP 7 | E 8 | XFELD 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Skip repo 14 | Skip Repo 15 | Skip 16 | Skip Repo 17 | Skip Repo 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_status.doma.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_STATUS 7 | E 8 | CHAR 9 | 000006 10 | 000006 11 | X 12 | abapGit CI: Status 13 | E 14 | 15 | 16 | 17 | 0001 18 | E 19 | undefined 20 | 21 | 22 | 0002 23 | E 24 | OK 25 | ok 26 | 27 | 28 | 0003 29 | E 30 | NOT_OK 31 | not_ok 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/zabapgit_ci_status.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_STATUS 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Status 14 | Status 15 | Status 16 | Status 17 | Status 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_syntax_check.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_SYNTAX_CHECK 7 | E 8 | ZABAPGIT_CI_STATUS 9 | 55 10 | 10 11 | 20 12 | 40 13 | abapGit CI: Syntax check status 14 | Syntax Check 15 | Synt.Check 16 | Syntax Check 17 | Syntax Check 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_test_slack.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_test_slack 3 | *&---------------------------------------------------------------------* 4 | *& Post a message to abapGit CI Slack channel 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_test_slack. 8 | 9 | PARAMETERS: 10 | token TYPE string LOWER CASE OBLIGATORY, 11 | msg TYPE string LOWER CASE OBLIGATORY. 12 | 13 | TRY. 14 | NEW zcl_abapgit_ci_slack( token )->post( msg ). 15 | 16 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 17 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 18 | ENDTRY. 19 | -------------------------------------------------------------------------------- /src/zabapgit_ci_test_slack.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_TEST_SLACK 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 | R 17 | abapGit CI: Test Slack 18 | 22 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zabapgit_ci_update_abapgit.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_update_abapgit 3 | *&---------------------------------------------------------------------* 4 | *& Update abapGit developer version to latest version from GitHub 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_update_abapgit. 8 | 9 | PARAMETERS: 10 | slack TYPE abap_bool AS CHECKBOX, 11 | token TYPE string LOWER CASE. 12 | 13 | CLASS lcl_abapgit_update DEFINITION. 14 | 15 | PUBLIC SECTION. 16 | METHODS: 17 | run. 18 | 19 | PRIVATE SECTION. 20 | METHODS: 21 | send_to_slack 22 | IMPORTING 23 | ix_error TYPE REF TO zcx_abapgit_exception. 24 | 25 | ENDCLASS. 26 | 27 | CLASS lcl_abapgit_update IMPLEMENTATION. 28 | 29 | METHOD run. 30 | 31 | TRY. 32 | zcl_abapgit_ci_repos=>update_abapgit_repo( ). 33 | MESSAGE |abapGit updated successfully| TYPE 'S'. 34 | 35 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 36 | 37 | IF slack = abap_true. 38 | send_to_slack( lx_error ). 39 | ENDIF. 40 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 41 | 42 | ENDTRY. 43 | 44 | ENDMETHOD. 45 | 46 | 47 | METHOD send_to_slack. 48 | 49 | TRY. 50 | NEW zcl_abapgit_ci_slack( token )->post( 51 | |abapGit CI error: abapGit update failed with | 52 | && |"{ ix_error->get_text( ) }"| ). 53 | 54 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 55 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 56 | ENDTRY. 57 | 58 | ENDMETHOD. 59 | 60 | ENDCLASS. 61 | 62 | START-OF-SELECTION. 63 | NEW lcl_abapgit_update( )->run( ). 64 | -------------------------------------------------------------------------------- /src/zabapgit_ci_update_abapgit.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_UPDATE_ABAPGIT 7 | S 8 | 1 9 | X 10 | D$S 11 | X 12 | 13 | 14 | 15 | R 16 | abapGit CI: Update abapGit repo 17 | 31 18 | 19 | 20 | S 21 | SLACK 22 | Post errors to Slack channel 23 | 36 24 | 25 | 26 | S 27 | TOKEN 28 | Slack OAuth Token 29 | 25 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/zabapgit_ci_update_abapgit_ci.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_update_abapgit_ci 3 | *&---------------------------------------------------------------------* 4 | *& Update abapGit CI to latest version from GitHub 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_update_abapgit_ci. 8 | 9 | PARAMETERS: 10 | slack TYPE abap_bool AS CHECKBOX, 11 | token TYPE string LOWER CASE. 12 | 13 | CLASS lcl_abapgit_ci_update DEFINITION. 14 | 15 | PUBLIC SECTION. 16 | METHODS: 17 | run. 18 | 19 | PRIVATE SECTION. 20 | METHODS: 21 | send_to_slack 22 | IMPORTING 23 | ix_error TYPE REF TO zcx_abapgit_exception. 24 | 25 | ENDCLASS. 26 | 27 | CLASS lcl_abapgit_ci_update IMPLEMENTATION. 28 | 29 | METHOD run. 30 | 31 | TRY. 32 | zcl_abapgit_ci_repos=>update_abapgit_ci_repo( ). 33 | MESSAGE |abapGit CI updated successfully| TYPE 'S'. 34 | 35 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 36 | 37 | IF slack = abap_true. 38 | send_to_slack( lx_error ). 39 | ENDIF. 40 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 41 | 42 | ENDTRY. 43 | 44 | ENDMETHOD. 45 | 46 | 47 | METHOD send_to_slack. 48 | 49 | TRY. 50 | NEW zcl_abapgit_ci_slack( token )->post( 51 | |abapGit CI error: abapGit CI update failed with | 52 | && |"{ ix_error->get_text( ) }"| ). 53 | 54 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 55 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 56 | ENDTRY. 57 | 58 | ENDMETHOD. 59 | 60 | ENDCLASS. 61 | 62 | START-OF-SELECTION. 63 | NEW lcl_abapgit_ci_update( )->run( ). 64 | -------------------------------------------------------------------------------- /src/zabapgit_ci_update_abapgit_ci.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_UPDATE_ABAPGIT_CI 7 | S 8 | 1 9 | X 10 | D$S 11 | X 12 | 13 | 14 | 15 | R 16 | abapGit CI: Update abapGit CI repo 17 | 34 18 | 19 | 20 | S 21 | SLACK 22 | Post errors to Slack channel 23 | 36 24 | 25 | 26 | S 27 | TOKEN 28 | Slack OAuth Token 29 | 25 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/zabapgit_ci_update_repo.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zabapgit_ci_update_repo 3 | *&---------------------------------------------------------------------* 4 | *& Update a repository to latest version 5 | *& See https://github.com/abapGit/CI 6 | *&---------------------------------------------------------------------* 7 | REPORT zabapgit_ci_update_repo. 8 | 9 | SELECTION-SCREEN BEGIN OF BLOCK repo WITH FRAME TITLE TEXT-b01. 10 | PARAMETERS: 11 | repo TYPE string LOWER CASE OBLIGATORY, 12 | branch TYPE string LOWER CASE. 13 | SELECTION-SCREEN END OF BLOCK repo. 14 | 15 | SELECTION-SCREEN BEGIN OF BLOCK slack WITH FRAME TITLE TEXT-b02. 16 | PARAMETERS: 17 | slack TYPE abap_bool AS CHECKBOX, 18 | token TYPE string LOWER CASE. 19 | SELECTION-SCREEN END OF BLOCK slack. 20 | 21 | CLASS lcl_abapgit_update DEFINITION. 22 | 23 | PUBLIC SECTION. 24 | METHODS: 25 | run. 26 | 27 | PRIVATE SECTION. 28 | METHODS: 29 | send_to_slack 30 | IMPORTING 31 | ix_error TYPE REF TO zcx_abapgit_exception. 32 | 33 | ENDCLASS. 34 | 35 | CLASS lcl_abapgit_update IMPLEMENTATION. 36 | 37 | METHOD run. 38 | 39 | TRY. 40 | IF branch IS INITIAL. 41 | zcl_abapgit_ci_repos=>update_repository( repo ). 42 | ELSE. 43 | zcl_abapgit_ci_repos=>update_repository( 44 | iv_repo_name = repo 45 | iv_branch = branch ). 46 | ENDIF. 47 | 48 | MESSAGE |Repository { repo } updated successfully| TYPE 'S'. 49 | 50 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 51 | 52 | IF slack = abap_true. 53 | send_to_slack( lx_error ). 54 | ENDIF. 55 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 56 | 57 | ENDTRY. 58 | 59 | ENDMETHOD. 60 | 61 | 62 | METHOD send_to_slack. 63 | 64 | TRY. 65 | NEW zcl_abapgit_ci_slack( token )->post( 66 | |abapGit CI error: { repo } update failed with | 67 | && |"{ ix_error->get_text( ) }"| ). 68 | 69 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 70 | MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. 71 | ENDTRY. 72 | 73 | ENDMETHOD. 74 | 75 | ENDCLASS. 76 | 77 | START-OF-SELECTION. 78 | NEW lcl_abapgit_update( )->run( ). 79 | -------------------------------------------------------------------------------- /src/zabapgit_ci_update_repo.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZABAPGIT_CI_UPDATE_REPO 7 | S 8 | D$ 9 | 1 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 | I 17 | B01 18 | Repository 19 | 20 20 | 21 | 22 | I 23 | B02 24 | Slack integration 25 | 27 26 | 27 | 28 | R 29 | abapGit CI: Update custom repository 30 | 36 31 | 32 | 33 | S 34 | BRANCH 35 | Branch 36 | 14 37 | 38 | 39 | S 40 | REPO 41 | Repository 42 | 18 43 | 44 | 45 | S 46 | SLACK 47 | Post errors to Slack channel 48 | 36 49 | 50 | 51 | S 52 | TOKEN 53 | Slack OAuth Token 54 | 25 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/zci.tran.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCI 7 | ZABAPGIT_CI 8 | 1000 9 | gA== 10 | 11 | 12 | ZCI 13 | 14 | 15 | E 16 | ZCI 17 | abapGit CI 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/zcic.tran.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCIC 7 | ZABAPGIT_CI_CLEANUP 8 | 1000 9 | gA== 10 | 11 | 12 | ZCIC 13 | 14 | 15 | E 16 | ZCIC 17 | abapGit CI Cleanup 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/zcij.tran.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCIJ 7 | ZABAPGIT_CI_JOBS 8 | 1000 9 | gA== 10 | 11 | 12 | ZCIJ 13 | 14 | 15 | E 16 | ZCIJ 17 | abapGit CI Jobs 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/zcir.tran.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCIR 7 | ZABAPGIT_CI_RESULTS 8 | 1000 9 | gA== 10 | 11 | 12 | ZCIR 13 | 14 | 15 | E 16 | ZCIR 17 | abapGit CI Results 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_alv_view.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_alv_view DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | 7 | INTERFACES zif_abapgit_ci_view . 8 | PROTECTED SECTION. 9 | PRIVATE SECTION. 10 | 11 | METHODS prepare_splitter 12 | IMPORTING 13 | !iv_gen TYPE abap_bool 14 | !iv_repo TYPE abap_bool 15 | EXPORTING 16 | !eo_row_1 TYPE REF TO cl_gui_container 17 | !eo_row_2 TYPE REF TO cl_gui_container 18 | !eo_row_3 TYPE REF TO cl_gui_container 19 | !eo_row_4 TYPE REF TO cl_gui_container 20 | RAISING 21 | zcx_abapgit_exception . 22 | METHODS prepare_header 23 | IMPORTING 24 | !iv_text TYPE string 25 | !io_container TYPE REF TO cl_gui_container 26 | RAISING 27 | zcx_abapgit_exception . 28 | METHODS display_alv 29 | CHANGING 30 | !cs_result TYPE zif_abapgit_ci_definitions=>ty_result 31 | RAISING 32 | zcx_abapgit_exception . 33 | METHODS display_list 34 | CHANGING 35 | !cs_result TYPE zif_abapgit_ci_definitions=>ty_result 36 | RAISING 37 | zcx_abapgit_exception . 38 | ENDCLASS. 39 | 40 | 41 | 42 | CLASS ZCL_ABAPGIT_CI_ALV_VIEW IMPLEMENTATION. 43 | 44 | 45 | METHOD display_alv. 46 | 47 | prepare_splitter( 48 | EXPORTING 49 | iv_gen = xsdbool( cs_result-generic_result_list IS NOT INITIAL ) 50 | iv_repo = xsdbool( cs_result-repo_result_list IS NOT INITIAL ) 51 | IMPORTING 52 | eo_row_1 = DATA(lo_row_1) 53 | eo_row_2 = DATA(lo_row_2) 54 | eo_row_3 = DATA(lo_row_3) 55 | eo_row_4 = DATA(lo_row_4) ). 56 | 57 | IF cs_result-generic_result_list IS NOT INITIAL. 58 | prepare_header( iv_text = zif_abapgit_ci_definitions=>co_title_generic 59 | io_container = lo_row_1 ). 60 | 61 | NEW lcl_alv( io_container = lo_row_2 62 | it_table = cs_result-generic_result_list )->display( ). 63 | ENDIF. 64 | 65 | IF cs_result-repo_result_list IS NOT INITIAL. 66 | prepare_header( iv_text = zif_abapgit_ci_definitions=>co_title_repos 67 | io_container = lo_row_3 ). 68 | 69 | NEW lcl_alv( io_container = lo_row_4 70 | it_table = cs_result-repo_result_list )->display( ). 71 | ENDIF. 72 | 73 | WRITE: ''. 74 | 75 | ENDMETHOD. 76 | 77 | 78 | METHOD display_list. 79 | 80 | DATA lt_header TYPE TABLE OF zabapgit_ci_result_header. 81 | DATA ls_print TYPE slis_print_alv. 82 | 83 | CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT' 84 | EXPORTING 85 | i_callback_program = sy-cprog. 86 | 87 | IF cs_result-generic_result_list IS NOT INITIAL. 88 | lt_header = VALUE #( ( title = zif_abapgit_ci_definitions=>co_title_generic ) ). 89 | 90 | NEW lcl_list( it_table = lt_header 91 | iv_tabname = 'ZABAPGIT_CI_RESULT_HEADER' )->display( ). 92 | 93 | NEW lcl_list( it_table = cs_result-generic_result_list 94 | iv_tabname = 'ZABAPGIT_CI_RESULT_GEN' )->display( ). 95 | ENDIF. 96 | 97 | IF cs_result-repo_result_list IS NOT INITIAL. 98 | lt_header = VALUE #( ( title = zif_abapgit_ci_definitions=>co_title_repos ) ). 99 | 100 | NEW lcl_list( it_table = lt_header 101 | iv_tabname = 'ZABAPGIT_CI_RESULT_HEADER' )->display( ). 102 | 103 | NEW lcl_list( it_table = cs_result-repo_result_list 104 | iv_tabname = 'ZABAPGIT_CI_RESULT' )->display( ). 105 | ENDIF. 106 | 107 | ls_print-no_print_listinfos = abap_true. 108 | 109 | CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY' 110 | EXPORTING 111 | is_print = ls_print 112 | EXCEPTIONS 113 | program_error = 1 114 | OTHERS = 2. 115 | 116 | IF sy-subrc <> 0. 117 | zcx_abapgit_exception=>raise_t100( ). 118 | ENDIF. 119 | 120 | ENDMETHOD. 121 | 122 | 123 | METHOD prepare_header. 124 | DATA(lo_dd) = NEW cl_dd_document( ). 125 | 126 | lo_dd->add_text_as_heading( 127 | text = CONV #( iv_text ) 128 | sap_fontstyle = cl_dd_area=>sans_serif 129 | heading_level = 1 ). 130 | 131 | lo_dd->display_document( 132 | EXPORTING 133 | parent = io_container 134 | EXCEPTIONS 135 | html_display_error = 1 136 | OTHERS = 2 ). 137 | IF sy-subrc <> 0. 138 | zcx_abapgit_exception=>raise_t100( ). 139 | ENDIF. 140 | ENDMETHOD. 141 | 142 | 143 | METHOD prepare_splitter. 144 | 145 | DATA(lo_splitter) = NEW cl_gui_splitter_container( 146 | parent = cl_gui_container=>default_screen 147 | rows = 4 148 | columns = 1 149 | no_autodef_progid_dynnr = abap_true ). 150 | 151 | eo_row_1 = lo_splitter->get_container( row = 1 152 | column = 1 ). 153 | 154 | eo_row_2 = lo_splitter->get_container( row = 2 155 | column = 1 ). 156 | 157 | eo_row_3 = lo_splitter->get_container( row = 3 158 | column = 1 ). 159 | 160 | eo_row_4 = lo_splitter->get_container( row = 4 161 | column = 1 ). 162 | 163 | lo_splitter->set_row_sash( 164 | EXPORTING 165 | id = 1 166 | type = cl_gui_splitter_container=>type_movable 167 | value = cl_gui_splitter_container=>true 168 | EXCEPTIONS 169 | cntl_error = 1 170 | cntl_system_error = 2 171 | OTHERS = 3 ). 172 | 173 | IF sy-subrc <> 0. 174 | zcx_abapgit_exception=>raise_t100( ). 175 | ENDIF. 176 | 177 | lo_splitter->set_row_height( 178 | EXPORTING 179 | id = 1 180 | height = COND #( WHEN iv_gen = abap_true THEN 6 ELSE 0 ) 181 | EXCEPTIONS 182 | cntl_error = 1 183 | cntl_system_error = 2 184 | OTHERS = 3 ). 185 | 186 | IF sy-subrc <> 0. 187 | zcx_abapgit_exception=>raise_t100( ). 188 | ENDIF. 189 | 190 | lo_splitter->set_row_sash( 191 | EXPORTING 192 | id = 2 193 | type = cl_gui_splitter_container=>type_movable 194 | value = cl_gui_splitter_container=>true 195 | EXCEPTIONS 196 | cntl_error = 1 197 | cntl_system_error = 2 198 | OTHERS = 3 ). 199 | 200 | IF sy-subrc <> 0. 201 | zcx_abapgit_exception=>raise_t100( ). 202 | ENDIF. 203 | 204 | IF iv_repo = abap_true. 205 | lo_splitter->set_row_height( 206 | EXPORTING 207 | id = 2 208 | height = COND #( WHEN iv_gen = abap_true THEN 10 ELSE 0 ) 209 | EXCEPTIONS 210 | cntl_error = 1 211 | cntl_system_error = 2 212 | OTHERS = 3 ). 213 | 214 | IF sy-subrc <> 0. 215 | zcx_abapgit_exception=>raise_t100( ). 216 | ENDIF. 217 | ENDIF. 218 | 219 | lo_splitter->set_row_sash( 220 | EXPORTING 221 | id = 3 222 | type = cl_gui_splitter_container=>type_movable 223 | value = cl_gui_splitter_container=>true 224 | EXCEPTIONS 225 | cntl_error = 1 226 | cntl_system_error = 2 227 | OTHERS = 3 ). 228 | 229 | IF sy-subrc <> 0. 230 | zcx_abapgit_exception=>raise_t100( ). 231 | ENDIF. 232 | 233 | lo_splitter->set_row_height( 234 | EXPORTING 235 | id = 3 236 | height = COND #( WHEN iv_repo = abap_true THEN 6 ELSE 0 ) 237 | EXCEPTIONS 238 | cntl_error = 1 239 | cntl_system_error = 2 240 | OTHERS = 3 ). 241 | 242 | IF sy-subrc <> 0. 243 | zcx_abapgit_exception=>raise_t100( ). 244 | ENDIF. 245 | 246 | lo_splitter->set_row_sash( 247 | EXPORTING 248 | id = 4 249 | type = cl_gui_splitter_container=>type_movable 250 | value = cl_gui_splitter_container=>true 251 | EXCEPTIONS 252 | cntl_error = 1 253 | cntl_system_error = 2 254 | OTHERS = 3 ). 255 | 256 | IF sy-subrc <> 0. 257 | zcx_abapgit_exception=>raise_t100( ). 258 | ENDIF. 259 | 260 | IF iv_gen = abap_true. 261 | lo_splitter->set_row_height( 262 | EXPORTING 263 | id = 4 264 | height = COND #( WHEN iv_repo = abap_true THEN 40 ELSE 0 ) 265 | EXCEPTIONS 266 | cntl_error = 1 267 | cntl_system_error = 2 268 | OTHERS = 3 ). 269 | 270 | IF sy-subrc <> 0. 271 | zcx_abapgit_exception=>raise_t100( ). 272 | ENDIF. 273 | ENDIF. 274 | 275 | ENDMETHOD. 276 | 277 | 278 | METHOD zif_abapgit_ci_view~display. 279 | 280 | IF zcl_abapgit_ui_factory=>get_frontend_services( )->gui_is_available( ). 281 | display_alv( CHANGING cs_result = cs_result ). 282 | ELSE. 283 | display_list( CHANGING cs_result = cs_result ). 284 | ENDIF. 285 | 286 | ENDMETHOD. 287 | ENDCLASS. 288 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_alv_view.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | *"* use this source file for any type of declarations (class 2 | *"* definitions, interfaces or type declarations) you need for 3 | *"* components in the private section 4 | 5 | CLASS lcl_view DEFINITION ABSTRACT. 6 | 7 | PUBLIC SECTION. 8 | METHODS: 9 | constructor 10 | IMPORTING 11 | it_table TYPE INDEX TABLE, 12 | 13 | display ABSTRACT 14 | RAISING 15 | zcx_abapgit_exception. 16 | 17 | PROTECTED SECTION. 18 | TYPES: BEGIN OF ty_column_width, 19 | column TYPE lvc_fname, 20 | width TYPE lvc_outlen, 21 | END OF ty_column_width, 22 | tty_column_width TYPE HASHED TABLE OF ty_column_width 23 | WITH UNIQUE KEY column. 24 | 25 | DATA: 26 | mo_alv TYPE REF TO cl_salv_table, 27 | mr_table TYPE REF TO data, 28 | mt_column_width TYPE tty_column_width. 29 | 30 | PRIVATE SECTION. 31 | METHODS: 32 | map_status_to_icon 33 | IMPORTING 34 | it_table TYPE ANY TABLE 35 | ir_table TYPE REF TO data, 36 | 37 | config_column 38 | IMPORTING 39 | iv_column TYPE lvc_fname 40 | iv_width TYPE lvc_outlen. 41 | 42 | ENDCLASS. 43 | 44 | CLASS lcl_alv DEFINITION INHERITING FROM lcl_view. 45 | 46 | PUBLIC SECTION. 47 | METHODS: 48 | constructor 49 | IMPORTING 50 | it_table TYPE INDEX TABLE 51 | io_container TYPE REF TO cl_gui_container, 52 | 53 | display REDEFINITION. 54 | 55 | PRIVATE SECTION. 56 | DATA: 57 | mo_container TYPE REF TO cl_gui_container. 58 | 59 | ENDCLASS. 60 | 61 | 62 | CLASS lcl_list DEFINITION INHERITING FROM lcl_view. 63 | 64 | PUBLIC SECTION. 65 | METHODS: 66 | constructor 67 | IMPORTING 68 | it_table TYPE INDEX TABLE 69 | iv_tabname TYPE slis_tabname, 70 | 71 | display REDEFINITION. 72 | 73 | PRIVATE SECTION. 74 | DATA mv_tabname TYPE slis_tabname. 75 | 76 | ENDCLASS. 77 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_alv_view.clas.locals_imp.abap: -------------------------------------------------------------------------------- 1 | *"* use this source file for the definition and implementation of 2 | *"* local helper classes, interface definitions and type 3 | *"* declarations 4 | 5 | CLASS lcl_view IMPLEMENTATION. 6 | 7 | METHOD constructor. 8 | 9 | CONSTANTS lc_width TYPE lvc_outlen VALUE 11. 10 | 11 | CREATE DATA mr_table LIKE it_table. 12 | 13 | map_status_to_icon( it_table = it_table 14 | ir_table = mr_table ). 15 | 16 | config_column( iv_column = 'NAME' 17 | iv_width = 20 ). 18 | 19 | config_column( iv_column = 'CLONE_URL' 20 | iv_width = 60 ). 21 | 22 | config_column( iv_column = 'PACKAGE' 23 | iv_width = 25 ). 24 | 25 | config_column( iv_column = 'LAYER' 26 | iv_width = 5 ). 27 | 28 | config_column( iv_column = 'CREATE_PACKAGE' 29 | iv_width = 12 ). 30 | 31 | config_column( iv_column = 'SKIP' 32 | iv_width = lc_width ). 33 | 34 | config_column( iv_column = 'DO_NOT_PURGE' 35 | iv_width = lc_width ). 36 | 37 | config_column( iv_column = 'CLONE' 38 | iv_width = lc_width ). 39 | 40 | config_column( iv_column = 'PULL' 41 | iv_width = lc_width ). 42 | 43 | config_column( iv_column = 'SYNTAX_CHECK' 44 | iv_width = lc_width ). 45 | 46 | config_column( iv_column = 'OBJECT_CHECK' 47 | iv_width = lc_width ). 48 | 49 | config_column( iv_column = 'CHECK_CREATE_TRANSPORT' 50 | iv_width = lc_width ). 51 | 52 | config_column( iv_column = 'PURGE' 53 | iv_width = lc_width ). 54 | 55 | config_column( iv_column = 'CHECK_DELETE_TRANSPORT' 56 | iv_width = lc_width ). 57 | 58 | config_column( iv_column = 'CHECK_LEFTOVERS' 59 | iv_width = lc_width ). 60 | 61 | config_column( iv_column = 'STATUS' 62 | iv_width = lc_width ). 63 | 64 | config_column( iv_column = 'DURATION' 65 | iv_width = 10 ). 66 | 67 | config_column( iv_column = 'MESSAGE' 68 | iv_width = 80 ). 69 | 70 | config_column( iv_column = 'DESCRIPTION' 71 | iv_width = 60 ). 72 | 73 | config_column( iv_column = 'TITLE' 74 | iv_width = 120 ). 75 | 76 | ENDMETHOD. 77 | 78 | 79 | METHOD map_status_to_icon. 80 | 81 | DATA: lr_line TYPE REF TO data. 82 | 83 | FIELD-SYMBOLS: 84 | TYPE table, 85 | TYPE data, 86 | TYPE data, 87 | TYPE data. 88 | 89 | ASSIGN ir_table->* TO . 90 | ASSERT sy-subrc = 0. 91 | 92 | DATA(lt_components) = CAST cl_abap_structdescr( 93 | CAST cl_abap_tabledescr( 94 | cl_abap_tabledescr=>describe_by_data( it_table ) 95 | )->get_table_line_type( ) 96 | )->get_components( ). 97 | 98 | LOOP AT it_table ASSIGNING FIELD-SYMBOL(). 99 | 100 | CREATE DATA lr_line LIKE LINE OF . 101 | ASSIGN lr_line->* TO . 102 | 103 | LOOP AT lt_components ASSIGNING FIELD-SYMBOL(). 104 | 105 | ASSIGN COMPONENT -name 106 | OF STRUCTURE 107 | TO . 108 | ASSERT sy-subrc = 0. 109 | 110 | ASSIGN COMPONENT -name 111 | OF STRUCTURE 112 | TO . 113 | ASSERT sy-subrc = 0. 114 | 115 | IF -type->get_ddic_header( )-refname CS |STATUS|. 116 | = SWITCH icon_d( 117 | 118 | WHEN zif_abapgit_ci_definitions=>co_status-ok THEN icon_checked 119 | WHEN zif_abapgit_ci_definitions=>co_status-not_ok THEN icon_incomplete 120 | WHEN zif_abapgit_ci_definitions=>co_status-undefined THEN icon_led_inactive 121 | WHEN zif_abapgit_ci_definitions=>co_status-skipped THEN icon_total_right 122 | ELSE icon_space ). 123 | ELSE. 124 | = . 125 | ENDIF. 126 | 127 | ENDLOOP. 128 | 129 | INSERT INTO TABLE . 130 | 131 | ENDLOOP. 132 | 133 | ENDMETHOD. 134 | 135 | 136 | METHOD config_column. 137 | 138 | INSERT VALUE #( column = iv_column 139 | width = iv_width ) 140 | INTO TABLE mt_column_width. 141 | 142 | ENDMETHOD. 143 | 144 | 145 | ENDCLASS. 146 | 147 | 148 | CLASS lcl_alv IMPLEMENTATION. 149 | 150 | METHOD constructor. 151 | 152 | super->constructor( it_table ). 153 | 154 | mo_container = io_container. 155 | 156 | ENDMETHOD. 157 | 158 | METHOD display. 159 | 160 | DATA: ls_color TYPE lvc_s_colo. 161 | 162 | FIELD-SYMBOLS: TYPE INDEX TABLE. 163 | 164 | ASSIGN mr_table->* TO . 165 | ASSERT sy-subrc = 0. 166 | 167 | TRY. 168 | cl_salv_table=>factory( 169 | EXPORTING 170 | r_container = mo_container 171 | IMPORTING 172 | r_salv_table = mo_alv 173 | CHANGING 174 | t_table = ). 175 | 176 | mo_alv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ). 177 | 178 | mo_alv->get_functions( )->set_all( ). 179 | 180 | LOOP AT mt_column_width ASSIGNING FIELD-SYMBOL(). 181 | 182 | TRY. 183 | DATA(lo_column) = CAST cl_salv_column_table( 184 | mo_alv->get_columns( )->get_column( -column ) ). 185 | lo_column->set_output_length( -width ). 186 | 187 | IF -column = |NAME| OR 188 | -column = |PACKAGE| OR 189 | -column = |DESCRIPTION|. 190 | lo_column->set_key( ). 191 | lo_column->set_optimized( ). 192 | ENDIF. 193 | 194 | IF -column = |SKIP| OR 195 | -column = |CATEGORY|. 196 | lo_column->set_technical( ). 197 | lo_column->set_optimized( ). 198 | ENDIF. 199 | 200 | IF -column = |STATUS|. 201 | ls_color-col = col_total. 202 | lo_column->set_color( ls_color ). 203 | ENDIF. 204 | 205 | CATCH cx_salv_error. 206 | CONTINUE. 207 | ENDTRY. 208 | 209 | ENDLOOP. 210 | 211 | mo_alv->display( ). 212 | 213 | CATCH cx_salv_error INTO DATA(lx_error). 214 | zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( ) 215 | ix_previous = lx_error ). 216 | ENDTRY. 217 | 218 | ENDMETHOD. 219 | 220 | ENDCLASS. 221 | 222 | CLASS lcl_list IMPLEMENTATION. 223 | 224 | METHOD constructor. 225 | 226 | super->constructor( it_table ). 227 | mv_tabname = iv_tabname. 228 | 229 | ENDMETHOD. 230 | 231 | METHOD display. 232 | 233 | DATA: 234 | lt_fieldcat TYPE slis_t_fieldcat_alv, 235 | ls_layout TYPE slis_layout_alv, 236 | lt_events TYPE slis_t_event. 237 | 238 | FIELD-SYMBOLS: TYPE STANDARD TABLE. 239 | 240 | ASSIGN mr_table->* TO . 241 | ASSERT sy-subrc = 0. 242 | 243 | CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' 244 | EXPORTING 245 | i_structure_name = mv_tabname 246 | CHANGING 247 | ct_fieldcat = lt_fieldcat 248 | EXCEPTIONS 249 | inconsistent_interface = 1 250 | program_error = 2 251 | OTHERS = 3. 252 | 253 | IF sy-subrc <> 0. 254 | zcx_abapgit_exception=>raise_t100( ). 255 | ENDIF. 256 | 257 | LOOP AT lt_fieldcat ASSIGNING FIELD-SYMBOL(). 258 | 259 | ASSIGN mt_column_width[ column = -fieldname ] TO FIELD-SYMBOL(). 260 | IF sy-subrc = 0. 261 | -outputlen = -width. 262 | 263 | IF -fieldname = |NAME| OR 264 | -fieldname = |PACKAGE| OR 265 | -fieldname = |DESCRIPTION| OR 266 | -fieldname = |TITLE|. 267 | -key = abap_true. 268 | ENDIF. 269 | 270 | IF -fieldname = |SKIP| OR 271 | -fieldname = |CATEGORY|. 272 | -no_out = abap_true. 273 | ENDIF. 274 | ENDIF. 275 | 276 | ENDLOOP. 277 | 278 | ls_layout-box_tabname = 'ZABAPGIT_CI_RESULT'. 279 | ls_layout-no_colhead = xsdbool( mv_tabname CS 'HEADER' ). 280 | 281 | CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND' 282 | EXPORTING 283 | is_layout = ls_layout 284 | it_fieldcat = lt_fieldcat 285 | i_tabname = mv_tabname 286 | it_events = lt_events 287 | TABLES 288 | t_outtab = 289 | EXCEPTIONS 290 | program_error = 1 291 | maximum_of_appends_reached = 2 292 | OTHERS = 3. 293 | 294 | IF sy-subrc <> 0. 295 | zcx_abapgit_exception=>raise_t100( ). 296 | ENDIF. 297 | 298 | ENDMETHOD. 299 | 300 | ENDCLASS. 301 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_alv_view.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_ALV_VIEW 7 | E 8 | abapGit CI: ALV view 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_controller.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_controller DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | 7 | METHODS constructor 8 | IMPORTING 9 | !ii_view TYPE REF TO zif_abapgit_ci_view 10 | !ii_repo_provider TYPE REF TO zif_abapgit_ci_repo_provider 11 | !is_options TYPE zif_abapgit_ci_definitions=>ty_options OPTIONAL . 12 | METHODS run 13 | RAISING 14 | zcx_abapgit_exception . 15 | PROTECTED SECTION. 16 | PRIVATE SECTION. 17 | DATA: 18 | mi_view TYPE REF TO zif_abapgit_ci_view, 19 | mi_repo_provider TYPE REF TO zif_abapgit_ci_repo_provider, 20 | mo_ci_repos TYPE REF TO zcl_abapgit_ci_repos, 21 | ms_options TYPE zif_abapgit_ci_definitions=>ty_options, 22 | mo_ci_generic TYPE REF TO zcl_abapgit_ci_generic_tests. 23 | 24 | METHODS: post_errors_to_slack 25 | IMPORTING 26 | !is_result TYPE zif_abapgit_ci_definitions=>ty_result 27 | RAISING 28 | zcx_abapgit_exception, 29 | 30 | calculate_statistics 31 | CHANGING 32 | !cs_result TYPE zif_abapgit_ci_definitions=>ty_result, 33 | 34 | collect_categories 35 | CHANGING 36 | !cs_result TYPE zif_abapgit_ci_definitions=>ty_result, 37 | 38 | count_by_status 39 | IMPORTING 40 | !is_result TYPE zif_abapgit_ci_definitions=>ty_result 41 | !iv_status TYPE zabapgit_ci_status 42 | RETURNING 43 | VALUE(rv_count) TYPE i. 44 | 45 | ENDCLASS. 46 | 47 | 48 | 49 | CLASS zcl_abapgit_ci_controller IMPLEMENTATION. 50 | 51 | 52 | METHOD calculate_statistics. 53 | 54 | cs_result-statistics-test_cases-successful 55 | = count_by_status( is_result = cs_result 56 | iv_status = zif_abapgit_ci_definitions=>co_status-ok ). 57 | 58 | cs_result-statistics-test_cases-skipped 59 | = count_by_status( is_result = cs_result 60 | iv_status = zif_abapgit_ci_definitions=>co_status-skipped ). 61 | 62 | cs_result-statistics-test_cases-failed 63 | = count_by_status( is_result = cs_result 64 | iv_status = zif_abapgit_ci_definitions=>co_status-not_ok ). 65 | 66 | cs_result-statistics-test_cases-total = cs_result-statistics-test_cases-successful 67 | + cs_result-statistics-test_cases-skipped 68 | + cs_result-statistics-test_cases-failed. 69 | 70 | IF sy-batch = abap_true. 71 | DATA(lv_msg) = |Total: { cs_result-statistics-test_cases-total }|. 72 | MESSAGE lv_msg TYPE 'I'. 73 | lv_msg = |{ icon_led_green } Passed: { cs_result-statistics-test_cases-successful }|. 74 | MESSAGE lv_msg TYPE 'I'. 75 | lv_msg = |{ icon_led_yellow } Skipped: { cs_result-statistics-test_cases-skipped }|. 76 | MESSAGE lv_msg TYPE 'I'. 77 | lv_msg = |{ icon_led_red } Failed: { cs_result-statistics-test_cases-failed }|. 78 | MESSAGE lv_msg TYPE 'I'. 79 | ENDIF. 80 | 81 | ENDMETHOD. 82 | 83 | 84 | METHOD collect_categories. 85 | 86 | CLEAR cs_result-category_list. 87 | 88 | DATA(lt_categories) = NEW zcl_abapgit_ci_repo_category( )->get_categories( ). 89 | 90 | " Process categories in given order 91 | LOOP AT lt_categories ASSIGNING FIELD-SYMBOL(). 92 | " Check if category was used 93 | READ TABLE cs_result-repo_result_list TRANSPORTING NO FIELDS 94 | WITH KEY category = -category_label. 95 | IF sy-subrc = 0. 96 | COLLECT -category_label INTO cs_result-category_list. 97 | ENDIF. 98 | ENDLOOP. 99 | 100 | ENDMETHOD. 101 | 102 | 103 | METHOD constructor. 104 | 105 | mi_view = ii_view. 106 | mi_repo_provider = ii_repo_provider. 107 | ms_options = is_options. 108 | 109 | mo_ci_repos = NEW zcl_abapgit_ci_repos( ms_options-sync_processing ). 110 | mo_ci_generic = NEW zcl_abapgit_ci_generic_tests( ). 111 | 112 | ENDMETHOD. 113 | 114 | 115 | METHOD count_by_status. 116 | 117 | rv_count = REDUCE #( INIT result = 0 118 | FOR gen_result IN is_result-generic_result_list 119 | WHERE ( status = iv_status ) 120 | NEXT result = result + 1 ) 121 | + REDUCE #( INIT result = 0 122 | FOR repo_result IN is_result-repo_result_list 123 | WHERE ( status = iv_status ) 124 | NEXT result = result + 1 ). 125 | 126 | ENDMETHOD. 127 | 128 | 129 | METHOD post_errors_to_slack. 130 | 131 | CONSTANTS: lc_url TYPE string VALUE `https://ci.abapgit.org`. 132 | 133 | DATA(lv_error_text) = REDUCE string( 134 | INIT result = || 135 | FOR line IN is_result-repo_result_list 136 | WHERE ( status = zif_abapgit_ci_definitions=>co_status-not_ok ) 137 | NEXT result = result && |\nRepo: { line-name } Message: { line-message }\n| ). 138 | 139 | NEW zcl_abapgit_ci_slack( ms_options-slack_oauth_token )->post( 140 | |*abapGit CI errors:*\n { lv_error_text } \n| 141 | && |Details: { lc_url } | ). 142 | 143 | ENDMETHOD. 144 | 145 | 146 | METHOD run. 147 | 148 | DATA: ls_result TYPE zif_abapgit_ci_definitions=>ty_result, 149 | lv_start_timestamp TYPE timestampl. 150 | 151 | GET TIME STAMP FIELD lv_start_timestamp. 152 | 153 | IF ms_options-exec_repository_checks = abap_true. 154 | DATA(lt_repos) = mi_repo_provider->get_repos( ). 155 | ls_result-repo_result_list = mo_ci_repos->process_repos( it_repos = lt_repos 156 | is_options = ms_options-repo_check_options ). 157 | ENDIF. 158 | 159 | IF ms_options-exec_generic_checks = abap_true. 160 | ls_result-generic_result_list = mo_ci_generic->execute( ). 161 | ENDIF. 162 | 163 | ls_result-ci_has_errors 164 | = boolc( line_exists( 165 | ls_result-repo_result_list[ status = zif_abapgit_ci_definitions=>co_status-not_ok ] ) 166 | OR line_exists( 167 | ls_result-generic_result_list[ status = zif_abapgit_ci_definitions=>co_status-not_ok ] ) ). 168 | 169 | GET TIME STAMP FIELD ls_result-statistics-finish_timestamp. 170 | 171 | ls_result-statistics-duration_in_seconds = cl_abap_timestamp_util=>get_instance( )->tstmpl_seconds_between( 172 | iv_timestamp0 = lv_start_timestamp 173 | iv_timestamp1 = ls_result-statistics-finish_timestamp ). 174 | 175 | calculate_statistics( CHANGING cs_result = ls_result ). 176 | 177 | collect_categories( CHANGING cs_result = ls_result ). 178 | 179 | IF ms_options-result_git_repo_url IS NOT INITIAL. 180 | NEW zcl_abapgit_ci_distributor( 181 | iv_url = ms_options-result_git_repo_url 182 | iv_save = ms_options-save_without_push 183 | iv_history = ms_options-save_to_history )->push_to_git_repo( ls_result ). 184 | ENDIF. 185 | 186 | IF ls_result-ci_has_errors = abap_true 187 | AND ms_options-post_errors_to_slack = abap_true. 188 | 189 | post_errors_to_slack( ls_result ). 190 | 191 | ENDIF. 192 | 193 | mi_view->display( CHANGING cs_result = ls_result ). 194 | 195 | ENDMETHOD. 196 | ENDCLASS. 197 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_controller.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_CONTROLLER 7 | E 8 | abapGit CI: Controller 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_distributor.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_distributor DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | 7 | METHODS constructor 8 | IMPORTING 9 | !iv_url TYPE string 10 | !iv_save TYPE abap_bool DEFAULT abap_false 11 | !iv_history TYPE abap_bool DEFAULT abap_false 12 | RAISING 13 | zcx_abapgit_exception . 14 | 15 | METHODS push_to_git_repo 16 | IMPORTING 17 | !is_result TYPE zif_abapgit_ci_definitions=>ty_result 18 | RAISING 19 | zcx_abapgit_exception . 20 | 21 | PROTECTED SECTION. 22 | PRIVATE SECTION. 23 | 24 | CONSTANTS: 25 | co_package TYPE devclass VALUE '$_ABAPGIT_CI_RESULTS', 26 | co_mime_public TYPE string VALUE '/SAP/PUBLIC', 27 | co_mime_abapgit_ci TYPE string VALUE 'ZABAPGIT_CI', 28 | co_mime_history TYPE string VALUE 'HISTORY', 29 | co_mime_result_html TYPE string VALUE 'abapGit_CI_result.html', 30 | co_mime_result_json TYPE string VALUE 'abapGit_CI_result.json', 31 | co_mime_history_html TYPE string VALUE 'result_&.html', 32 | co_mime_history_json TYPE string VALUE 'result_&.json'. 33 | 34 | DATA: 35 | mv_history TYPE abap_bool, 36 | mv_save TYPE abap_bool, 37 | mv_url TYPE string. 38 | 39 | METHODS: 40 | get_repo 41 | RETURNING 42 | VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_online 43 | RAISING 44 | zcx_abapgit_exception, 45 | 46 | create_package 47 | RAISING 48 | zcx_abapgit_exception, 49 | 50 | save_results_in_mime_repo 51 | IMPORTING 52 | is_result TYPE zif_abapgit_ci_definitions=>ty_result 53 | RAISING 54 | zcx_abapgit_exception, 55 | 56 | stage 57 | IMPORTING 58 | io_repo TYPE REF TO zcl_abapgit_repo_online 59 | RETURNING 60 | VALUE(ro_stage) TYPE REF TO zcl_abapgit_stage 61 | RAISING 62 | zcx_abapgit_exception, 63 | 64 | create_mime_folder 65 | IMPORTING 66 | !iv_folder TYPE string 67 | !iv_description TYPE string 68 | !iv_loio TYPE smimloio-loio_id 69 | RAISING 70 | zcx_abapgit_exception, 71 | 72 | add_file_to_mime_repo 73 | IMPORTING 74 | !iv_url TYPE string 75 | !iv_description TYPE string 76 | !iv_data TYPE string 77 | RAISING 78 | zcx_abapgit_exception. 79 | ENDCLASS. 80 | 81 | 82 | 83 | CLASS zcl_abapgit_ci_distributor IMPLEMENTATION. 84 | 85 | 86 | METHOD add_file_to_mime_repo. 87 | 88 | TRY. 89 | DATA(lv_xstring) = cl_bcs_convert=>string_to_xstring( iv_data ). 90 | 91 | CATCH cx_bcs INTO DATA(lx_bcs). 92 | zcx_abapgit_exception=>raise_with_text( lx_bcs ). 93 | ENDTRY. 94 | 95 | DATA(lo_mime_api) = cl_mime_repository_api=>get_api( ). 96 | 97 | lo_mime_api->put( 98 | EXPORTING 99 | i_url = iv_url 100 | i_content = lv_xstring 101 | i_description = zif_abapgit_ci_definitions=>co_title && iv_description 102 | i_dev_package = co_package 103 | EXCEPTIONS 104 | parameter_missing = 1 105 | error_occured = 2 106 | cancelled = 3 107 | permission_failure = 4 108 | data_inconsistency = 5 109 | new_loio_already_exists = 6 110 | is_folder = 7 111 | OTHERS = 8 ). 112 | 113 | IF sy-subrc <> 0. 114 | zcx_abapgit_exception=>raise_t100( ). 115 | ENDIF. 116 | 117 | ENDMETHOD. 118 | 119 | 120 | METHOD constructor. 121 | 122 | IF iv_url IS INITIAL. 123 | zcx_abapgit_exception=>raise( |Please supply Git repository URL| ). 124 | ENDIF. 125 | 126 | mv_url = iv_url. 127 | mv_save = iv_save. 128 | mv_history = iv_history. 129 | 130 | ENDMETHOD. 131 | 132 | 133 | METHOD create_mime_folder. 134 | 135 | DATA ls_loio TYPE skwf_io. 136 | 137 | SELECT SINGLE loio_id FROM smimloio INTO @ls_loio-objid WHERE prop09 = @iv_folder. 138 | IF sy-subrc <> 0. 139 | 140 | " Create folders with hardcoded IDs (otherwise system assigns new IDs which lead to diffs) 141 | ls_loio-objtype = 'F'. "folder 142 | ls_loio-class = 'M_FOLDER'. 143 | ls_loio-objid = iv_loio. 144 | 145 | DATA(lo_mime_api) = cl_mime_repository_api=>get_api( ). 146 | 147 | lo_mime_api->create_folder( 148 | EXPORTING 149 | i_url = co_mime_public && iv_folder 150 | i_description = zif_abapgit_ci_definitions=>co_title && iv_description 151 | i_dev_package = co_package 152 | i_folder_loio = ls_loio 153 | EXCEPTIONS 154 | parameter_missing = 1 155 | error_occured = 2 156 | cancelled = 3 157 | permission_failure = 4 158 | folder_exists = 5 159 | OTHERS = 6 ). 160 | IF sy-subrc <> 5 AND sy-subrc <> 0. 161 | zcx_abapgit_exception=>raise_t100( ). 162 | ENDIF. 163 | 164 | ENDIF. 165 | 166 | ENDMETHOD. 167 | 168 | 169 | METHOD create_package. 170 | 171 | DATA(lo_package) = zcl_abapgit_factory=>get_sap_package( co_package ). 172 | 173 | IF lo_package->exists( ) = abap_false. 174 | 175 | lo_package->create( VALUE #( 176 | as4user = sy-uname 177 | devclass = co_package 178 | ctext = zif_abapgit_ci_definitions=>co_title 179 | ) ). 180 | 181 | ENDIF. 182 | 183 | ENDMETHOD. 184 | 185 | 186 | METHOD get_repo. 187 | 188 | DATA: lo_repo_online TYPE REF TO zcl_abapgit_repo_online. 189 | 190 | DATA(lt_list) = zcl_abapgit_repo_srv=>get_instance( )->list( ). 191 | 192 | LOOP AT lt_list ASSIGNING FIELD-SYMBOL(). 193 | 194 | IF ->is_offline( ) = abap_false. 195 | 196 | lo_repo_online ?= . 197 | 198 | IF lo_repo_online->get_url( ) = mv_url. 199 | 200 | ro_repo = lo_repo_online. 201 | RETURN. 202 | 203 | ENDIF. 204 | 205 | ENDIF. 206 | 207 | ENDLOOP. 208 | 209 | create_package( ). 210 | 211 | create_mime_folder( 212 | iv_folder = co_mime_abapgit_ci 213 | iv_description = '' 214 | iv_loio = '0242AC1100021EEBB1BAD91FD0049E35' ). 215 | 216 | create_mime_folder( 217 | iv_folder = co_mime_history 218 | iv_description = ': History' 219 | iv_loio = '0242AC1100021EEBB1BAAF746A2D3E35' ). 220 | 221 | ro_repo ?= zcl_abapgit_repo_srv=>get_instance( )->new_online( 222 | iv_url = mv_url 223 | iv_branch_name = 'refs/heads/main' 224 | iv_package = co_package ). 225 | 226 | ENDMETHOD. 227 | 228 | 229 | METHOD push_to_git_repo. 230 | 231 | DATA: 232 | ls_comment TYPE zif_abapgit_git_definitions=>ty_comment, 233 | lv_timezone TYPE timezone. 234 | 235 | DATA(lo_repo) = get_repo( ). 236 | 237 | TRY. 238 | DATA(ls_checks) = zcl_abapgit_ci_repo_check=>get( lo_repo ). 239 | CATCH zcx_abapgit_cancel INTO DATA(lx_cancel). 240 | zcx_abapgit_exception=>raise_with_text( lx_cancel ). 241 | ENDTRY. 242 | 243 | lo_repo->deserialize( 244 | is_checks = ls_checks 245 | ii_log = NEW zcl_abapgit_log( ) ). 246 | 247 | save_results_in_mime_repo( is_result ). 248 | 249 | " Save without pushing results to repo 250 | IF mv_save = abap_true. 251 | RETURN. 252 | ENDIF. 253 | 254 | DATA(lo_stage) = stage( lo_repo ). 255 | 256 | DATA(li_user) = zcl_abapgit_env_factory=>get_user_record( ). 257 | 258 | ls_comment-committer-name = li_user->get_name( sy-uname ). 259 | ls_comment-committer-email = li_user->get_email( sy-uname ). 260 | 261 | CALL FUNCTION 'GET_SYSTEM_TIMEZONE' 262 | IMPORTING 263 | timezone = lv_timezone 264 | EXCEPTIONS 265 | customizing_missing = 1 266 | OTHERS = 2. 267 | 268 | IF sy-subrc <> 0. 269 | zcx_abapgit_exception=>raise_t100( ). 270 | ENDIF. 271 | 272 | CONVERT TIME STAMP is_result-statistics-finish_timestamp 273 | TIME ZONE lv_timezone 274 | INTO DATE DATA(lv_start_date) 275 | TIME DATA(lv_start_time). 276 | 277 | ls_comment-comment = |{ zif_abapgit_ci_definitions=>co_title }| 278 | && | from { lv_start_date DATE = USER } { lv_start_time TIME = USER }|. 279 | 280 | lo_repo->push( is_comment = ls_comment 281 | io_stage = lo_stage ). 282 | 283 | COMMIT WORK AND WAIT. 284 | 285 | ENDMETHOD. 286 | 287 | 288 | METHOD save_results_in_mime_repo. 289 | 290 | " Get results as JSON and HTML 291 | TRY. 292 | DATA(lo_json) = zcl_abapgit_ajson=>create_empty( ). 293 | 294 | lo_json->set( 295 | iv_path = '/' 296 | iv_val = is_result ). 297 | 298 | DATA(lv_json) = lo_json->stringify( 2 ). 299 | CATCH zcx_abapgit_ajson_error INTO DATA(lx_error). 300 | zcx_abapgit_exception=>raise_with_text( lx_error ). 301 | ENDTRY. 302 | 303 | DATA(lv_html) = NEW zcl_abapgit_ci_html( is_result )->render( ). 304 | 305 | " Save results to MIME repo (overwrites previous results) 306 | DATA(lv_path) = co_mime_public && '/' && co_mime_abapgit_ci && '/'. 307 | 308 | add_file_to_mime_repo( 309 | iv_description = ` (JSON)` 310 | iv_data = lv_json 311 | iv_url = lv_path && co_mime_result_json ). 312 | 313 | add_file_to_mime_repo( 314 | iv_description = ` (HTML)` 315 | iv_data = lv_html 316 | iv_url = lv_path && co_mime_result_html ). 317 | 318 | " Add results to history folder 319 | IF mv_history = abap_true. 320 | lv_path = lv_path && co_mime_history && '/'. 321 | 322 | DATA(lv_html_url) = replace( 323 | val = co_mime_history_html 324 | sub = '&' 325 | with = |{ sy-datum DATE = ISO }| ). 326 | 327 | add_file_to_mime_repo( 328 | iv_description = |: { sy-datum DATE = ISO } (HTML)| 329 | iv_data = lv_html 330 | iv_url = lv_path && lv_html_url ). 331 | 332 | DATA(lv_json_url) = replace( 333 | val = co_mime_history_json 334 | sub = '&' 335 | with = |{ sy-datum DATE = ISO }| ). 336 | 337 | add_file_to_mime_repo( 338 | iv_description = |: { sy-datum DATE = ISO } (JSON)| 339 | iv_data = lv_json 340 | iv_url = lv_path && lv_json_url ). 341 | ENDIF. 342 | 343 | ENDMETHOD. 344 | 345 | 346 | METHOD stage. 347 | 348 | ro_stage = NEW zcl_abapgit_stage( ). 349 | DATA(ls_files) = zcl_abapgit_stage_logic=>get_stage_logic( )->get( io_repo ). 350 | 351 | LOOP AT ls_files-local ASSIGNING FIELD-SYMBOL(). 352 | 353 | ro_stage->add( 354 | iv_path = -file-path 355 | iv_filename = -file-filename 356 | iv_data = -file-data ). 357 | 358 | ENDLOOP. 359 | 360 | ENDMETHOD. 361 | ENDCLASS. 362 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_distributor.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_DISTRIBUTOR 7 | E 8 | abapGit CI: Result distributor 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_generic_tests.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_generic_tests DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS: 8 | execute 9 | RETURNING 10 | VALUE(rt_result) TYPE zif_abapgit_ci_definitions=>tty_generic_result_list 11 | RAISING 12 | zcx_abapgit_exception. 13 | 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | METHODS: 17 | get_test_cases 18 | RETURNING 19 | VALUE(rt_test_cases) TYPE seo_relkeys 20 | RAISING 21 | zcx_abapgit_exception. 22 | 23 | ENDCLASS. 24 | 25 | 26 | 27 | CLASS zcl_abapgit_ci_generic_tests IMPLEMENTATION. 28 | 29 | 30 | METHOD execute. 31 | 32 | DATA: 33 | li_test TYPE REF TO zif_abapgit_ci_test, 34 | ls_result LIKE LINE OF rt_result, 35 | lv_start_timestamp TYPE timestampl, 36 | lv_finish_timestamp TYPE timestampl. 37 | 38 | DATA(lt_tests) = get_test_cases( ). 39 | 40 | LOOP AT lt_tests ASSIGNING FIELD-SYMBOL(). 41 | 42 | GET TIME STAMP FIELD lv_start_timestamp. 43 | 44 | CLEAR: ls_result. 45 | 46 | CREATE OBJECT li_test TYPE (-clsname). 47 | 48 | ls_result-status = zif_abapgit_ci_definitions=>co_status-not_ok. 49 | 50 | TRY. 51 | ls_result-description = li_test->get_description( ). 52 | DATA(lt_list) = li_test->execute( ). 53 | 54 | READ TABLE lt_list TRANSPORTING NO FIELDS WITH KEY kind = 'E'. 55 | IF sy-subrc = 0. 56 | ls_result-message = 'At least one unit test failed (see below)'. 57 | ls_result-status = zif_abapgit_ci_definitions=>co_status-not_ok. 58 | ELSE. 59 | ls_result-status = zif_abapgit_ci_definitions=>co_status-ok. 60 | ENDIF. 61 | 62 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 63 | ls_result-message = lx_error->get_text( ). 64 | ENDTRY. 65 | 66 | GET TIME STAMP FIELD lv_finish_timestamp. 67 | 68 | ls_result-duration = cl_abap_timestamp_util=>get_instance( )->tstmpl_seconds_between( 69 | iv_timestamp0 = lv_start_timestamp 70 | iv_timestamp1 = lv_finish_timestamp ). 71 | 72 | INSERT ls_result INTO TABLE rt_result. 73 | 74 | " Add individual tests as result rows 75 | LOOP AT lt_list ASSIGNING FIELD-SYMBOL() WHERE kind = 'E'. 76 | CLEAR ls_result. 77 | ls_result-description = |Unit Tests: { -objtype } { -objname }|. 78 | ls_result-status = zif_abapgit_ci_definitions=>co_status-not_ok. 79 | ls_result-message = |{ -text } [ @{ CONV i( -line ) } ]|. 80 | INSERT ls_result INTO TABLE rt_result. 81 | ENDLOOP. 82 | 83 | ENDLOOP. 84 | 85 | ENDMETHOD. 86 | 87 | 88 | METHOD get_test_cases. 89 | 90 | TRY. 91 | rt_test_cases = CAST cl_oo_interface( 92 | cl_oo_interface=>get_instance( |ZIF_ABAPGIT_CI_TEST| ) 93 | )->get_implementing_classes( ). 94 | 95 | CATCH cx_class_not_existent INTO DATA(lx_error). 96 | zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( ) 97 | ix_previous = lx_error ). 98 | ENDTRY. 99 | 100 | ENDMETHOD. 101 | ENDCLASS. 102 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_generic_tests.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_GENERIC_TESTS 7 | E 8 | abapGit CI: Execute generic CI tests 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_github_conn.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_github_conn DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS create_http_client 9 | RETURNING 10 | VALUE(ri_http_client) TYPE REF TO if_http_client 11 | RAISING 12 | zcx_abapgit_exception . 13 | PROTECTED SECTION. 14 | PRIVATE SECTION. 15 | ENDCLASS. 16 | 17 | 18 | 19 | CLASS zcl_abapgit_ci_github_conn IMPLEMENTATION. 20 | 21 | 22 | METHOD create_http_client. 23 | 24 | DATA lv_rfcdes TYPE rfcdes-rfcdest. 25 | 26 | lv_rfcdes = |API_GITHUB_{ sy-uname }|. 27 | 28 | SELECT SINGLE FROM rfcdes 29 | FIELDS rfcdest 30 | WHERE rfcdest = @lv_rfcdes 31 | INTO @lv_rfcdes. 32 | 33 | IF sy-subrc = 0. 34 | 35 | cl_http_client=>create_by_destination( 36 | EXPORTING 37 | destination = lv_rfcdes 38 | IMPORTING 39 | client = ri_http_client 40 | EXCEPTIONS 41 | argument_not_found = 1 42 | destination_not_found = 2 43 | destination_no_authority = 3 44 | plugin_not_active = 4 45 | internal_error = 5 46 | OTHERS = 6 ). 47 | 48 | ELSE. 49 | 50 | cl_http_client=>create_by_url( 51 | EXPORTING 52 | url = 'https://api.github.com' 53 | ssl_id = 'ANONYM' 54 | IMPORTING 55 | client = ri_http_client 56 | EXCEPTIONS 57 | argument_not_found = 1 58 | plugin_not_active = 2 59 | internal_error = 3 60 | OTHERS = 4 ). 61 | 62 | ENDIF. 63 | 64 | IF sy-subrc <> 0. 65 | zcx_abapgit_exception=>raise_t100( ). 66 | ENDIF. 67 | 68 | ENDMETHOD. 69 | ENDCLASS. 70 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_github_conn.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | "* use this source file for your ABAP unit test classes 2 | CLASS ltcl_connection DEFINITION 3 | FOR TESTING 4 | RISK LEVEL HARMLESS 5 | DURATION SHORT. 6 | 7 | PUBLIC SECTION. 8 | 9 | METHODS: 10 | is_http_client_bound FOR TESTING. 11 | 12 | ENDCLASS. 13 | 14 | 15 | CLASS ltcl_connection IMPLEMENTATION. 16 | 17 | METHOD is_http_client_bound. 18 | DATA li_http_client TYPE REF TO if_http_client. 19 | TRY. 20 | li_http_client = NEW zcl_abapgit_ci_github_conn( )->create_http_client( ). 21 | cl_aunit_assert=>assert_bound( act = li_http_client ). 22 | CATCH zcx_abapgit_exception. 23 | cl_aunit_assert=>assert_bound( act = li_http_client ). 24 | ENDTRY. 25 | ENDMETHOD. 26 | 27 | ENDCLASS. 28 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_github_conn.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_GITHUB_CONN 7 | E 8 | abapGit CI: GitHub connection 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_html.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_html DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | 7 | METHODS constructor 8 | IMPORTING 9 | !is_result TYPE zif_abapgit_ci_definitions=>ty_result . 10 | METHODS render 11 | RETURNING 12 | VALUE(rv_html) TYPE string 13 | RAISING 14 | zcx_abapgit_exception . 15 | PROTECTED SECTION. 16 | PRIVATE SECTION. 17 | DATA: 18 | ms_result TYPE zif_abapgit_ci_definitions=>ty_result. 19 | 20 | METHODS: 21 | get_id 22 | IMPORTING 23 | iv_value TYPE string 24 | RETURNING 25 | VALUE(rv_id) TYPE string, 26 | 27 | render_style 28 | RETURNING 29 | VALUE(rv_html) TYPE string, 30 | 31 | render_head 32 | RETURNING 33 | VALUE(rv_html) TYPE string 34 | RAISING 35 | zcx_abapgit_exception, 36 | 37 | render_table 38 | IMPORTING 39 | it_table TYPE INDEX TABLE 40 | RETURNING 41 | VALUE(rv_html) TYPE string 42 | RAISING 43 | zcx_abapgit_exception, 44 | 45 | render_table_by_category 46 | IMPORTING 47 | it_table TYPE zif_abapgit_ci_definitions=>ty_result-repo_result_list 48 | iv_category TYPE string 49 | RETURNING 50 | VALUE(rv_html) TYPE string 51 | RAISING 52 | zcx_abapgit_exception. 53 | 54 | ENDCLASS. 55 | 56 | 57 | 58 | CLASS zcl_abapgit_ci_html IMPLEMENTATION. 59 | 60 | 61 | METHOD constructor. 62 | 63 | ms_result = is_result. 64 | 65 | ENDMETHOD. 66 | 67 | 68 | METHOD get_id. 69 | 70 | rv_id = replace( 71 | val = condense( to_lower( iv_value ) ) 72 | sub = ` ` 73 | with = `_` 74 | occ = 0 ). 75 | 76 | ENDMETHOD. 77 | 78 | 79 | METHOD render. 80 | 81 | rv_html = |\n| 82 | && |\n| 83 | && | \n| 84 | && | { render_style( ) }\n| 85 | && | \n| 86 | && | { zif_abapgit_ci_definitions=>co_title }\n| 87 | && | \n| 88 | && | \n| 89 | && |

{ zif_abapgit_ci_definitions=>co_title }

\n| 90 | && | { render_head( ) }\n| 91 | && |

\n|. 92 | 93 | IF ms_result-generic_result_list IS NOT INITIAL. 94 | rv_html = rv_html 95 | && |

{ zif_abapgit_ci_definitions=>co_title_generic }

\n| 96 | && | { render_table( ms_result-generic_result_list ) }\n| 97 | && |

\n|. 98 | ENDIF. 99 | 100 | IF ms_result-repo_result_list IS NOT INITIAL. 101 | rv_html = rv_html 102 | && |

{ zif_abapgit_ci_definitions=>co_title_repos }

\n|. 103 | IF ms_result-category_list IS INITIAL. 104 | rv_html = rv_html 105 | && | { render_table( ms_result-repo_result_list ) }\n| 106 | && |

\n|. 107 | ELSE. 108 | rv_html = rv_html 109 | && | Categories: |. 110 | LOOP AT ms_result-category_list INTO DATA(lv_category). 111 | rv_html = rv_html && |{ lv_category }|. 112 | IF lines( ms_result-category_list ) <> sy-tabix. 113 | rv_html = rv_html && | \| \n|. 114 | ELSE. 115 | rv_html = rv_html && |\n|. 116 | ENDIF. 117 | ENDLOOP. 118 | rv_html = rv_html 119 | && |

\n|. 120 | LOOP AT ms_result-category_list INTO lv_category. 121 | rv_html = rv_html 122 | && |

{ lv_category }

\n| 123 | && | { render_table_by_category( 124 | it_table = ms_result-repo_result_list 125 | iv_category = lv_category ) }\n| 126 | && |

\n|. 127 | ENDLOOP. 128 | ENDIF. 129 | ENDIF. 130 | 131 | rv_html = rv_html 132 | && | \n| 133 | && ||. 134 | 135 | ENDMETHOD. 136 | 137 | 138 | METHOD render_head. 139 | 140 | DATA: lv_timezone TYPE timezone. 141 | 142 | CALL FUNCTION 'GET_SYSTEM_TIMEZONE' 143 | IMPORTING 144 | timezone = lv_timezone 145 | EXCEPTIONS 146 | customizing_missing = 1 147 | OTHERS = 2. 148 | 149 | IF sy-subrc <> 0. 150 | zcx_abapgit_exception=>raise_t100( ). 151 | ENDIF. 152 | 153 | CONVERT TIME STAMP ms_result-statistics-finish_timestamp 154 | TIME ZONE lv_timezone 155 | INTO DATE DATA(lv_date) TIME DATA(lv_time). 156 | 157 | DATA(ls_release) = zcl_abapgit_factory=>get_environment( )->get_basis_release( ). 158 | 159 | rv_html = |

| 160 | && |{ COND #( WHEN ms_result-ci_has_errors = abap_true THEN |CI Failed| ELSE |CI Successful| ) }

\n| 161 | && |

Date: { lv_date DATE = USER } | 162 | && |- Time: { lv_time TIME = USER } { lv_timezone } | 163 | && |- Duration: { ms_result-statistics-duration_in_seconds } seconds

\n| 164 | && |

abapGit Version: { zif_abapgit_version=>c_abap_version }

\n| 165 | && |

SAP Release: { ls_release-release(1) }.{ ls_release-release+1(2) } | 166 | && |SP { ls_release-sp ALPHA = OUT }

\n| 167 | && |

Repo Links: \n| 168 | && |abapGit \| \n| 169 | && |abapGit CI \| \n| 170 | && |abapGit CI results

\n| 171 | && |

Test Cases: Total: { ms_result-statistics-test_cases-total } | 172 | && || 173 | && |Successful: { ms_result-statistics-test_cases-successful } | 174 | && || 175 | && |Skipped: { ms_result-statistics-test_cases-skipped } | 176 | && || 177 | && |Failed: { ms_result-statistics-test_cases-failed }\n|. 178 | 179 | ENDMETHOD. 180 | 181 | 182 | METHOD render_style. 183 | 184 | rv_html = ``. 271 | 272 | REPLACE ALL OCCURRENCES OF `>` IN rv_html WITH |>\n|. 273 | REPLACE ALL OCCURRENCES OF `{` IN rv_html WITH |\{\n|. 274 | REPLACE ALL OCCURRENCES OF `}` IN rv_html WITH |\}\n|. 275 | REPLACE ALL OCCURRENCES OF `;` IN rv_html WITH |;\n|. 276 | 277 | ENDMETHOD. 278 | 279 | 280 | METHOD render_table. 281 | 282 | rv_html = NEW lcl_table_renderer( it_table )->render( ). 283 | 284 | ENDMETHOD. 285 | 286 | 287 | METHOD render_table_by_category. 288 | 289 | DATA lt_table LIKE it_table. 290 | 291 | LOOP AT it_table ASSIGNING FIELD-SYMBOL() WHERE category = iv_category. 292 | APPEND TO lt_table. 293 | ENDLOOP. 294 | 295 | rv_html = NEW lcl_table_renderer( lt_table )->render( ). 296 | 297 | ENDMETHOD. 298 | ENDCLASS. 299 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_html.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | CLASS lcl_table_renderer DEFINITION FINAL. 2 | 3 | PUBLIC SECTION. 4 | METHODS: 5 | constructor 6 | IMPORTING 7 | it_table TYPE INDEX TABLE, 8 | 9 | render 10 | RETURNING 11 | VALUE(rv_html) TYPE string 12 | RAISING 13 | zcx_abapgit_exception. 14 | PRIVATE SECTION. 15 | METHODS: 16 | render_table_head 17 | RETURNING 18 | VALUE(rv_html) TYPE string, 19 | 20 | render_table_lines 21 | RETURNING 22 | VALUE(rv_html) TYPE string, 23 | 24 | get_css_class_for_field 25 | IMPORTING 26 | iv_name TYPE csequence 27 | RETURNING 28 | VALUE(rv_css_class) TYPE string, 29 | 30 | get_css_class_for_status 31 | IMPORTING 32 | iv_status TYPE any 33 | RETURNING 34 | VALUE(rv_css_class) TYPE string, 35 | 36 | get_message_text 37 | IMPORTING 38 | iv_field TYPE any 39 | RETURNING 40 | VALUE(rv_value) TYPE string, 41 | 42 | get_package_text 43 | IMPORTING 44 | iv_package TYPE any 45 | RETURNING 46 | VALUE(rv_value) TYPE string, 47 | 48 | get_value_for_status 49 | IMPORTING 50 | iv_status TYPE csequence 51 | RETURNING 52 | VALUE(rv_value) TYPE string. 53 | 54 | DATA: 55 | mt_excl_columns TYPE RANGE OF fieldname, 56 | mr_table TYPE REF TO data, 57 | mo_table_descr TYPE REF TO cl_abap_tabledescr, 58 | mo_struct_descr TYPE REF TO cl_abap_structdescr. 59 | 60 | ENDCLASS. 61 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_html.clas.locals_imp.abap: -------------------------------------------------------------------------------- 1 | CLASS lcl_table_renderer IMPLEMENTATION. 2 | 3 | METHOD constructor. 4 | 5 | mr_table = REF #( it_table ). 6 | mo_table_descr ?= cl_abap_tabledescr=>describe_by_data( it_table ). 7 | mo_struct_descr ?= mo_table_descr->get_table_line_type( ). 8 | mt_excl_columns = VALUE #( ( sign = 'I' option = 'EQ' low = 'SKIP' ) 9 | ( sign = 'I' option = 'EQ' low = 'CREATE_PACKAGE' ) 10 | ( sign = 'I' option = 'EQ' low = 'DO_NOT_PURGE' ) 11 | ( sign = 'I' option = 'EQ' low = 'CATEGORY' ) 12 | ( sign = 'I' option = 'EQ' low = 'LOGGING' ) ). 13 | 14 | ENDMETHOD. 15 | 16 | 17 | METHOD render. 18 | 19 | rv_html = |\n| 20 | && | { render_table_head( ) }| 21 | && | { render_table_lines( ) }| 22 | && |
\n|. 23 | 24 | ENDMETHOD. 25 | 26 | 27 | METHOD render_table_head. 28 | 29 | rv_html = |\n|. 30 | rv_html = rv_html && |\n|. 31 | 32 | LOOP AT mo_struct_descr->get_components( ) ASSIGNING FIELD-SYMBOL() 33 | WHERE name NOT IN mt_excl_columns. 34 | 35 | rv_html = rv_html 36 | && || 37 | && |{ CAST cl_abap_elemdescr( -type 38 | )->get_ddic_field( 39 | )-scrtext_m }| 40 | && |\n|. 41 | 42 | ENDLOOP. 43 | 44 | rv_html = rv_html && |\n|. 45 | rv_html = rv_html && |\n|. 46 | 47 | ENDMETHOD. 48 | 49 | 50 | METHOD render_table_lines. 51 | 52 | FIELD-SYMBOLS: TYPE INDEX TABLE. 53 | 54 | ASSIGN mr_table->* TO . 55 | ASSERT sy-subrc = 0. 56 | 57 | rv_html = |\n|. 58 | 59 | LOOP AT ASSIGNING FIELD-SYMBOL(). 60 | 61 | rv_html = rv_html && |\n|. 62 | 63 | LOOP AT mo_struct_descr->get_components( ) ASSIGNING FIELD-SYMBOL() 64 | WHERE name NOT IN mt_excl_columns. 65 | 66 | ASSIGN COMPONENT -name 67 | OF STRUCTURE 68 | TO FIELD-SYMBOL(). 69 | ASSERT sy-subrc = 0. 70 | 71 | IF -name CS |URL|. 72 | rv_html = rv_html && || 73 | && |Repo\n|. 74 | ELSEIF -type->get_ddic_header( )-refname CS |STATUS|. 75 | rv_html = rv_html && || 77 | && |{ get_value_for_status( ) }\n|. 78 | ELSEIF -name = |MESSAGE|. 79 | rv_html = rv_html && || 80 | && |{ get_message_text( ) }\n|. 81 | ELSEIF -name = |PACKAGE|. 82 | rv_html = rv_html && || 83 | && |{ get_package_text( ) }\n|. 84 | ELSE. 85 | rv_html = rv_html && || 86 | && |{ }\n|. 87 | ENDIF. 88 | 89 | ENDLOOP. 90 | 91 | rv_html = rv_html && |\n|. 92 | 93 | ENDLOOP. 94 | 95 | rv_html = rv_html && |\n|. 96 | 97 | ENDMETHOD. 98 | 99 | METHOD get_css_class_for_field. 100 | 101 | CASE iv_name. 102 | WHEN 'NAME'. 103 | rv_css_class = 'key repo_name'. 104 | WHEN 'PACKAGE'. 105 | rv_css_class = 'key repo_pack'. 106 | WHEN 'DESCRIPTION'. 107 | rv_css_class = 'key'. 108 | WHEN 'STATUS'. 109 | rv_css_class = 'total'. 110 | WHEN 'LAYER'. 111 | rv_css_class = 'layer'. 112 | WHEN 'DURATION'. 113 | rv_css_class = 'duration'. 114 | ENDCASE. 115 | 116 | ENDMETHOD. 117 | 118 | METHOD get_css_class_for_status. 119 | 120 | rv_css_class = SWITCH #( 121 | |{ iv_status }| 122 | WHEN zif_abapgit_ci_definitions=>co_status-ok THEN |status ok| 123 | WHEN zif_abapgit_ci_definitions=>co_status-not_ok THEN |status not_ok| 124 | WHEN zif_abapgit_ci_definitions=>co_status-undefined THEN |status undefined| 125 | WHEN zif_abapgit_ci_definitions=>co_status-skipped THEN |skipped| 126 | ELSE || ). 127 | 128 | ENDMETHOD. 129 | 130 | METHOD get_value_for_status. 131 | 132 | rv_value = SWITCH #( 133 | |{ iv_status }| 134 | WHEN zif_abapgit_ci_definitions=>co_status-ok THEN |✓| "check mark 135 | WHEN zif_abapgit_ci_definitions=>co_status-not_ok THEN |✗| "cross mark 136 | WHEN zif_abapgit_ci_definitions=>co_status-skipped THEN |↦| "arrow right 137 | ELSE |{ iv_status }| ). 138 | 139 | ENDMETHOD. 140 | 141 | METHOD get_message_text. 142 | 143 | rv_value = replace( val = iv_field 144 | regex = '(http.*/)(\d*)' 145 | with = '#$2' 146 | occ = 0 ). 147 | 148 | rv_value = replace( val = rv_value 149 | regex = '\n' 150 | with = '
' 151 | occ = 0 ). 152 | 153 | ENDMETHOD. 154 | 155 | METHOD get_package_text. 156 | 157 | rv_value = SWITCH #( 158 | |{ iv_package(1) }| 159 | WHEN '$' THEN |Local ($)| 160 | WHEN 'Z' THEN |Transport (Z)| 161 | ELSE |{ iv_package }| ). 162 | 163 | ENDMETHOD. 164 | 165 | ENDCLASS. 166 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_html.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_HTML 7 | E 8 | abapGit CI: HTML renderer 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_job_scheduler.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_job_scheduler DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | CONSTANTS: 7 | BEGIN OF co_report, 8 | update_abapgit TYPE sy-repid VALUE 'ZABAPGIT_CI_UPDATE_ABAPGIT', 9 | update_abapgit_ci TYPE sy-repid VALUE 'ZABAPGIT_CI_UPDATE_ABAPGIT_CI', 10 | run_abapgit_ci TYPE sy-repid VALUE 'ZABAPGIT_CI', 11 | cleanup_abapgit_ci TYPE sy-repid VALUE 'ZABAPGIT_CI_CLEANUP', 12 | END OF co_report. 13 | 14 | METHODS: 15 | constructor 16 | IMPORTING 17 | iv_variant_update_abapgit TYPE raldb-variant OPTIONAL 18 | iv_variant_update_abapgit_ci TYPE raldb-variant OPTIONAL 19 | iv_variant_run_abapgit_ci TYPE raldb-variant OPTIONAL 20 | iv_variant_cleanup1_abapgit_ci TYPE raldb-variant OPTIONAL 21 | iv_variant_cleanup2_abapgit_ci TYPE raldb-variant OPTIONAL 22 | iv_variant_cleanup3_abapgit_ci TYPE raldb-variant OPTIONAL, 23 | 24 | schedule_jobs 25 | RAISING 26 | zcx_abapgit_exception. 27 | PROTECTED SECTION. 28 | CONSTANTS: 29 | BEGIN OF co_job_name, 30 | update_abapgit TYPE btcjob VALUE 'ABAPGIT CI: UPDATE ABAPGIT', 31 | update_abapgit_ci TYPE btcjob VALUE 'ABAPGIT CI: UPDATE ABAPGIT CI', 32 | run_abapgit_ci TYPE btcjob VALUE 'ABAPGIT CI: RUN ABAPGIT CI', 33 | cleanup_abapgit_ci TYPE btcjob VALUE 'ABAPGIT CI: CLEANUP ABAPGIT CI', 34 | END OF co_job_name. 35 | 36 | METHODS: 37 | schedule_update_abapgit 38 | RETURNING 39 | VALUE(rv_jobcount) TYPE tbtcjob-jobcount 40 | RAISING 41 | zcx_abapgit_exception, 42 | 43 | schedule_job_with_predecessor 44 | IMPORTING 45 | iv_pred_jobcount TYPE tbtcjob-jobcount 46 | iv_new_jobname TYPE btcjob 47 | iv_report TYPE sy-repid 48 | iv_pred_jobname TYPE tbtcjob-jobname 49 | iv_variant TYPE raldb-variant OPTIONAL 50 | RETURNING 51 | VALUE(rv_new_jobcount) TYPE tbtcjob-jobcount 52 | RAISING 53 | zcx_abapgit_exception. 54 | 55 | PRIVATE SECTION. 56 | DATA: 57 | mv_variant_update_abapgit TYPE raldb-variant, 58 | mv_variant_update_abapgit_ci TYPE raldb-variant, 59 | mv_variant_run_abapgit_ci TYPE raldb-variant, 60 | mv_variant_cleanup1_abapgit_ci TYPE raldb-variant, 61 | mv_variant_cleanup2_abapgit_ci TYPE raldb-variant, 62 | mv_variant_cleanup3_abapgit_ci TYPE raldb-variant. 63 | 64 | ENDCLASS. 65 | 66 | 67 | 68 | CLASS ZCL_ABAPGIT_CI_JOB_SCHEDULER IMPLEMENTATION. 69 | 70 | 71 | METHOD constructor. 72 | 73 | mv_variant_update_abapgit = iv_variant_update_abapgit. 74 | mv_variant_update_abapgit_ci = iv_variant_update_abapgit_ci. 75 | mv_variant_run_abapgit_ci = iv_variant_run_abapgit_ci. 76 | mv_variant_cleanup1_abapgit_ci = iv_variant_cleanup1_abapgit_ci. 77 | mv_variant_cleanup2_abapgit_ci = iv_variant_cleanup2_abapgit_ci. 78 | mv_variant_cleanup3_abapgit_ci = iv_variant_cleanup3_abapgit_ci. 79 | 80 | ENDMETHOD. 81 | 82 | 83 | METHOD schedule_jobs. 84 | 85 | DATA(lv_jobcount_update_abapgit) = schedule_update_abapgit( ). 86 | 87 | DATA(lv_jobcount_update_abapgit_ci) = schedule_job_with_predecessor( 88 | iv_pred_jobcount = lv_jobcount_update_abapgit 89 | iv_pred_jobname = co_job_name-update_abapgit 90 | iv_new_jobname = co_job_name-update_abapgit_ci 91 | iv_report = co_report-update_abapgit_ci 92 | iv_variant = mv_variant_update_abapgit_ci ). 93 | 94 | schedule_job_with_predecessor( 95 | iv_pred_jobcount = lv_jobcount_update_abapgit_ci 96 | iv_pred_jobname = co_job_name-update_abapgit_ci 97 | iv_new_jobname = co_job_name-run_abapgit_ci 98 | iv_report = co_report-run_abapgit_ci 99 | iv_variant = mv_variant_run_abapgit_ci ). 100 | 101 | IF mv_variant_cleanup1_abapgit_ci IS NOT INITIAL. 102 | schedule_job_with_predecessor( 103 | iv_pred_jobcount = lv_jobcount_update_abapgit_ci 104 | iv_pred_jobname = co_job_name-run_abapgit_ci 105 | iv_new_jobname = co_job_name-cleanup_abapgit_ci && '-1' 106 | iv_report = co_report-cleanup_abapgit_ci 107 | iv_variant = mv_variant_cleanup1_abapgit_ci ). 108 | ENDIF. 109 | 110 | IF mv_variant_cleanup2_abapgit_ci IS NOT INITIAL. 111 | schedule_job_with_predecessor( 112 | iv_pred_jobcount = lv_jobcount_update_abapgit_ci 113 | iv_pred_jobname = co_job_name-cleanup_abapgit_ci && '-1' 114 | iv_new_jobname = co_job_name-cleanup_abapgit_ci && '-2' 115 | iv_report = co_report-cleanup_abapgit_ci 116 | iv_variant = mv_variant_cleanup2_abapgit_ci ). 117 | ENDIF. 118 | 119 | IF mv_variant_cleanup3_abapgit_ci IS NOT INITIAL. 120 | schedule_job_with_predecessor( 121 | iv_pred_jobcount = lv_jobcount_update_abapgit_ci 122 | iv_pred_jobname = co_job_name-cleanup_abapgit_ci && '-2' 123 | iv_new_jobname = co_job_name-cleanup_abapgit_ci && '-3' 124 | iv_report = co_report-cleanup_abapgit_ci 125 | iv_variant = mv_variant_cleanup3_abapgit_ci ). 126 | ENDIF. 127 | 128 | ENDMETHOD. 129 | 130 | 131 | METHOD schedule_job_with_predecessor. 132 | 133 | CALL FUNCTION 'JOB_OPEN' 134 | EXPORTING 135 | jobname = iv_new_jobname 136 | IMPORTING 137 | jobcount = rv_new_jobcount 138 | EXCEPTIONS 139 | cant_create_job = 1 140 | invalid_job_data = 2 141 | jobname_missing = 3 142 | OTHERS = 4. 143 | 144 | IF sy-subrc <> 0. 145 | zcx_abapgit_exception=>raise_t100( ). 146 | ENDIF. 147 | 148 | CALL FUNCTION 'JOB_SUBMIT' 149 | EXPORTING 150 | authcknam = sy-uname 151 | jobcount = rv_new_jobcount 152 | jobname = iv_new_jobname 153 | report = iv_report 154 | variant = iv_variant 155 | EXCEPTIONS 156 | bad_priparams = 1 157 | bad_xpgflags = 2 158 | invalid_jobdata = 3 159 | jobname_missing = 4 160 | job_notex = 5 161 | job_submit_failed = 6 162 | lock_failed = 7 163 | program_missing = 8 164 | prog_abap_and_extpg_set = 9 165 | OTHERS = 10. 166 | 167 | IF sy-subrc <> 0. 168 | zcx_abapgit_exception=>raise_t100( ). 169 | ENDIF. 170 | 171 | CALL FUNCTION 'JOB_CLOSE' 172 | EXPORTING 173 | jobcount = rv_new_jobcount 174 | jobname = iv_new_jobname 175 | pred_jobname = iv_pred_jobname 176 | pred_jobcount = iv_pred_jobcount 177 | predjob_checkstat = abap_true 178 | EXCEPTIONS 179 | cant_start_immediate = 1 180 | invalid_startdate = 2 181 | jobname_missing = 3 182 | job_close_failed = 4 183 | job_nosteps = 5 184 | job_notex = 6 185 | lock_failed = 7 186 | invalid_target = 8 187 | invalid_time_zone = 9 188 | OTHERS = 10. 189 | 190 | IF sy-subrc <> 0. 191 | zcx_abapgit_exception=>raise_t100( ). 192 | ENDIF. 193 | 194 | ENDMETHOD. 195 | 196 | 197 | METHOD schedule_update_abapgit. 198 | 199 | CALL FUNCTION 'JOB_OPEN' 200 | EXPORTING 201 | jobname = co_job_name-update_abapgit 202 | IMPORTING 203 | jobcount = rv_jobcount 204 | EXCEPTIONS 205 | cant_create_job = 1 206 | invalid_job_data = 2 207 | jobname_missing = 3 208 | OTHERS = 4. 209 | 210 | IF sy-subrc <> 0. 211 | zcx_abapgit_exception=>raise_t100( ). 212 | ENDIF. 213 | 214 | CALL FUNCTION 'JOB_SUBMIT' 215 | EXPORTING 216 | authcknam = sy-uname 217 | jobcount = rv_jobcount 218 | jobname = co_job_name-update_abapgit 219 | report = co_report-update_abapgit 220 | variant = mv_variant_update_abapgit 221 | EXCEPTIONS 222 | bad_priparams = 1 223 | bad_xpgflags = 2 224 | invalid_jobdata = 3 225 | jobname_missing = 4 226 | job_notex = 5 227 | job_submit_failed = 6 228 | lock_failed = 7 229 | program_missing = 8 230 | prog_abap_and_extpg_set = 9 231 | OTHERS = 10. 232 | 233 | IF sy-subrc <> 0. 234 | zcx_abapgit_exception=>raise_t100( ). 235 | ENDIF. 236 | 237 | CALL FUNCTION 'JOB_CLOSE' 238 | EXPORTING 239 | jobcount = rv_jobcount 240 | jobname = co_job_name-update_abapgit 241 | strtimmed = abap_true 242 | EXCEPTIONS 243 | cant_start_immediate = 1 244 | invalid_startdate = 2 245 | jobname_missing = 3 246 | job_close_failed = 4 247 | job_nosteps = 5 248 | job_notex = 6 249 | lock_failed = 7 250 | invalid_target = 8 251 | invalid_time_zone = 9 252 | OTHERS = 10. 253 | 254 | IF sy-subrc <> 0. 255 | zcx_abapgit_exception=>raise_t100( ). 256 | ENDIF. 257 | 258 | ENDMETHOD. 259 | ENDCLASS. 260 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_job_scheduler.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_JOB_SCHEDULER 7 | E 8 | abapGit CI: Job scheduler 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_latest_build.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_latest_build DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC. 4 | 5 | PUBLIC SECTION. 6 | 7 | INTERFACES zif_abapgit_ci_test . 8 | 9 | METHODS constructor 10 | RAISING 11 | zcx_abapgit_exception . 12 | PROTECTED SECTION. 13 | PRIVATE SECTION. 14 | CONSTANTS: 15 | co_report_name TYPE char30 VALUE 'Z___ABAPGIT_LATEST_BUILD', 16 | co_package TYPE devclass VALUE '$___ABAPGIT_LATEST_BUILD', 17 | co_repository TYPE string VALUE 'https://raw.githubusercontent.com', 18 | co_program_url TYPE string VALUE '/abapGit/build/main/zabapgit_standalone.prog.abap'. 19 | 20 | DATA: 21 | mt_latest_build TYPE string_table, 22 | mi_package TYPE REF TO zif_abapgit_sap_package. 23 | 24 | METHODS: 25 | fetch_latest_build 26 | RAISING 27 | zcx_abapgit_exception, 28 | 29 | install 30 | RAISING 31 | zcx_abapgit_exception, 32 | 33 | check 34 | RAISING 35 | zcx_abapgit_exception, 36 | 37 | delete 38 | RAISING 39 | zcx_abapgit_exception, 40 | 41 | delete_tadir_entry 42 | RAISING 43 | zcx_abapgit_exception, 44 | 45 | post_check 46 | RAISING 47 | zcx_abapgit_exception. 48 | 49 | ENDCLASS. 50 | 51 | 52 | 53 | CLASS zcl_abapgit_ci_latest_build IMPLEMENTATION. 54 | 55 | 56 | METHOD check. 57 | 58 | DATA(lt_list) = zcl_abapgit_code_inspector=>get_code_inspector( co_package )->run( 'SYNTAX_CHECK' ). 59 | 60 | ASSIGN lt_list[ kind = 'E' ] TO FIELD-SYMBOL(). 61 | IF sy-subrc = 0. 62 | zcx_abapgit_exception=>raise( |Latest build - Syntax Error: { -text }, line { -line } | ). 63 | ENDIF. 64 | 65 | ENDMETHOD. 66 | 67 | 68 | METHOD constructor. 69 | 70 | mi_package = zcl_abapgit_factory=>get_sap_package( co_package ). 71 | 72 | ENDMETHOD. 73 | 74 | 75 | METHOD delete. 76 | 77 | DELETE REPORT co_report_name. 78 | IF sy-subrc <> 0. 79 | zcx_abapgit_exception=>raise( |Latest build: Deletion failed. Subrc = { sy-subrc }| ). 80 | ENDIF. 81 | 82 | delete_tadir_entry( ). 83 | 84 | DATA(lo_package) = NEW zcl_abapgit_object_devc( is_item = VALUE #( obj_type = 'DEVC' 85 | obj_name = co_package 86 | devclass = co_package ) 87 | iv_language = sy-langu ). 88 | 89 | lo_package->zif_abapgit_object~delete( 90 | iv_package = co_package 91 | iv_transport = space ). 92 | ENDMETHOD. 93 | 94 | 95 | METHOD delete_tadir_entry. 96 | 97 | CALL FUNCTION 'TR_TADIR_INTERFACE' 98 | EXPORTING 99 | wi_delete_tadir_entry = 'X' 100 | wi_test_modus = ' ' 101 | wi_tadir_pgmid = 'R3TR' 102 | wi_tadir_object = 'PROG' 103 | wi_tadir_obj_name = CONV sobj_name( co_report_name ) 104 | EXCEPTIONS 105 | tadir_entry_not_existing = 1 106 | tadir_entry_ill_type = 2 107 | no_systemname = 3 108 | no_systemtype = 4 109 | original_system_conflict = 5 110 | object_reserved_for_devclass = 6 111 | object_exists_global = 7 112 | object_exists_local = 8 113 | object_is_distributed = 9 114 | obj_specification_not_unique = 10 115 | no_authorization_to_delete = 11 116 | devclass_not_existing = 12 117 | simultanious_set_remove_repair = 13 118 | order_missing = 14 119 | no_modification_of_head_syst = 15 120 | pgmid_object_not_allowed = 16 121 | masterlanguage_not_specified = 17 122 | devclass_not_specified = 18 123 | specify_owner_unique = 19 124 | loc_priv_objs_no_repair = 20 125 | gtadir_not_reached = 21 126 | object_locked_for_order = 22 127 | change_of_class_not_allowed = 23 128 | no_change_from_sap_to_tmp = 24 129 | OTHERS = 25. 130 | 131 | IF sy-subrc <> 0. 132 | zcx_abapgit_exception=>raise( |Latest build: Deletion failed. TR_TADIR_INTERFACE Subrc = { sy-subrc }| ). 133 | ENDIF. 134 | 135 | ENDMETHOD. 136 | 137 | 138 | METHOD fetch_latest_build. 139 | 140 | DATA: li_http_client TYPE REF TO if_http_client. 141 | 142 | cl_http_client=>create_by_url( 143 | EXPORTING 144 | url = co_repository 145 | ssl_id = 'ANONYM' 146 | IMPORTING 147 | client = li_http_client 148 | EXCEPTIONS 149 | argument_not_found = 1 150 | plugin_not_active = 2 151 | internal_error = 3 152 | OTHERS = 4 ). 153 | 154 | IF sy-subrc <> 0. 155 | zcx_abapgit_exception=>raise_t100( ). 156 | ENDIF. 157 | 158 | DATA(lo_rest_client) = NEW cl_rest_http_client( li_http_client ). 159 | 160 | lo_rest_client->if_rest_client~create_request_entity( )->set_header_field( 161 | iv_name = '~request_uri' 162 | iv_value = co_program_url ). 163 | 164 | lo_rest_client->if_rest_client~get( ). 165 | 166 | DATA(lo_response) = lo_rest_client->if_rest_client~get_response_entity( ). 167 | 168 | DATA(lv_status) = lo_rest_client->if_rest_client~get_status( ). 169 | 170 | IF lv_status <> cl_rest_status_code=>gc_success_ok. 171 | zcx_abapgit_exception=>raise( 172 | |HTTP status code { lv_status } | 173 | && |from { co_repository }{ co_program_url }| ). 174 | ENDIF. 175 | 176 | SPLIT lo_response->get_string_data( ) 177 | AT cl_abap_char_utilities=>newline 178 | INTO TABLE mt_latest_build. 179 | 180 | ENDMETHOD. 181 | 182 | 183 | METHOD install. 184 | 185 | IF mi_package->exists( ) = abap_false. 186 | 187 | mi_package->create( VALUE #( 188 | as4user = sy-uname 189 | devclass = co_package 190 | ctext = |abapGit latest build| 191 | ) ). 192 | 193 | ENDIF. 194 | 195 | INSERT REPORT co_report_name 196 | FROM mt_latest_build 197 | STATE 'A' 198 | PROGRAM TYPE '1'. 199 | 200 | IF sy-subrc <> 0. 201 | zcx_abapgit_exception=>raise( |Latest build: Installation failed. Subrc = { sy-subrc }| ). 202 | ENDIF. 203 | 204 | CALL FUNCTION 'RS_CORR_INSERT' 205 | EXPORTING 206 | object = co_report_name 207 | object_class = 'ABAP' 208 | devclass = co_package 209 | master_language = sy-langu 210 | mode = 'INSERT' 211 | EXCEPTIONS 212 | cancelled = 1 213 | permission_failure = 2 214 | unknown_objectclass = 3 215 | OTHERS = 4. 216 | 217 | IF sy-subrc <> 0. 218 | zcx_abapgit_exception=>raise( |Latest build: Installation failed. RS_CORR_INSERT Subrc = { sy-subrc }| ). 219 | ENDIF. 220 | 221 | ENDMETHOD. 222 | 223 | 224 | METHOD post_check. 225 | 226 | SELECT SINGLE FROM tadir 227 | FIELDS object, 228 | obj_name 229 | WHERE devclass = @co_package 230 | INTO @DATA(ls_object). 231 | 232 | IF sy-subrc = 0. 233 | zcx_abapgit_exception=>raise( |Latest build: Post check failed. | 234 | && |Left over object { ls_object-object } { ls_object-obj_name }| ). 235 | ENDIF. 236 | 237 | ENDMETHOD. 238 | 239 | 240 | METHOD zif_abapgit_ci_test~execute. 241 | 242 | fetch_latest_build( ). 243 | install( ). 244 | check( ). 245 | delete( ). 246 | post_check( ). 247 | 248 | ENDMETHOD. 249 | 250 | 251 | METHOD zif_abapgit_ci_test~get_description. 252 | rv_description = |Check latest abapGit build|. 253 | ENDMETHOD. 254 | ENDCLASS. 255 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_latest_build.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_LATEST_BUILD 7 | E 8 | abapGit CI: Check latest build 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_log.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_log DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | 8 | CONSTANTS: 9 | co_package TYPE devclass VALUE '$TMP', 10 | co_prefix TYPE string VALUE 'ZABAPGIT_CI_', 11 | co_all TYPE string VALUE 'ZABAPGIT_CI_%'. 12 | 13 | METHODS is_active 14 | IMPORTING 15 | iv_log_type TYPE csequence 16 | RETURNING 17 | VALUE(rv_logging) TYPE abap_bool. 18 | 19 | METHODS add 20 | IMPORTING 21 | !iv_log_object TYPE string 22 | !ig_data TYPE any OPTIONAL 23 | RETURNING 24 | VALUE(rv_key) TYPE string 25 | RAISING 26 | zcx_abapgit_exception. 27 | 28 | METHODS drop_all 29 | RAISING 30 | zcx_abapgit_exception. 31 | 32 | METHODS callstack 33 | RAISING 34 | zcx_abapgit_exception. 35 | 36 | PROTECTED SECTION. 37 | PRIVATE SECTION. 38 | 39 | TYPES: 40 | ty_wwwparams_tt TYPE STANDARD TABLE OF wwwparams WITH DEFAULT KEY. 41 | 42 | CONSTANTS: 43 | BEGIN OF co_param_names, 44 | version TYPE w3_name VALUE 'version', 45 | fileext TYPE w3_name VALUE 'fileextension', 46 | filesize TYPE w3_name VALUE 'filesize', 47 | filename TYPE w3_name VALUE 'filename', 48 | mimetype TYPE w3_name VALUE 'mimetype', 49 | END OF co_param_names. 50 | 51 | METHODS get_next_objid 52 | RETURNING 53 | VALUE(rv_objid) TYPE string. 54 | 55 | METHODS set_params 56 | IMPORTING 57 | !is_key TYPE wwwdatatab 58 | !iv_size TYPE i 59 | !iv_name TYPE string 60 | RETURNING 61 | VALUE(rt_params) TYPE ty_wwwparams_tt 62 | RAISING 63 | zcx_abapgit_exception. 64 | 65 | METHODS stringify 66 | IMPORTING 67 | !ig_data TYPE any 68 | RETURNING 69 | VALUE(rv_string) TYPE string 70 | RAISING 71 | zcx_abapgit_exception. 72 | 73 | ENDCLASS. 74 | 75 | 76 | 77 | CLASS zcl_abapgit_ci_log IMPLEMENTATION. 78 | 79 | 80 | METHOD add. 81 | 82 | DATA: 83 | lv_xstring TYPE xstring, 84 | lv_obj_name TYPE tadir-obj_name, 85 | lv_size TYPE i, 86 | lt_w3params TYPE STANDARD TABLE OF wwwparams, 87 | lt_w3mime TYPE STANDARD TABLE OF w3mime, 88 | lt_w3html TYPE STANDARD TABLE OF w3html. 89 | 90 | IF ig_data IS INITIAL. 91 | RETURN. 92 | ENDIF. 93 | 94 | lv_obj_name = get_next_objid( ). 95 | 96 | DATA(ls_key) = VALUE wwwdatatab( 97 | relid = 'MI' 98 | objid = lv_obj_name 99 | text = iv_log_object 100 | tdate = sy-datum 101 | ttime = sy-uzeit 102 | chname = sy-uname 103 | devclass = co_package ). 104 | 105 | lv_xstring = zcl_abapgit_convert=>string_to_xstring_utf8( stringify( ig_data ) ). 106 | 107 | CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' 108 | EXPORTING 109 | buffer = lv_xstring 110 | IMPORTING 111 | output_length = lv_size 112 | TABLES 113 | binary_tab = lt_w3mime. 114 | 115 | lt_w3params = set_params( 116 | is_key = ls_key 117 | iv_size = lv_size 118 | iv_name = iv_log_object ). 119 | 120 | CALL FUNCTION 'WWWPARAMS_UPDATE' 121 | TABLES 122 | params = lt_w3params 123 | EXCEPTIONS 124 | update_error = 1 125 | OTHERS = 2. 126 | IF sy-subrc <> 0. 127 | zcx_abapgit_exception=>raise( 'Cannot update W3MI params' ). 128 | ENDIF. 129 | 130 | CALL FUNCTION 'WWWDATA_EXPORT' 131 | EXPORTING 132 | key = ls_key 133 | TABLES 134 | mime = lt_w3mime 135 | html = lt_w3html 136 | EXCEPTIONS 137 | wrong_object_type = 1 138 | export_error = 2 139 | OTHERS = 3. 140 | IF sy-subrc <> 0. 141 | zcx_abapgit_exception=>raise( 'Cannot upload W3MI data' ). 142 | ENDIF. 143 | 144 | CALL FUNCTION 'TR_TADIR_INTERFACE' 145 | EXPORTING 146 | wi_tadir_pgmid = 'R3TR' 147 | wi_tadir_object = 'W3MI' 148 | wi_tadir_obj_name = lv_obj_name 149 | wi_tadir_devclass = co_package 150 | wi_test_modus = space 151 | EXCEPTIONS 152 | tadir_entry_not_existing = 1 153 | tadir_entry_ill_type = 2 154 | no_systemname = 3 155 | no_systemtype = 4 156 | original_system_conflict = 5 157 | object_reserved_for_devclass = 6 158 | object_exists_global = 7 159 | object_exists_local = 8 160 | object_is_distributed = 9 161 | obj_specification_not_unique = 10 162 | no_authorization_to_delete = 11 163 | devclass_not_existing = 12 164 | simultanious_set_remove_repair = 13 165 | order_missing = 14 166 | no_modification_of_head_syst = 15 167 | pgmid_object_not_allowed = 16 168 | masterlanguage_not_specified = 17 169 | devclass_not_specified = 18 170 | specify_owner_unique = 19 171 | loc_priv_objs_no_repair = 20 172 | gtadir_not_reached = 21 173 | object_locked_for_order = 22 174 | change_of_class_not_allowed = 23 175 | no_change_from_sap_to_tmp = 24 176 | OTHERS = 99. 177 | IF sy-subrc <> 0. 178 | zcx_abapgit_exception=>raise( 'Cannot update TADIR for W3MI' ). 179 | ENDIF. 180 | 181 | rv_key = lv_obj_name. 182 | 183 | ENDMETHOD. 184 | 185 | 186 | METHOD callstack. 187 | 188 | DATA lt_callstack TYPE abap_callstack. 189 | 190 | CALL FUNCTION 'SYSTEM_CALLSTACK' 191 | IMPORTING 192 | callstack = lt_callstack. 193 | 194 | add( 195 | iv_log_object = |Callstack| 196 | ig_data = lt_callstack ). 197 | 198 | ENDMETHOD. 199 | 200 | 201 | METHOD drop_all. 202 | 203 | DATA lt_tadir TYPE STANDARD TABLE OF tadir WITH DEFAULT KEY. 204 | 205 | SELECT * FROM tadir INTO TABLE @lt_tadir 206 | WHERE pgmid = 'R3TR' AND object = 'W3MI' AND obj_name LIKE @co_all AND devclass = @co_package 207 | ORDER BY PRIMARY KEY. 208 | 209 | LOOP AT lt_tadir INTO DATA(ls_tadir). 210 | 211 | DATA(ls_key) = VALUE wwwdatatab( 212 | relid = 'MI' 213 | objid = ls_tadir-obj_name 214 | devclass = co_package ). 215 | 216 | CALL FUNCTION 'WWWDATA_DELETE' 217 | EXPORTING 218 | key = ls_key 219 | EXCEPTIONS 220 | wrong_object_type = 1 221 | delete_error = 2 222 | OTHERS = 3. 223 | IF sy-subrc <> 0. 224 | zcx_abapgit_exception=>raise( 'Cannot delete W3MI data' ). 225 | ENDIF. 226 | 227 | CALL FUNCTION 'WWWPARAMS_DELETE_ALL' 228 | EXPORTING 229 | key = ls_key 230 | EXCEPTIONS 231 | delete_error = 1 232 | OTHERS = 2. 233 | IF sy-subrc <> 0. 234 | zcx_abapgit_exception=>raise( 'Cannot delete W3MI params' ). 235 | ENDIF. 236 | 237 | CALL FUNCTION 'TR_TADIR_INTERFACE' 238 | EXPORTING 239 | wi_delete_tadir_entry = abap_true 240 | wi_tadir_pgmid = ls_tadir-pgmid 241 | wi_tadir_object = ls_tadir-object 242 | wi_tadir_obj_name = ls_tadir-obj_name 243 | wi_tadir_devclass = ls_tadir-devclass 244 | wi_test_modus = space 245 | EXCEPTIONS 246 | tadir_entry_not_existing = 1 247 | tadir_entry_ill_type = 2 248 | no_systemname = 3 249 | no_systemtype = 4 250 | original_system_conflict = 5 251 | object_reserved_for_devclass = 6 252 | object_exists_global = 7 253 | object_exists_local = 8 254 | object_is_distributed = 9 255 | obj_specification_not_unique = 10 256 | no_authorization_to_delete = 11 257 | devclass_not_existing = 12 258 | simultanious_set_remove_repair = 13 259 | order_missing = 14 260 | no_modification_of_head_syst = 15 261 | pgmid_object_not_allowed = 16 262 | masterlanguage_not_specified = 17 263 | devclass_not_specified = 18 264 | specify_owner_unique = 19 265 | loc_priv_objs_no_repair = 20 266 | gtadir_not_reached = 21 267 | object_locked_for_order = 22 268 | change_of_class_not_allowed = 23 269 | no_change_from_sap_to_tmp = 24 270 | OTHERS = 99. 271 | IF sy-subrc <> 0. 272 | zcx_abapgit_exception=>raise( 'Cannot delete TADIR for W3MI' ). 273 | ENDIF. 274 | 275 | ENDLOOP. 276 | 277 | ENDMETHOD. 278 | 279 | 280 | METHOD get_next_objid. 281 | 282 | DATA: 283 | lv_obj_name TYPE tadir-obj_name, 284 | lv_counter TYPE n LENGTH 10. 285 | 286 | SELECT MAX( obj_name ) FROM tadir INTO @lv_obj_name 287 | WHERE pgmid = 'R3TR' AND object = 'W3MI' AND obj_name LIKE @co_all AND devclass = @co_package. 288 | IF sy-subrc = 0. 289 | DATA(lv_len) = strlen( co_prefix ). 290 | lv_counter = lv_obj_name+lv_len(*). 291 | ENDIF. 292 | 293 | lv_counter = lv_counter + 1. 294 | 295 | " Format: ZABAPGIT_CI_nnnnnnnnnn 296 | rv_objid = co_prefix && lv_counter. 297 | 298 | ENDMETHOD. 299 | 300 | 301 | METHOD is_active. 302 | 303 | DATA lv_ci_log TYPE c LENGTH 100. 304 | 305 | rv_logging = abap_false. 306 | 307 | GET PARAMETER ID 'ZABAPGIT_CI_LOG' FIELD lv_ci_log. 308 | 309 | IF lv_ci_log IS INITIAL OR lv_ci_log CS iv_log_type. 310 | rv_logging = abap_true. 311 | ENDIF. 312 | 313 | ENDMETHOD. 314 | 315 | 316 | METHOD set_params. 317 | 318 | DATA ls_param LIKE LINE OF rt_params. 319 | 320 | ls_param-relid = is_key-relid. 321 | ls_param-objid = is_key-objid. 322 | ls_param-name = co_param_names-version. 323 | ls_param-value = '00001'. 324 | INSERT ls_param INTO TABLE rt_params. 325 | ls_param-name = co_param_names-filename. 326 | ls_param-value = iv_name. 327 | INSERT ls_param INTO TABLE rt_params. 328 | ls_param-name = co_param_names-fileext. 329 | ls_param-value = '.json'. 330 | INSERT ls_param INTO TABLE rt_params. 331 | ls_param-name = co_param_names-filesize. 332 | ls_param-value = iv_size. 333 | ls_param-value = condense( ls_param-value ). 334 | INSERT ls_param INTO TABLE rt_params. 335 | ls_param-name = co_param_names-mimetype. 336 | ls_param-value = 'application/json'. 337 | INSERT ls_param INTO TABLE rt_params. 338 | 339 | ENDMETHOD. 340 | 341 | 342 | METHOD stringify. 343 | 344 | DATA li_json TYPE REF TO zif_abapgit_ajson. 345 | 346 | TRY. 347 | li_json = zcl_abapgit_ajson=>create_empty( ). 348 | li_json->keep_item_order( ). 349 | li_json->set( 350 | iv_path = '/' 351 | iv_val = ig_data ). 352 | rv_string = li_json->stringify( 2 ). 353 | CATCH zcx_abapgit_ajson_error INTO DATA(lx_error). 354 | zcx_abapgit_exception=>raise( 'Error converting data to JSON:' && lx_error->get_text( ) ). 355 | ENDTRY. 356 | 357 | ENDMETHOD. 358 | ENDCLASS. 359 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_log.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_LOG 7 | E 8 | abapGit CI: Log 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_repo.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_REPO 7 | E 8 | abapGit CI: Repo processing logic 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_repo_category.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | CLASS ltcl_tests DEFINITION FOR TESTING RISK LEVEL HARMLESS 2 | DURATION SHORT FINAL. 3 | 4 | PRIVATE SECTION. 5 | DATA mo_cut TYPE REF TO zcl_abapgit_ci_repo_category. 6 | 7 | METHODS: 8 | setup, 9 | test_categories FOR TESTING, 10 | test_category FOR TESTING, 11 | test_objects FOR TESTING, 12 | test_others FOR TESTING, 13 | test_aff FOR TESTING, 14 | test_bw FOR TESTING. 15 | 16 | ENDCLASS. 17 | 18 | CLASS ltcl_tests IMPLEMENTATION. 19 | 20 | METHOD setup. 21 | CREATE OBJECT mo_cut. 22 | ENDMETHOD. 23 | 24 | METHOD test_categories. 25 | 26 | DATA(lv_bool) = xsdbool( lines( mo_cut->get_categories( ) ) > 20 ). 27 | 28 | cl_abap_unit_assert=>assert_equals( 29 | act = lv_bool 30 | exp = abap_true ). 31 | 32 | ENDMETHOD. 33 | 34 | METHOD test_category. 35 | 36 | cl_abap_unit_assert=>assert_equals( 37 | act = mo_cut->get_category_label( 'dictionary' ) 38 | exp = 'Dictionary' ). 39 | 40 | cl_abap_unit_assert=>assert_equals( 41 | act = mo_cut->get_category_label( 'customizing' ) 42 | exp = 'Customizing' ). 43 | 44 | cl_abap_unit_assert=>assert_equals( 45 | act = mo_cut->get_category_label( 'other' ) 46 | exp = 'Others' ). 47 | 48 | ENDMETHOD. 49 | 50 | METHOD test_objects. 51 | 52 | cl_abap_unit_assert=>assert_equals( 53 | act = mo_cut->get_repo_category( 'PROG' ) 54 | exp = 'source_library' ). 55 | 56 | cl_abap_unit_assert=>assert_equals( 57 | act = mo_cut->get_repo_category( 'CLAS_with_ENHO' ) 58 | exp = 'source_library' ). 59 | 60 | cl_abap_unit_assert=>assert_equals( 61 | act = mo_cut->get_repo_category( 'TABL' ) 62 | exp = 'dictionary' ). 63 | 64 | cl_abap_unit_assert=>assert_equals( 65 | act = mo_cut->get_repo_category( 'TTYP_with_CLAS_ref' ) 66 | exp = 'dictionary' ). 67 | 68 | cl_abap_unit_assert=>assert_equals( 69 | act = mo_cut->get_repo_category( 'DDIC_ref' ) 70 | exp = 'dictionary' ). 71 | 72 | ENDMETHOD. 73 | 74 | METHOD test_others. 75 | 76 | cl_abap_unit_assert=>assert_equals( 77 | act = mo_cut->get_repo_category( 'SICF' ) 78 | exp = 'other' ). 79 | 80 | ENDMETHOD. 81 | 82 | METHOD test_aff. 83 | 84 | cl_abap_unit_assert=>assert_equals( 85 | act = mo_cut->get_repo_category( 'CHKC' ) 86 | exp = 'aff' ). 87 | 88 | ENDMETHOD. 89 | 90 | METHOD test_bw. 91 | 92 | cl_abap_unit_assert=>assert_equals( 93 | act = mo_cut->get_repo_category( 'IOBJ' ) 94 | exp = 'bw' ). 95 | 96 | ENDMETHOD. 97 | 98 | ENDCLASS. 99 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_repo_category.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_REPO_CATEGORY 7 | E 8 | abapGit CI: Repo category 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_repo_check.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_repo_check DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | CLASS-METHODS get 9 | IMPORTING 10 | !io_repo TYPE REF TO zcl_abapgit_repo_online 11 | RETURNING 12 | VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_deserialize_checks 13 | RAISING 14 | zcx_abapgit_cancel 15 | zcx_abapgit_exception . 16 | PROTECTED SECTION. 17 | PRIVATE SECTION. 18 | ENDCLASS. 19 | 20 | 21 | 22 | CLASS zcl_abapgit_ci_repo_check IMPLEMENTATION. 23 | 24 | 25 | METHOD get. 26 | 27 | rs_checks = io_repo->deserialize_checks( ). 28 | 29 | " Auto-confirm all decisions 30 | LOOP AT rs_checks-overwrite ASSIGNING FIELD-SYMBOL(). 31 | -decision = zif_abapgit_definitions=>c_yes. 32 | ENDLOOP. 33 | 34 | LOOP AT rs_checks-warning_package ASSIGNING FIELD-SYMBOL(). 35 | -decision = zif_abapgit_definitions=>c_yes. 36 | ENDLOOP. 37 | 38 | " If requirements are not met, cancel process 39 | IF rs_checks-requirements-met <> zif_abapgit_definitions=>c_yes. 40 | zcx_abapgit_cancel=>raise( 'Requirements not met' ). 41 | ENDIF. 42 | 43 | " If dependencies are not met, cancel process 44 | IF rs_checks-dependencies-met <> zif_abapgit_definitions=>c_yes. 45 | zcx_abapgit_cancel=>raise( 'Dependencies not met' ). 46 | ENDIF. 47 | 48 | ENDMETHOD. 49 | ENDCLASS. 50 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_repo_check.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_REPO_CHECK 7 | E 8 | abapGit CI: Repo check logic 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_repos.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_REPOS 7 | E 8 | abapGit CI: CI for abapGit test repos 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_resource.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_resource DEFINITION 2 | PUBLIC 3 | INHERITING FROM cl_rest_resource 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS if_rest_resource~post 9 | REDEFINITION . 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_abapgit_ci_resource IMPLEMENTATION. 17 | 18 | 19 | METHOD if_rest_resource~post. 20 | 21 | DATA(lo_entity) = mo_response->create_entity( ). 22 | DATA(lo_receiver) = NEW lcl_data_receiver( ). 23 | 24 | TRY. 25 | NEW zcl_abapgit_ci_controller( 26 | ii_view = lo_receiver 27 | ii_repo_provider = NEW zcl_abapgit_ci_test_repos( ) 28 | )->run( ). 29 | 30 | CATCH zcx_abapgit_exception INTO DATA(lx_error). 31 | lo_entity->set_string_data( lx_error->get_text( ) ). 32 | mo_response->set_status( cl_rest_status_code=>gc_server_error_internal ). 33 | RETURN. 34 | ENDTRY. 35 | 36 | lo_entity->set_string_data( /ui2/cl_json=>serialize( lo_receiver->ms_result ) ). 37 | mo_response->set_status( cl_rest_status_code=>gc_success_ok ). 38 | 39 | ENDMETHOD. 40 | ENDCLASS. 41 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_resource.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | *"* use this source file for any type of declarations (class 2 | *"* definitions, interfaces or type declarations) you need for 3 | *"* components in the private section 4 | 5 | CLASS lcl_data_receiver DEFINITION. 6 | 7 | PUBLIC SECTION. 8 | INTERFACES: 9 | zif_abapgit_ci_view. 10 | 11 | DATA: 12 | ms_result TYPE zif_abapgit_ci_definitions=>ty_result READ-ONLY. 13 | 14 | ENDCLASS. 15 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_resource.clas.locals_imp.abap: -------------------------------------------------------------------------------- 1 | *"* use this source file for the definition and implementation of 2 | *"* local helper classes, interface definitions and type 3 | *"* declarations 4 | 5 | CLASS lcl_data_receiver IMPLEMENTATION. 6 | 7 | METHOD zif_abapgit_ci_view~display. 8 | 9 | ms_result = cs_result. 10 | 11 | ENDMETHOD. 12 | 13 | ENDCLASS. 14 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_resource.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_RESOURCE 7 | E 8 | abapGit CI: REST resource 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_rest.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_rest DEFINITION 2 | PUBLIC 3 | INHERITING FROM cl_rest_http_handler 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS if_rest_application~get_root_handler 9 | REDEFINITION . 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_abapgit_ci_rest IMPLEMENTATION. 17 | 18 | 19 | METHOD if_rest_application~get_root_handler. 20 | 21 | DATA(lo_handler) = NEW cl_rest_router( ). 22 | 23 | lo_handler->attach( iv_template = '/run' 24 | iv_handler_class = |ZCL_ABAPGIT_CI_RESOURCE| ). 25 | 26 | ro_root_handler = lo_handler. 27 | 28 | ENDMETHOD. 29 | ENDCLASS. 30 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_rest.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_REST 7 | E 8 | abapGit CI: REST handler 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_run_abapgit_ut.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_run_abapgit_ut DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC. 4 | 5 | PUBLIC SECTION. 6 | INTERFACES: 7 | zif_abapgit_ci_test. 8 | 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS zcl_abapgit_ci_run_abapgit_ut IMPLEMENTATION. 16 | 17 | 18 | METHOD zif_abapgit_ci_test~execute. 19 | 20 | DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online. 21 | 22 | DATA(lt_repo_list) = zcl_abapgit_repo_srv=>get_instance( )->list( ). 23 | 24 | LOOP AT lt_repo_list ASSIGNING FIELD-SYMBOL(). 25 | 26 | IF ->get_name( ) = 'abapGit'. 27 | lo_repo ?= . 28 | EXIT. 29 | ENDIF. 30 | 31 | ENDLOOP. 32 | 33 | IF lo_repo IS NOT BOUND. 34 | zcx_abapgit_exception=>raise( |Couldn't find abapGit repo| ). 35 | ENDIF. 36 | 37 | rt_list = zcl_abapgit_code_inspector=>get_code_inspector( lo_repo->get_package( ) )->run( 'SWF_ABAP_UNIT' ). 38 | 39 | ENDMETHOD. 40 | 41 | 42 | METHOD zif_abapgit_ci_test~get_description. 43 | 44 | rv_description = |Run abapGit unit tests|. 45 | 46 | ENDMETHOD. 47 | ENDCLASS. 48 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_run_abapgit_ut.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_RUN_ABAPGIT_UT 7 | E 8 | abapGit CI: Run abapGit unit tests 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_skip.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_SKIP 7 | E 8 | abapGit CI: Skip logic 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_slack.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_slack DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | 7 | METHODS constructor 8 | IMPORTING 9 | !iv_token TYPE string 10 | RAISING 11 | zcx_abapgit_exception . 12 | 13 | METHODS post 14 | IMPORTING 15 | !iv_message TYPE string 16 | RAISING 17 | zcx_abapgit_exception . 18 | 19 | PROTECTED SECTION. 20 | PRIVATE SECTION. 21 | DATA: 22 | mv_token TYPE string. 23 | 24 | ENDCLASS. 25 | 26 | 27 | 28 | CLASS zcl_abapgit_ci_slack IMPLEMENTATION. 29 | 30 | 31 | METHOD constructor. 32 | 33 | IF iv_token IS INITIAL. 34 | zcx_abapgit_exception=>raise( |Please supply OAuth token| ). 35 | ENDIF. 36 | 37 | mv_token = iv_token. 38 | 39 | ENDMETHOD. 40 | 41 | 42 | METHOD post. 43 | 44 | TYPES: 45 | BEGIN OF ty_request, 46 | channel TYPE string, 47 | text TYPE string, 48 | END OF ty_request. 49 | 50 | DATA: li_http_client TYPE REF TO if_http_client, 51 | ls_request TYPE ty_request. 52 | 53 | cl_http_client=>create_by_url( 54 | EXPORTING 55 | url = 'https://slack.com' 56 | ssl_id = 'ANONYM' 57 | IMPORTING 58 | client = li_http_client 59 | EXCEPTIONS 60 | argument_not_found = 1 61 | plugin_not_active = 2 62 | internal_error = 3 63 | OTHERS = 4 ). 64 | 65 | IF sy-subrc <> 0. 66 | zcx_abapgit_exception=>raise_t100( ). 67 | ENDIF. 68 | 69 | TRY. 70 | DATA(lo_rest_client) = NEW cl_rest_http_client( li_http_client ). 71 | 72 | DATA(lo_entity) = lo_rest_client->if_rest_client~create_request_entity( ). 73 | 74 | lo_entity->set_header_field( 75 | iv_name = '~request_uri' 76 | iv_value = '/api/chat.postMessage' ). 77 | 78 | lo_entity->set_header_field( 79 | iv_name = 'Content-Type' 80 | iv_value = 'application/json' ). 81 | 82 | lo_entity->set_header_field( 83 | iv_name = 'Authorization' 84 | iv_value = |Bearer { mv_token }| ). 85 | 86 | ls_request-channel = |CDV0211MW|. 87 | ls_request-text = iv_message. 88 | 89 | lo_entity->set_string_data( /ui2/cl_json=>serialize( data = ls_request 90 | pretty_name = /ui2/cl_json=>pretty_mode-low_case ) ). 91 | 92 | lo_rest_client->if_rest_client~post( lo_entity ). 93 | 94 | " For debugging 95 | DATA(lo_response) = lo_rest_client->if_rest_client~get_response_entity( ) ##NEEDED. 96 | 97 | DATA(lv_status) = lo_rest_client->if_rest_client~get_status( ). 98 | 99 | CATCH cx_rest_client_exception INTO DATA(lx_rest_error). 100 | zcx_abapgit_exception=>raise( iv_text = lx_rest_error->get_text( ) 101 | ix_previous = lx_rest_error ). 102 | ENDTRY. 103 | 104 | IF lv_status <> cl_rest_status_code=>gc_success_ok. 105 | zcx_abapgit_exception=>raise( |HTTP status code { lv_status } from slack.com| ). 106 | ENDIF. 107 | 108 | ENDMETHOD. 109 | ENDCLASS. 110 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_slack.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_SLACK 7 | E 8 | abapGit CI: Slack integration 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_test_repos.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_abapgit_ci_test_repos DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC . 4 | 5 | PUBLIC SECTION. 6 | 7 | INTERFACES zif_abapgit_ci_repo_provider . 8 | 9 | TYPES: 10 | gty_repo_name_range TYPE RANGE OF zif_abapgit_ci_definitions=>ty_repo-name . 11 | 12 | METHODS constructor 13 | IMPORTING 14 | !it_repo_name_range TYPE gty_repo_name_range OPTIONAL . 15 | PROTECTED SECTION. 16 | PRIVATE SECTION. 17 | METHODS: 18 | fetch_repo_page 19 | IMPORTING 20 | iv_page_count TYPE i 21 | RETURNING 22 | VALUE(rt_repos) TYPE zif_abapgit_ci_definitions=>tty_repo 23 | RAISING 24 | zcx_abapgit_exception. 25 | 26 | DATA: 27 | mt_repo_name_range TYPE gty_repo_name_range. 28 | ENDCLASS. 29 | 30 | 31 | 32 | CLASS zcl_abapgit_ci_test_repos IMPLEMENTATION. 33 | 34 | 35 | METHOD constructor. 36 | mt_repo_name_range = it_repo_name_range. 37 | ENDMETHOD. 38 | 39 | 40 | METHOD fetch_repo_page. 41 | 42 | DATA li_http_client TYPE REF TO if_http_client. 43 | 44 | li_http_client = NEW zcl_abapgit_ci_github_conn( )->create_http_client( ). 45 | 46 | DATA(lo_rest_client) = NEW cl_rest_http_client( li_http_client ). 47 | 48 | lo_rest_client->if_rest_client~create_request_entity( )->set_header_field( 49 | iv_name = '~request_uri' 50 | iv_value = |/orgs/abapGit-tests/repos?page={ iv_page_count }| ). 51 | 52 | lo_rest_client->if_rest_client~get( ). 53 | 54 | DATA(lo_response) = lo_rest_client->if_rest_client~get_response_entity( ). 55 | 56 | DATA(lv_status) = lo_rest_client->if_rest_client~get_status( ). 57 | 58 | IF lv_status <> cl_rest_status_code=>gc_success_ok. 59 | zcx_abapgit_exception=>raise( |HTTP status code { lv_status } from api.github.com| ). 60 | ENDIF. 61 | 62 | /ui2/cl_json=>deserialize( 63 | EXPORTING 64 | json = lo_response->get_string_data( ) 65 | CHANGING 66 | data = rt_repos ). 67 | 68 | ENDMETHOD. 69 | 70 | 71 | METHOD zif_abapgit_ci_repo_provider~get_repos. 72 | 73 | DATA lt_repos TYPE zif_abapgit_ci_definitions=>tty_repo. 74 | 75 | DO. 76 | 77 | TRY. 78 | lt_repos = fetch_repo_page( sy-index ). 79 | 80 | CATCH zcx_abapgit_exception cx_rest_client_exception INTO DATA(lx_error). 81 | zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( ) 82 | ix_previous = lx_error ). 83 | ENDTRY. 84 | 85 | IF lines( lt_repos ) = 0. 86 | EXIT. 87 | ENDIF. 88 | 89 | INSERT LINES OF lt_repos INTO TABLE rt_repos. 90 | 91 | ENDDO. 92 | 93 | " Remove some special repos 94 | DELETE rt_repos WHERE name = 'chkc_namespace_ag' OR name = 'data_test' OR name = 'Template'. 95 | 96 | " Remove extension 97 | LOOP AT rt_repos ASSIGNING FIELD-SYMBOL(). 98 | -clone_url = replace( 99 | val = -clone_url 100 | sub = '.git' 101 | with = '' 102 | occ = -1 ). 103 | ENDLOOP. 104 | 105 | " Excluded for test purposes, no need for skip reason 106 | DELETE rt_repos WHERE name NOT IN mt_repo_name_range. 107 | 108 | SORT rt_repos BY name. 109 | 110 | ENDMETHOD. 111 | ENDCLASS. 112 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_test_repos.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | *"* use this source file for your ABAP unit test classes 2 | CLASS ltcl_repos DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. 3 | 4 | PUBLIC SECTION. 5 | METHODS: 6 | check_repos_filled FOR TESTING RAISING cx_static_check. 7 | 8 | PRIVATE SECTION. 9 | DATA mo_cut TYPE REF TO zcl_abapgit_ci_test_repos. 10 | 11 | METHODS: 12 | setup. 13 | ENDCLASS. 14 | 15 | 16 | CLASS ltcl_repos IMPLEMENTATION. 17 | 18 | METHOD setup. 19 | mo_cut = NEW zcl_abapgit_ci_test_repos( ). 20 | ENDMETHOD. 21 | 22 | METHOD check_repos_filled. 23 | DATA(lt_repos) = mo_cut->zif_abapgit_ci_repo_provider~get_repos( ). 24 | cl_aunit_assert=>assert_not_initial( lt_repos ). 25 | ENDMETHOD. 26 | 27 | ENDCLASS. 28 | -------------------------------------------------------------------------------- /src/zcl_abapgit_ci_test_repos.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ABAPGIT_CI_TEST_REPOS 7 | E 8 | abapGit CI: Test repos 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_definitions.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_abapgit_ci_definitions 2 | PUBLIC . 3 | 4 | 5 | TYPES: 6 | BEGIN OF ty_repo, 7 | name TYPE string, 8 | clone_url TYPE string, 9 | END OF ty_repo . 10 | TYPES: 11 | tty_repo TYPE STANDARD TABLE OF ty_repo 12 | WITH NON-UNIQUE DEFAULT KEY . 13 | TYPES: 14 | tty_repo_result_list TYPE STANDARD TABLE OF zabapgit_ci_result 15 | WITH NON-UNIQUE DEFAULT KEY . 16 | TYPES: 17 | tty_generic_result_list TYPE STANDARD TABLE OF zabapgit_ci_result_gen 18 | WITH NON-UNIQUE DEFAULT KEY . 19 | TYPES: 20 | tty_category_list TYPE STANDARD TABLE OF string WITH DEFAULT KEY. 21 | TYPES: 22 | BEGIN OF ty_result, 23 | ci_has_errors TYPE abap_bool, 24 | BEGIN OF statistics, 25 | finish_timestamp TYPE timestampl, 26 | duration_in_seconds TYPE i, 27 | BEGIN OF test_cases, 28 | total TYPE i, 29 | successful TYPE i, 30 | skipped TYPE i, 31 | failed TYPE i, 32 | END OF test_cases, 33 | END OF statistics, 34 | repo_result_list TYPE tty_repo_result_list, 35 | category_list TYPE tty_category_list, 36 | generic_result_list TYPE tty_generic_result_list, 37 | END OF ty_result . 38 | TYPES: 39 | BEGIN OF ty_repo_check_options, 40 | check_local TYPE abap_bool, 41 | check_transportable TYPE abap_bool, 42 | layer TYPE devlayer, 43 | create_package TYPE abap_bool, 44 | no_purge TYPE abap_bool, 45 | logging TYPE abap_bool, 46 | ignore_skipping TYPE abap_bool, 47 | categories TYPE RANGE OF string, 48 | END OF ty_repo_check_options . 49 | TYPES: 50 | BEGIN OF ty_options, 51 | result_git_repo_url TYPE string, 52 | save_to_history TYPE abap_bool, 53 | save_without_push TYPE abap_bool, 54 | post_errors_to_slack TYPE abap_bool, 55 | slack_oauth_token TYPE string, 56 | exec_generic_checks TYPE abap_bool, 57 | exec_repository_checks TYPE abap_bool, 58 | repo_check_options TYPE ty_repo_check_options, 59 | sync_processing TYPE abap_bool, 60 | logging TYPE abap_bool, 61 | END OF ty_options . 62 | 63 | CONSTANTS co_title TYPE string VALUE 'abapGit CI Results' ##NO_TEXT. 64 | CONSTANTS co_title_generic TYPE string VALUE 'abapGit CI - Generic Tests' ##NO_TEXT. 65 | CONSTANTS co_title_repos TYPE string VALUE 'abapGit CI - Repository Tests' ##NO_TEXT. 66 | 67 | CONSTANTS: 68 | BEGIN OF co_status, 69 | undefined TYPE char6 VALUE ' ', 70 | skipped TYPE char6 VALUE 'X', 71 | ok TYPE char6 VALUE 'OK', 72 | not_ok TYPE char6 VALUE 'NOT_OK', 73 | END OF co_status . 74 | ENDINTERFACE. 75 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_definitions.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ABAPGIT_CI_DEFINITIONS 7 | E 8 | abapGit CI: Definitions 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_repo_provider.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_abapgit_ci_repo_provider 2 | PUBLIC . 3 | 4 | 5 | METHODS get_repos 6 | RETURNING 7 | VALUE(rt_repos) TYPE zif_abapgit_ci_definitions=>tty_repo 8 | RAISING 9 | zcx_abapgit_exception . 10 | ENDINTERFACE. 11 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_repo_provider.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ABAPGIT_CI_REPO_PROVIDER 7 | E 8 | abapGit CI: Repo provider 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_test.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_abapgit_ci_test 2 | PUBLIC . 3 | 4 | 5 | METHODS get_description 6 | RETURNING 7 | VALUE(rv_description) TYPE zabapgit_ci_description . 8 | METHODS execute 9 | RETURNING 10 | VALUE(rt_list) TYPE zif_abapgit_code_inspector=>ty_results 11 | RAISING 12 | zcx_abapgit_exception . 13 | ENDINTERFACE. 14 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_test.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ABAPGIT_CI_TEST 7 | E 8 | abapGit CI: CI test case 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_view.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_abapgit_ci_view 2 | PUBLIC . 3 | 4 | 5 | METHODS display 6 | CHANGING 7 | !cs_result TYPE zif_abapgit_ci_definitions=>ty_result 8 | RAISING 9 | zcx_abapgit_exception . 10 | ENDINTERFACE. 11 | -------------------------------------------------------------------------------- /src/zif_abapgit_ci_view.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ABAPGIT_CI_VIEW 7 | E 8 | abapGit CI: CI view 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | --------------------------------------------------------------------------------