sap-cloud-sdk 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. sap_cloud_sdk-0.0.1/.commitlintrc +3 -0
  2. sap_cloud_sdk-0.0.1/.env_integration_tests.example +15 -0
  3. sap_cloud_sdk-0.0.1/.github/CODEOWNERS +1 -0
  4. sap_cloud_sdk-0.0.1/.github/ISSUE_TEMPLATE/bug-report.yml +107 -0
  5. sap_cloud_sdk-0.0.1/.github/ISSUE_TEMPLATE/feature-request.yml +53 -0
  6. sap_cloud_sdk-0.0.1/.github/ISSUE_TEMPLATE/question.yml +11 -0
  7. sap_cloud_sdk-0.0.1/.github/codeql/codeql-config.yml +6 -0
  8. sap_cloud_sdk-0.0.1/.github/dependabot.yml +35 -0
  9. sap_cloud_sdk-0.0.1/.github/pull_request_template.md +54 -0
  10. sap_cloud_sdk-0.0.1/.github/workflows/build.yaml +159 -0
  11. sap_cloud_sdk-0.0.1/.github/workflows/codeql.yaml +43 -0
  12. sap_cloud_sdk-0.0.1/.github/workflows/commit-validation.yaml +34 -0
  13. sap_cloud_sdk-0.0.1/.github/workflows/integration-tests.yml +59 -0
  14. sap_cloud_sdk-0.0.1/.github/workflows/release.yml +60 -0
  15. sap_cloud_sdk-0.0.1/.github/workflows/reuse.yaml +18 -0
  16. sap_cloud_sdk-0.0.1/.gitignore +34 -0
  17. sap_cloud_sdk-0.0.1/CONTRIBUTING.md +195 -0
  18. sap_cloud_sdk-0.0.1/LICENSE +201 -0
  19. sap_cloud_sdk-0.0.1/LICENSES/Apache-2.0.txt +73 -0
  20. sap_cloud_sdk-0.0.1/PKG-INFO +87 -0
  21. sap_cloud_sdk-0.0.1/README.md +70 -0
  22. sap_cloud_sdk-0.0.1/REUSE.toml +11 -0
  23. sap_cloud_sdk-0.0.1/docs/DEVELOPMENT.md +105 -0
  24. sap_cloud_sdk-0.0.1/docs/GUIDELINES.md +108 -0
  25. sap_cloud_sdk-0.0.1/docs/INTEGRATION_TESTS.md +88 -0
  26. sap_cloud_sdk-0.0.1/docs/RELEASE.md +61 -0
  27. sap_cloud_sdk-0.0.1/mocks/certificates.json +4 -0
  28. sap_cloud_sdk-0.0.1/mocks/destination.json +1 -0
  29. sap_cloud_sdk-0.0.1/pyproject.toml +86 -0
  30. sap_cloud_sdk-0.0.1/sonar-project.properties +0 -0
  31. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/__init__.py +1 -0
  32. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/aicore/__init__.py +142 -0
  33. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/__init__.py +0 -0
  34. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/_version.py +23 -0
  35. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/__init__.py +101 -0
  36. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/_http_transport.py +91 -0
  37. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/_transport.py +46 -0
  38. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/client.py +103 -0
  39. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/config.py +119 -0
  40. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/exceptions.py +25 -0
  41. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/models.py +689 -0
  42. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/py.typed +1 -0
  43. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/auditlog/user-guide.md +391 -0
  44. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/secret_resolver/__init__.py +26 -0
  45. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/secret_resolver/resolver.py +160 -0
  46. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/secret_resolver/user-guide.md +244 -0
  47. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/__init__.py +44 -0
  48. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/_provider.py +98 -0
  49. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/auto_instrument.py +54 -0
  50. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/config.py +176 -0
  51. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/constants.py +40 -0
  52. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/genai_attribute_transformer.py +322 -0
  53. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/genai_operation.py +47 -0
  54. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/metrics_decorator.py +80 -0
  55. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/module.py +15 -0
  56. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/operation.py +56 -0
  57. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/telemetry.py +184 -0
  58. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/tracer.py +420 -0
  59. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/core/telemetry/user-guide.md +191 -0
  60. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/__init__.py +200 -0
  61. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/_http.py +281 -0
  62. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/_models.py +781 -0
  63. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/certificate_client.py +448 -0
  64. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/client.py +655 -0
  65. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/config.py +183 -0
  66. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/exceptions.py +51 -0
  67. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/fragment_client.py +402 -0
  68. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/py.typed +1 -0
  69. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/spec/README.md +505 -0
  70. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/spec/api_spec.yaml +4828 -0
  71. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/user-guide.md +371 -0
  72. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/utils/_pagination.py +128 -0
  73. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/destination/utils/_params.py +86 -0
  74. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/__init__.py +78 -0
  75. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/_models.py +43 -0
  76. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/_s3.py +482 -0
  77. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/exceptions.py +31 -0
  78. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/py.typed +1 -0
  79. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/user-guide.md +245 -0
  80. sap_cloud_sdk-0.0.1/src/sap_cloud_sdk/objectstore/utils.py +16 -0
  81. sap_cloud_sdk-0.0.1/tests/__init__.py +1 -0
  82. sap_cloud_sdk-0.0.1/tests/aicore/__init__.py +1 -0
  83. sap_cloud_sdk-0.0.1/tests/aicore/unit/__init__.py +1 -0
  84. sap_cloud_sdk-0.0.1/tests/aicore/unit/test_aicore.py +603 -0
  85. sap_cloud_sdk-0.0.1/tests/core/__init__.py +0 -0
  86. sap_cloud_sdk-0.0.1/tests/core/integration/auditlog/__init__.py +0 -0
  87. sap_cloud_sdk-0.0.1/tests/core/integration/auditlog/auditlog.feature +247 -0
  88. sap_cloud_sdk-0.0.1/tests/core/integration/auditlog/conftest.py +100 -0
  89. sap_cloud_sdk-0.0.1/tests/core/integration/auditlog/test_auditlog_bdd.py +843 -0
  90. sap_cloud_sdk-0.0.1/tests/core/unit/__init__.py +0 -0
  91. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/__init__.py +1 -0
  92. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/__init__.py +1 -0
  93. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_client.py +254 -0
  94. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_config.py +252 -0
  95. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_create_client.py +120 -0
  96. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_exceptions.py +58 -0
  97. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_http_transport.py +370 -0
  98. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_models.py +581 -0
  99. sap_cloud_sdk-0.0.1/tests/core/unit/auditlog/unit/test_transport.py +72 -0
  100. sap_cloud_sdk-0.0.1/tests/core/unit/secret_resolver/__init__.py +1 -0
  101. sap_cloud_sdk-0.0.1/tests/core/unit/secret_resolver/unit/__init__.py +1 -0
  102. sap_cloud_sdk-0.0.1/tests/core/unit/secret_resolver/unit/test_secret_resolver.py +187 -0
  103. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/__init__.py +0 -0
  104. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_auto_instrument.py +157 -0
  105. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_config.py +171 -0
  106. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_genai_attribute_transformer.py +804 -0
  107. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_genai_operation.py +93 -0
  108. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_init.py +120 -0
  109. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_metrics_decorator.py +308 -0
  110. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_module.py +59 -0
  111. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_operation.py +109 -0
  112. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_provider.py +228 -0
  113. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_telemetry.py +311 -0
  114. sap_cloud_sdk-0.0.1/tests/core/unit/telemetry/test_tracer.py +872 -0
  115. sap_cloud_sdk-0.0.1/tests/core/unit/test_version.py +88 -0
  116. sap_cloud_sdk-0.0.1/tests/destination/integration/__init__.py +1 -0
  117. sap_cloud_sdk-0.0.1/tests/destination/integration/certificate.feature +123 -0
  118. sap_cloud_sdk-0.0.1/tests/destination/integration/conftest.py +184 -0
  119. sap_cloud_sdk-0.0.1/tests/destination/integration/destination.feature +214 -0
  120. sap_cloud_sdk-0.0.1/tests/destination/integration/fragment.feature +121 -0
  121. sap_cloud_sdk-0.0.1/tests/destination/integration/test_destination_bdd.py +1214 -0
  122. sap_cloud_sdk-0.0.1/tests/destination/unit/test_certificate_client.py +918 -0
  123. sap_cloud_sdk-0.0.1/tests/destination/unit/test_client.py +1578 -0
  124. sap_cloud_sdk-0.0.1/tests/destination/unit/test_config.py +241 -0
  125. sap_cloud_sdk-0.0.1/tests/destination/unit/test_fragment_client.py +761 -0
  126. sap_cloud_sdk-0.0.1/tests/destination/unit/test_http.py +192 -0
  127. sap_cloud_sdk-0.0.1/tests/destination/unit/test_init.py +368 -0
  128. sap_cloud_sdk-0.0.1/tests/destination/unit/test_models.py +873 -0
  129. sap_cloud_sdk-0.0.1/tests/destination/unit/test_pagination.py +261 -0
  130. sap_cloud_sdk-0.0.1/tests/objectstore/__init__.py +1 -0
  131. sap_cloud_sdk-0.0.1/tests/objectstore/integration/__init__.py +1 -0
  132. sap_cloud_sdk-0.0.1/tests/objectstore/integration/conftest.py +232 -0
  133. sap_cloud_sdk-0.0.1/tests/objectstore/integration/objectstore.feature +191 -0
  134. sap_cloud_sdk-0.0.1/tests/objectstore/integration/test_objectstore_bdd.py +777 -0
  135. sap_cloud_sdk-0.0.1/tests/objectstore/unit/__init__.py +1 -0
  136. sap_cloud_sdk-0.0.1/tests/objectstore/unit/test_create_client.py +55 -0
  137. sap_cloud_sdk-0.0.1/tests/objectstore/unit/test_exceptions.py +64 -0
  138. sap_cloud_sdk-0.0.1/tests/objectstore/unit/test_models.py +95 -0
  139. sap_cloud_sdk-0.0.1/tests/objectstore/unit/test_s3_client.py +372 -0
  140. sap_cloud_sdk-0.0.1/uv.lock +2885 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["@commitlint/config-conventional"]
3
+ }
@@ -0,0 +1,15 @@
1
+ CLOUD_SDK_OTEL_DISABLED=true
2
+
3
+ CLOUD_SDK_CFG_AUDITLOG_DEFAULT_URL=https://your-auditlog-api-url-here
4
+ CLOUD_SDK_CFG_AUDITLOG_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
5
+
6
+ CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_HOST=your-objectstore-host-here
7
+ CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_ACCESS_KEY_ID=your-access-key-id-here
8
+ CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SECRET_ACCESS_KEY=your-secret-access-key-here
9
+ CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_BUCKET=your-bucket-name-here
10
+
11
+ CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=your-destination-client-id-here
12
+ CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=your-destination-client-secret-here
13
+ CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=https://your-destination-auth-url-here
14
+ CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=https://your-destination-configuration-uri-here
15
+ CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=your-identity-zone-here
@@ -0,0 +1 @@
1
+ * @SAP/cloud-sdk-python-team
@@ -0,0 +1,107 @@
1
+ name: Bug Report
2
+ description: Released feature does not work as expected in the SAP Cloud SDK for Python.
3
+ labels:
4
+ - bug
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: "Describe the Bug"
9
+ description: "A clear and concise description of what the bug is."
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ attributes:
14
+ label: "Steps to Reproduce"
15
+ description: "Steps to reproduce the behavior."
16
+ placeholder: |
17
+ 1. Set up ...
18
+ 2. Execute ...
19
+ 3. Confirm ...
20
+ 4. See error
21
+ validations:
22
+ required: true
23
+ - type: textarea
24
+ attributes:
25
+ label: "Expected Behavior"
26
+ description: "A clear and concise description of what you expected to happen. In case of HTTP requests, a working Postman (or similar) request is very helpful."
27
+ validations:
28
+ required: true
29
+ - type: textarea
30
+ attributes:
31
+ label: "Screenshots"
32
+ description: "Add screenshots to help explain your problem."
33
+ validations:
34
+ required: false
35
+ - type: textarea
36
+ attributes:
37
+ label: "Used Versions"
38
+ description: "Provide versions used in the project."
39
+ value: |
40
+ - Python version via `python --version`: ...
41
+ - SAP Cloud SDK for Python version: ...
42
+ - Framework version (if applicable, e.g., Flask, FastAPI): ...
43
+
44
+ <details><summary>Installed packages via <code>pip list</code> or <code>uv pip list</code></summary>
45
+
46
+ ```
47
+ Package list here
48
+ ```
49
+ </details>
50
+ validations:
51
+ required: true
52
+ - type: textarea
53
+ attributes:
54
+ label: "Code Examples"
55
+ description: "Add code snippets as examples to help explain your problem. Please remove sensitive information."
56
+ value: |
57
+ ```python
58
+ # Your code here
59
+ ```
60
+ validations:
61
+ required: false
62
+ - type: textarea
63
+ attributes:
64
+ label: "Stack Trace"
65
+ description: "Add your stack trace here. Please remove sensitive information."
66
+ validations:
67
+ required: false
68
+ - type: textarea
69
+ attributes:
70
+ label: "Log File"
71
+ description: "Add your log file or related error message. Please remove sensitive information."
72
+ value: |
73
+ <details><summary>Log file</summary>
74
+ ...
75
+ </details>
76
+ validations:
77
+ required: false
78
+ - type: dropdown
79
+ attributes:
80
+ label: "Affected Development Phase"
81
+ description: "Choose the development phase affected by this issue."
82
+ multiple: false
83
+ options:
84
+ - Getting Started
85
+ - Development
86
+ - Release
87
+ - Production
88
+ validations:
89
+ required: true
90
+ - type: dropdown
91
+ attributes:
92
+ label: "Impact"
93
+ description: "Choose the impact severity."
94
+ multiple: false
95
+ options:
96
+ - No Impact
97
+ - Inconvenience
98
+ - Impaired
99
+ - Blocked
100
+ validations:
101
+ required: true
102
+ - type: textarea
103
+ attributes:
104
+ label: "Timeline"
105
+ description: "Please briefly state your timeline, e.g., Go-Live in 12 weeks."
106
+ validations:
107
+ required: false
@@ -0,0 +1,53 @@
1
+ name: Feature Request
2
+ description: Request a new feature to help your project using the SAP Cloud SDK for Python.
3
+ labels:
4
+ - feature request
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: "Describe the Problem"
9
+ description: "A clear and concise description of what the missing feature is"
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ attributes:
14
+ label: "Propose a Solution"
15
+ description: "A clear and concise description of what you want to happen. In case of HTTP requests, a working Postman (or similar) request is very helpful."
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ attributes:
20
+ label: "Describe Alternatives"
21
+ description: "A clear and concise description of any alternative solutions or features you've considered."
22
+ validations:
23
+ required: false
24
+ - type: dropdown
25
+ attributes:
26
+ label: "Affected Development Phase"
27
+ description: "Choose the development phase affected by this issue."
28
+ multiple: false
29
+ options:
30
+ - Getting Started
31
+ - Development
32
+ - Release
33
+ - Production
34
+ validations:
35
+ required: true
36
+ - type: dropdown
37
+ attributes:
38
+ label: "Impact"
39
+ description: "Choose the impact severity."
40
+ multiple: false
41
+ options:
42
+ - No Impact
43
+ - Inconvenience
44
+ - Impaired
45
+ - Blocked
46
+ validations:
47
+ required: true
48
+ - type: textarea
49
+ attributes:
50
+ label: "Timeline"
51
+ description: "Please briefly state your timeline, e.g., Go-Live in 12 weeks."
52
+ validations:
53
+ required: false
@@ -0,0 +1,11 @@
1
+ name: Question
2
+ description: Ask a question about the SAP Cloud SDK for Python.
3
+ labels:
4
+ - question
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: "Ask the Question"
9
+ description: Give a clear and concise description.
10
+ validations:
11
+ required: true
@@ -0,0 +1,6 @@
1
+ paths:
2
+ - src
3
+ - tests
4
+ paths-ignore:
5
+ - docs
6
+ - .github
@@ -0,0 +1,35 @@
1
+ version: 2
2
+ updates:
3
+ # Enable version updates for Python pip dependencies
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "monday"
9
+ time: "09:00"
10
+
11
+ # Commit message configuration
12
+ commit-message:
13
+ prefix: "chore"
14
+ prefix-development: "chore"
15
+ include: "scope"
16
+ # Pull request configuration
17
+ pull-request-branch-name:
18
+ separator: "/"
19
+ rebase-strategy: "auto"
20
+ # Target branch for updates
21
+ target-branch: "main"
22
+
23
+ # Enable version updates for GitHub Actions
24
+ - package-ecosystem: "github-actions"
25
+ directory: "/"
26
+ schedule:
27
+ interval: "monthly"
28
+ day: "monday"
29
+ time: "09:00"
30
+ labels:
31
+ - "dependencies"
32
+ - "github-actions"
33
+ commit-message:
34
+ prefix: "chore"
35
+ include: "scope"
@@ -0,0 +1,54 @@
1
+ ## Description
2
+
3
+ Provide a clear description of your changes here.
4
+
5
+ ## Related Issue
6
+
7
+ Closes #<issue_number>
8
+
9
+ (Link to the GitHub issue this PR addresses)
10
+
11
+ ## Type of Change
12
+
13
+ Please check the relevant option:
14
+
15
+ - [ ] Bug fix (non-breaking change that fixes an issue)
16
+ - [ ] New feature (non-breaking change that adds functionality)
17
+ - [ ] Breaking change (fix or feature that would cause existing functionality to change)
18
+ - [ ] Documentation update
19
+ - [ ] Code refactoring
20
+ - [ ] Dependency update
21
+
22
+ ## How to Test
23
+
24
+ Describe how reviewers can test your changes:
25
+
26
+ 1. Step 1
27
+ 2. Step 2
28
+ 3. Expected result
29
+
30
+ ## Checklist
31
+
32
+ Before submitting your PR, please review and check the following:
33
+
34
+ - [ ] I have read the [Contributing Guidelines](../CONTRIBUTING.md)
35
+ - [ ] I have verified that my changes solve the issue
36
+ - [ ] I have added/updated automated tests to cover my changes
37
+ - [ ] All tests pass locally
38
+ - [ ] I have verified that my code follows the [Code Guidelines](../docs/GUIDELINES.md)
39
+ - [ ] I have updated documentation (if applicable)
40
+ - [ ] I have added type hints for all public APIs
41
+ - [ ] My code does not contain sensitive information (credentials, tokens, etc.)
42
+ - [ ] I have followed [Conventional Commits](https://www.conventionalcommits.org/) for commit messages
43
+
44
+ ## Breaking Changes
45
+
46
+ If this PR introduces breaking changes, please describe:
47
+
48
+ - What breaks
49
+ - Migration path for users
50
+ - Alternative approaches considered
51
+
52
+ ## Additional Notes
53
+
54
+ Add any additional context, screenshots, or information that would help reviewers.
@@ -0,0 +1,159 @@
1
+ name: Build
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ env:
12
+ PYTHON_VERSION: "3.11"
13
+ SDK_DIST_NAME: "sap_cloud_sdk"
14
+ COVERAGE_THRESHOLD: "80"
15
+
16
+ jobs:
17
+ build:
18
+ name: Build SDK
19
+ runs-on: ubuntu-latest
20
+ permissions:
21
+ contents: read
22
+ pull-requests: write
23
+ steps:
24
+ - name: "Checkout Repository"
25
+ uses: actions/checkout@v4
26
+ with:
27
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
28
+ fetch-depth: 0
29
+
30
+ - name: "Install uv"
31
+ uses: astral-sh/setup-uv@v4
32
+ with:
33
+ version: "latest"
34
+ enable-cache: true
35
+
36
+ - name: "Set up Python"
37
+ uses: actions/setup-python@v4
38
+ with:
39
+ python-version: ${{ env.PYTHON_VERSION }}
40
+
41
+ - name: "Run Ruff Linter"
42
+ run: uv run ruff check --output-format=github .
43
+
44
+ - name: "Run Ruff Formatter Check"
45
+ run: uv run ruff format --check --diff .
46
+
47
+ - name: "Run ty Type Check"
48
+ run: uv run ty check --output-format github --python-version ${{ env.PYTHON_VERSION }} .
49
+
50
+ - name: "Run Unit Tests with Coverage"
51
+ run: uv run pytest -m "not integration" --cov=src/sap_cloud_sdk --cov-report=xml --cov-report=html --cov-report=term-missing
52
+
53
+ - name: "Upload Coverage Report"
54
+ uses: actions/upload-artifact@v4
55
+ with:
56
+ name: coverage-report
57
+ path: |
58
+ coverage.xml
59
+ htmlcov/
60
+ retention-days: 30
61
+
62
+ - name: "Coverage Report Summary"
63
+ run: |
64
+ echo "## 📊 Coverage Report" >> $GITHUB_STEP_SUMMARY
65
+ echo "" >> $GITHUB_STEP_SUMMARY
66
+ uv run coverage report --format=markdown --skip-empty >> $GITHUB_STEP_SUMMARY
67
+
68
+ - name: "Post Coverage Comment on PR"
69
+ if: github.event_name == 'pull_request'
70
+ env:
71
+ GH_TOKEN: ${{ github.token }}
72
+ run: |
73
+ # Extract unique module paths from changed files
74
+ MODULE_PATHS=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" \
75
+ | grep -E '^src/sap_cloud_sdk/[^/]+/.*\.py$' \
76
+ | grep -vE '__pycache__' \
77
+ | sed -E -e 's|^(src/sap_cloud_sdk/core)/.*|\1|' -e 't' -e 's|^(src/sap_cloud_sdk/[^/]+)/.*|\1|' \
78
+ | sort -u)
79
+
80
+ if [ -z "$MODULE_PATHS" ]; then
81
+ echo "No module-level Python files changed, skipping coverage report"
82
+ exit 0
83
+ fi
84
+
85
+ # Initialize tracking
86
+ FAILED_MODULES=()
87
+ COMMENT_BODY="## 📊 Coverage Report by Module"$'\n\n'
88
+
89
+ # Process each module
90
+ while IFS= read -r module_path; do
91
+ echo "Checking coverage for $module_path..."
92
+
93
+ # Generate coverage report
94
+ MODULE_COVERAGE=$(uv run coverage report \
95
+ --include="$module_path/*.py,$module_path/**/*.py" \
96
+ --format=markdown \
97
+ --skip-empty \
98
+ --skip-covered 2>/dev/null || echo "No coverage data for $module_path")
99
+
100
+ # Check if coverage meets threshold
101
+ if uv run coverage report \
102
+ --include="$module_path/*.py,$module_path/**/*.py" \
103
+ --skip-empty \
104
+ --fail-under=${{ env.COVERAGE_THRESHOLD }} >/dev/null 2>&1; then
105
+ COMMENT_BODY+="### \`$module_path\` ✅"$'\n\n'"$MODULE_COVERAGE"$'\n\n'
106
+ else
107
+ COMMENT_BODY+="### \`$module_path\` ❌"$'\n\n'"$MODULE_COVERAGE"$'\n\n'
108
+ FAILED_MODULES+=("$module_path")
109
+ fi
110
+ done <<< "$MODULE_PATHS"
111
+
112
+ # Add overall status
113
+ COMMENT_BODY+="---"$'\n\n'
114
+ if [ ${#FAILED_MODULES[@]} -eq 0 ]; then
115
+ COMMENT_BODY+="✅ **All changed modules meet the ${{ env.COVERAGE_THRESHOLD }}% coverage threshold!**"
116
+ else
117
+ COMMENT_BODY+="❌ **Coverage check failed!** The following modules are below ${{ env.COVERAGE_THRESHOLD }}% coverage: \`$(IFS=', '; echo "${FAILED_MODULES[*]}")\`"
118
+ fi
119
+
120
+ COMMENT_BODY+=$'\n\n'"---"$'\n'"*Coverage report from commit [\`${GITHUB_SHA:0:7}\`](${{ github.event.pull_request.head.repo.html_url }}/commit/${{ github.event.pull_request.head.sha }})*"
121
+
122
+ # Post comment on PR
123
+ echo "$COMMENT_BODY" | gh pr comment ${{ github.event.pull_request.number }} --body-file -
124
+
125
+ # Exit with failure if any module failed
126
+ [ ${#FAILED_MODULES[@]} -eq 0 ] || exit 1
127
+
128
+ - name: "Build Packages"
129
+ run: uv build
130
+
131
+ - name: "List Build Artifacts"
132
+ run: |
133
+ echo "Build artifacts:"
134
+ ls -lh dist/
135
+
136
+ - name: "Verify Build Artifacts"
137
+ run: |
138
+ # Check that both wheel and source distribution were created
139
+ wheel_count=$(ls -1 dist/*.whl 2>/dev/null | wc -l)
140
+ tar_count=$(ls -1 dist/*.tar.gz 2>/dev/null | wc -l)
141
+
142
+ if [ "$wheel_count" -eq 0 ]; then
143
+ echo "ERROR: No wheel file found"
144
+ exit 1
145
+ fi
146
+
147
+ if [ "$tar_count" -eq 0 ]; then
148
+ echo "ERROR: No source distribution found"
149
+ exit 1
150
+ fi
151
+
152
+ echo "✓ Build artifacts verified: $wheel_count wheel(s), $tar_count source distribution(s)"
153
+
154
+ - name: "Upload Build Artifacts"
155
+ uses: actions/upload-artifact@v4
156
+ with:
157
+ name: ${{ env.SDK_DIST_NAME }}
158
+ path: dist/
159
+ retention-days: 7
@@ -0,0 +1,43 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+ schedule:
9
+ - cron: '19 2 * * 4'
10
+
11
+ jobs:
12
+ analyze:
13
+ name: Analyze (${{ matrix.language }})
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 360
16
+ permissions:
17
+ security-events: write
18
+ packages: read
19
+ actions: read
20
+ contents: read
21
+
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ include:
26
+ - language: python
27
+ build-mode: none
28
+
29
+ steps:
30
+ - name: Checkout repository
31
+ uses: actions/checkout@v6
32
+
33
+ - name: Initialize CodeQL
34
+ uses: github/codeql-action/init@v4
35
+ with:
36
+ languages: ${{ matrix.language }}
37
+ build-mode: ${{ matrix.build-mode }}
38
+ config-file: ./.github/codeql/codeql-config.yml
39
+
40
+ - name: Perform CodeQL Analysis
41
+ uses: github/codeql-action/analyze@v4
42
+ with:
43
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,34 @@
1
+ name: Commit Validation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ commit-validation:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout repository
16
+ uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Setup node
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 22
24
+
25
+ - name: Install commitlint
26
+ run: npm install -g @commitlint/cli @commitlint/config-conventional
27
+
28
+ - name: Validate current commit (last commit)
29
+ if: ${{ github.event_name == 'push' }}
30
+ run: npx commitlint --last --verbose
31
+
32
+ - name: Validate PR title
33
+ if: ${{ github.event_name == 'pull_request' }}
34
+ run: echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose
@@ -0,0 +1,59 @@
1
+ name: Integration Tests
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ paths:
7
+ - '.github/workflows/integration-tests.yml'
8
+ - 'src/**/*.py'
9
+ - 'tests/**/*.py'
10
+ - 'pyproject.toml'
11
+ push:
12
+ branches: [main]
13
+ paths:
14
+ - '.github/workflows/integration-tests.yml'
15
+ - 'src/**/*.py'
16
+ - 'tests/**/*.py'
17
+ - 'pyproject.toml'
18
+
19
+ jobs:
20
+ integration-tests:
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: '3.11'
31
+
32
+ - name: Install uv
33
+ uses: astral-sh/setup-uv@v3
34
+
35
+ - name: Install dependencies
36
+ run: uv sync --dev
37
+
38
+ - name: Set up integration test environment
39
+ run: |
40
+ echo "Setting up environment variables for integration tests..."
41
+
42
+ # Process GitHub secrets (all configuration stored as secrets)
43
+ echo '${{ toJSON(secrets) }}' | jq -r 'to_entries[] | select(.key | startswith("CLOUD_SDK_CFG_")) | "\(.key)=\(.value)"' | while read line; do
44
+ echo "$line" >> $GITHUB_ENV
45
+ var_name=$(echo "$line" | cut -d= -f1)
46
+ echo "Set secret: $var_name"
47
+ done
48
+
49
+ # Process GitHub variables (all configuration stored as variables)
50
+ echo '${{ toJSON(vars) }}' | jq -r 'to_entries[] | select(.key | startswith("CLOUD_SDK_CFG_")) | "\(.key)=\(.value)"' | while read line; do
51
+ echo "$line" >> $GITHUB_ENV
52
+ var_name=$(echo "$line" | cut -d= -f1)
53
+ echo "Set variable: $var_name"
54
+ done
55
+
56
+ echo "Environment setup complete - automatically configured all CLOUD_SDK_CFG_* environment variables and secrets"
57
+
58
+ - name: Run integration tests
59
+ run: uv run pytest tests/*/integration/ -v --tb=short
@@ -0,0 +1,60 @@
1
+ name: Publish Package to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ permissions:
10
+ contents: read
11
+ id-token: write
12
+ name: Publish to PyPI
13
+ runs-on: ubuntu-latest
14
+ environment: 'pypi:sap-cloud-sdk'
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v4
21
+ with:
22
+ python-version: "3.11"
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v4
26
+ with:
27
+ enable-cache: true
28
+
29
+ - name: Read package name and version from pyproject.toml
30
+ id: metadata
31
+ run: |
32
+ pip install toml
33
+ PKG_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
34
+ VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
35
+ echo "Publishing $PKG_NAME version $VERSION to PyPI"
36
+ echo "name=$PKG_NAME" >> $GITHUB_OUTPUT
37
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
38
+
39
+ - name: Check if version already exists on PyPI
40
+ run: |
41
+ PKG_NAME="${{ steps.metadata.outputs.name }}"
42
+ VERSION="${{ steps.metadata.outputs.version }}"
43
+
44
+ echo "Checking if $PKG_NAME version $VERSION exists on PyPI..."
45
+
46
+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/$PKG_NAME/$VERSION/json")
47
+
48
+ if [ "$HTTP_STATUS" = "200" ]; then
49
+ echo "ERROR: Version $VERSION of $PKG_NAME already exists on PyPI!"
50
+ echo "Please increment the version in pyproject.toml before publishing."
51
+ exit 1
52
+ else
53
+ echo "Version $VERSION is available for upload to PyPI"
54
+ fi
55
+
56
+ - name: Build release distribution
57
+ run: uv build
58
+
59
+ - name: Publish to PyPI
60
+ uses: pypa/gh-action-pypi-publish@v1.13.0
@@ -0,0 +1,18 @@
1
+ name: REUSE Compliance Check
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ pull_request:
8
+ branches:
9
+ - "main"
10
+
11
+ jobs:
12
+ check-reuse-compliance:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+
17
+ - name: REUSE Compliance Check
18
+ uses: fsfe/reuse-action@v6.0.0