Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-wide: add support for ABAP DDIC Data Element CRUD #120

Closed
wants to merge 3 commits into from
Closed

tree-wide: add support for ABAP DDIC Data Element CRUD #120

wants to merge 3 commits into from

Conversation

buca92
Copy link
Collaborator

@buca92 buca92 commented Sep 18, 2023

No description provided.

@buca92 buca92 requested a review from jfilak September 18, 2023 03:39
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03% 🎉

Comparison is base (9c033e2) 98.25% compared to head (7ca8567) 98.29%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #120      +/-   ##
==========================================
+ Coverage   98.25%   98.29%   +0.03%     
==========================================
  Files          84       86       +2     
  Lines        8315     8483     +168     
==========================================
+ Hits         8170     8338     +168     
  Misses        145      145              
Files Changed Coverage Δ
sap/adt/__init__.py 100.00% <100.00%> (ø)
sap/adt/dataelement.py 100.00% <100.00%> (ø)
sap/adt/objects.py 98.80% <100.00%> (+<0.01%) ⬆️
sap/cli/__init__.py 90.32% <100.00%> (+0.10%) ⬆️
sap/cli/dataelement.py 100.00% <100.00%> (ø)
sap/rest/gcts/sugar.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sap/adt/core.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
doc/commands/dataelement.md Outdated Show resolved Hide resolved
@jfilak
Copy link
Owner

jfilak commented Sep 18, 2023

Since data elements have no text definitions yet. I propose to modify the operation "create" to accept the same parameters as the operation "chattr", to avoid the need to issue 2 commands "create + chattr". The operations "create" and "chattr", should also have the patameter "-a|--activate" to create, define and activate a data element in a signle command. I would also add the option "--overwrite" to the operation create, so it does not fail if the created data element already exists.

@jfilak
Copy link
Owner

jfilak commented Sep 18, 2023

We may have Data Elements text in future: SAP/abap-file-formats#556

@buca92
Copy link
Collaborator Author

buca92 commented Sep 18, 2023

Since data elements have no text definitions yet. I propose to modify the operation "create" to accept the same parameters as the operation "chattr", to avoid the need to issue 2 commands "create + chattr". The operations "create" and "chattr", should also have the patameter "-a|--activate" to create, define and activate a data element in a signle command. I would also add the option "--overwrite" to the operation create, so it does not fail if the created data element already exists.

Ok, I will create the "define" action that will take care of whole DTEL lifecycle from creation to activation phase

@buca92
Copy link
Collaborator Author

buca92 commented Sep 19, 2023

I pushed new version of SAPCLI Data Element handling.

New command define is introduced and covers create, change and activation phases, all that are relevant for a consumer.

See example: sapcli dataelement define Z_TEST_DTEL "Test DTEL created via SAPCLI" '$Z_PLAYGROUND' --activate --no-error-existing --type=predefinedAbapType --data_type=STRING --label_short='Tst DTEL' --label_medium='Test Label Medium' --label_long='Test Label Long' --label_heading='Test Label Heading'

@buca92 buca92 requested a review from jfilak September 19, 2023 06:15
sap/adt/dataelement.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
sap/adt/dataelement.py Outdated Show resolved Hide resolved
Libor Bucek added 2 commits September 19, 2023 11:09
- There is a case when the mimetype is defined, but empty uri extension is provided (it is not needed). When the XML for DTEL needs to be fetched, there is noextended ADT source like .../main/sources that needs to be added to the URI. Trailing slashshould not be added for the case the required uri extension is empty
@buca92 buca92 requested a review from jfilak September 19, 2023 09:20
@jfilak jfilak self-assigned this Sep 19, 2023
pass

case _:
raise SAPCliError("BUG: please report a forgotten case DataElementValidationIssues")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already there ;). Even the Coverage Report shows 100 % again

@buca92 buca92 requested a review from jfilak September 19, 2023 14:39
@jfilak
Copy link
Owner

jfilak commented Sep 19, 2023

Well done. I pushed these commits:

  • 68d161b adt: avoid adding trailing slash into uri if it is not necessary
  • 59ba457 tree-wide: add support for ABAP DDIC Data Element CRUD

@jfilak jfilak closed this Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants