Skip to content

Commit

Permalink
update (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp authored Dec 2, 2023
1 parent 087fd65 commit 762f4d2
Show file tree
Hide file tree
Showing 70 changed files with 493 additions and 638 deletions.
14 changes: 10 additions & 4 deletions cloud/zcl_abapgit_abap_language_vers.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ CLASS zcl_abapgit_abap_language_vers DEFINITION

PUBLIC SECTION.

CONSTANTS c_any_abap_language_version TYPE zif_abapgit_aff_types_v1=>ty_abap_language_version VALUE '*'.
CONSTANTS c_feature_flag TYPE string VALUE 'ALAV'.
CONSTANTS:
c_any_abap_language_version TYPE zif_abapgit_aff_types_v1=>ty_abap_language_version VALUE '*',
c_no_abap_language_version TYPE zif_abapgit_aff_types_v1=>ty_abap_language_version VALUE '-',
c_feature_flag TYPE string VALUE 'ALAV'.

METHODS constructor
IMPORTING
Expand Down Expand Up @@ -66,7 +68,8 @@ CLASS zcl_abapgit_abap_language_vers IMPLEMENTATION.

IF zcl_abapgit_feature=>is_enabled( c_feature_flag ) = abap_false.
mv_has_abap_language_vers = abap_false.
ELSEIF get_abap_language_vers_by_repo( ) = zif_abapgit_dot_abapgit=>c_abap_language_version-undefined.
ELSEIF get_abap_language_vers_by_repo( ) = zif_abapgit_dot_abapgit=>c_abap_language_version-undefined
OR get_abap_language_vers_by_repo( ) = zif_abapgit_dot_abapgit=>c_abap_language_version-ignore.
mv_has_abap_language_vers = abap_false.
ELSE.
mv_has_abap_language_vers = abap_true.
Expand Down Expand Up @@ -191,6 +194,8 @@ CLASS zcl_abapgit_abap_language_vers IMPLEMENTATION.
rv_abap_language_version = zif_abapgit_aff_types_v1=>co_abap_language_version_src-key_user.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-cloud_development.
rv_abap_language_version = zif_abapgit_aff_types_v1=>co_abap_language_version_src-cloud_development.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-ignore.
rv_abap_language_version = c_no_abap_language_version.
WHEN OTHERS. " undefined or feature off
rv_abap_language_version = c_any_abap_language_version.
ENDCASE.
Expand All @@ -205,7 +210,8 @@ CLASS zcl_abapgit_abap_language_vers IMPLEMENTATION.
lv_package_version = get_abap_language_vers_by_devc( iv_package ).

CASE get_abap_language_vers_by_repo( ).
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined
OR zif_abapgit_dot_abapgit=>c_abap_language_version-ignore.
rv_allowed = abap_true.
WHEN OTHERS.
IF get_abap_language_vers_by_repo( ) = lv_package_version.
Expand Down
10 changes: 7 additions & 3 deletions cloud/zcl_abapgit_abap_language_vers.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ CLASS ltcl_abap_language_version IMPLEMENTATION.
zcl_abapgit_persist_injector=>set_settings( mi_persistency ).

APPEND zif_abapgit_dot_abapgit=>c_abap_language_version-undefined TO mt_versions.
APPEND zif_abapgit_dot_abapgit=>c_abap_language_version-ignore TO mt_versions.
APPEND zif_abapgit_dot_abapgit=>c_abap_language_version-standard TO mt_versions.
APPEND zif_abapgit_dot_abapgit=>c_abap_language_version-key_user TO mt_versions.
APPEND zif_abapgit_dot_abapgit=>c_abap_language_version-cloud_development TO mt_versions.
Expand Down Expand Up @@ -207,7 +208,8 @@ CLASS ltcl_abap_language_version IMPLEMENTATION.
LOOP AT mt_versions INTO lv_version.

CASE lv_version.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined
OR zif_abapgit_dot_abapgit=>c_abap_language_version-ignore.

repo_setting_test(
iv_version = lv_version
Expand Down Expand Up @@ -315,7 +317,8 @@ CLASS ltcl_abap_language_version IMPLEMENTATION.
LOOP AT mt_versions INTO lv_version.

CASE lv_version.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined
OR zif_abapgit_dot_abapgit=>c_abap_language_version-ignore.

object_type_test(
iv_version = lv_version
Expand Down Expand Up @@ -387,7 +390,8 @@ CLASS ltcl_abap_language_version IMPLEMENTATION.
LOOP AT mt_versions INTO lv_version.

CASE lv_version.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined.
WHEN zif_abapgit_dot_abapgit=>c_abap_language_version-undefined
OR zif_abapgit_dot_abapgit=>c_abap_language_version-ignore.

is_import_allowed_test(
iv_version = lv_version
Expand Down
185 changes: 8 additions & 177 deletions cloud/zcl_abapgit_default_transport.clas.abap
Original file line number Diff line number Diff line change
@@ -1,196 +1,27 @@
CLASS zcl_abapgit_default_transport DEFINITION
PUBLIC
CREATE PRIVATE .
CREATE PUBLIC .

PUBLIC SECTION.
TYPES: BEGIN OF e070use,
username TYPE c LENGTH 12,
trfunction TYPE c LENGTH 1,
category TYPE c LENGTH 4,
client TYPE c LENGTH 3,
fixtype TYPE c LENGTH 1,
ordernum TYPE c LENGTH 20,
tasknum TYPE c LENGTH 20,
validity TYPE d,
END OF e070use. CLASS-METHODS:
get_instance
RETURNING
VALUE(ro_instance) TYPE REF TO zcl_abapgit_default_transport
RAISING
zcx_abapgit_exception.

METHODS:
constructor
RAISING
zcx_abapgit_exception,

set
IMPORTING
iv_transport TYPE sxco_transport
RAISING
zcx_abapgit_exception,

reset
RAISING
zcx_abapgit_exception,
get
RETURNING
VALUE(rs_default_task) TYPE e070use
RAISING
zcx_abapgit_exception .

INTERFACES zif_abapgit_default_transport.

PROTECTED SECTION.
PRIVATE SECTION.

CLASS-DATA go_instance TYPE REF TO zcl_abapgit_default_transport .
DATA mv_is_set_by_abapgit TYPE abap_bool .
DATA ms_save TYPE e070use .

METHODS store
RAISING
zcx_abapgit_exception .
METHODS restore
RAISING
zcx_abapgit_exception .
METHODS set_internal
IMPORTING
!iv_transport TYPE sxco_transport
RAISING
zcx_abapgit_exception .
METHODS clear
IMPORTING
!is_default_task TYPE e070use
RAISING
zcx_abapgit_exception .
ENDCLASS.



CLASS zcl_abapgit_default_transport IMPLEMENTATION.


METHOD clear.

ASSERT 1 = 'replacedByRefactorMJS'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.

METHOD zif_abapgit_default_transport~get.
RETURN.
ENDMETHOD.


METHOD constructor.

store( ).

METHOD zif_abapgit_default_transport~reset.
RETURN.
ENDMETHOD.


METHOD get.

DATA: lt_e070use TYPE STANDARD TABLE OF e070use.

ASSERT 1 = 'replacedByRefactorMJS'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.

READ TABLE lt_e070use INTO rs_default_task
INDEX 1.

ENDMETHOD.


METHOD get_instance.

IF go_instance IS NOT BOUND.
CREATE OBJECT go_instance.
ENDIF.

ro_instance = go_instance.

ENDMETHOD.


METHOD reset.

DATA: ls_default_task TYPE e070use.

IF mv_is_set_by_abapgit = abap_false.
" if the default transport request task isn't set
" by us there is nothing to do.
RETURN.
ENDIF.

CLEAR mv_is_set_by_abapgit.

ls_default_task = get( ).

IF ls_default_task IS NOT INITIAL.

clear( ls_default_task ).

ENDIF.

restore( ).

ENDMETHOD.


METHOD restore.

IF ms_save IS INITIAL.
" There wasn't a default transport request before
" so we needn't restore anything.
RETURN.
ENDIF.

ASSERT 1 = 'replacedByRefactorMJS'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.

ENDMETHOD.


METHOD set.

" checks whether object changes of the package are rerorded in transport
" requests. If true then we set the default task, so that no annoying
" transport request popups are shown while deserializing.

IF mv_is_set_by_abapgit = abap_true.
" the default transport request task is already set by us
" -> no reason to do it again.
RETURN.
ENDIF.

IF iv_transport IS INITIAL.
zcx_abapgit_exception=>raise( |No transport request was supplied| ).
ENDIF.

set_internal( iv_transport ).

mv_is_set_by_abapgit = abap_true.

ENDMETHOD.


METHOD set_internal.

ASSERT 1 = 'replacedByRefactorMJS'.

IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.

ENDMETHOD.


METHOD store.

ms_save = get( ).

METHOD zif_abapgit_default_transport~set.
RETURN.
ENDMETHOD.
ENDCLASS.
1 change: 1 addition & 0 deletions cloud/zcl_abapgit_exit.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.

ENDMETHOD.


METHOD is_running_in_test_context.

IF sy-sysid = 'ABC'.
Expand Down
19 changes: 18 additions & 1 deletion cloud/zcl_abapgit_factory.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ CLASS zcl_abapgit_factory DEFINITION
CLASS-METHODS get_cts_api
RETURNING
VALUE(ri_cts_api) TYPE REF TO zif_abapgit_cts_api .
CLASS-METHODS get_default_transport
RETURNING
VALUE(ri_default_transport) TYPE REF TO zif_abapgit_default_transport
RAISING
zcx_abapgit_exception.
CLASS-METHODS get_environment
RETURNING
VALUE(ri_environment) TYPE REF TO zif_abapgit_environment .
Expand Down Expand Up @@ -79,11 +84,12 @@ CLASS zcl_abapgit_factory DEFINITION
CLASS-DATA gi_sap_namespace TYPE REF TO zif_abapgit_sap_namespace .
CLASS-DATA gi_sap_report TYPE REF TO zif_abapgit_sap_report.
CLASS-DATA gi_function_module TYPE REF TO zif_abapgit_function_module.
CLASS-DATA gi_default_transport TYPE REF TO zif_abapgit_default_transport .
ENDCLASS.



CLASS zcl_abapgit_factory IMPLEMENTATION.
CLASS ZCL_ABAPGIT_FACTORY IMPLEMENTATION.


METHOD get_code_inspector.
Expand Down Expand Up @@ -120,6 +126,17 @@ CLASS zcl_abapgit_factory IMPLEMENTATION.
ENDMETHOD.


METHOD get_default_transport.

IF gi_default_transport IS NOT BOUND.
CREATE OBJECT gi_default_transport TYPE zcl_abapgit_default_transport.
ENDIF.

ri_default_transport = gi_default_transport.

ENDMETHOD.


METHOD get_environment.
IF gi_environment IS NOT BOUND.
CREATE OBJECT gi_environment TYPE zcl_abapgit_environment.
Expand Down
6 changes: 5 additions & 1 deletion cloud/zcl_abapgit_filename_logic.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ CLASS zcl_abapgit_filename_logic IMPLEMENTATION.
iv_package = iv_package
CHANGING
cs_item = cs_item.
CATCH cx_sy_dyn_call_illegal_class ##NO_HANDLER.
CATCH cx_sy_dyn_call_illegal_class.
" Map data config to TABU object type
IF cs_item-obj_type = 'CONF'.
cs_item-obj_type = 'TABU'.
ENDIF.
ENDTRY.

ENDMETHOD.
Expand Down
6 changes: 1 addition & 5 deletions cloud/zcl_abapgit_folder_logic.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ CLASS zcl_abapgit_folder_logic DEFINITION
CREATE PUBLIC .

PUBLIC SECTION.
TYPES: BEGIN OF scompkdtln,
devclass TYPE c LENGTH 30,
ctext TYPE c LENGTH 60,
as4user TYPE c LENGTH 8,
END OF scompkdtln.

METHODS package_to_path
IMPORTING
!iv_top TYPE I_CustABAPObjDirectoryEntry-ABAPPackage
Expand Down
5 changes: 4 additions & 1 deletion cloud/zcl_abapgit_function_module.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ CLASS zcl_abapgit_function_module DEFINITION
INTERFACES:
zif_abapgit_function_module.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.



CLASS zcl_abapgit_function_module IMPLEMENTATION.


METHOD zif_abapgit_function_module~function_exists.

DATA: lv_function_module_name TYPE c LENGTH 30.
Expand All @@ -22,5 +26,4 @@ CLASS zcl_abapgit_function_module IMPLEMENTATION.
rv_exists = boolc( sy-subrc = 0 ).

ENDMETHOD.

ENDCLASS.
1 change: 1 addition & 0 deletions cloud/zcl_abapgit_git_time.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ CLASS zcl_abapgit_git_time IMPLEMENTATION.
rv_time = rv_time - 31536000.
ENDMETHOD.


METHOD get_unix.
* returns seconds since unix epoch, including timezone indicator

Expand Down
Loading

0 comments on commit 762f4d2

Please sign in to comment.