Skip to content

Add --auth-values option to ddl apistate set command#163

Merged
jfilak merged 3 commits into
jfilak:masterfrom
Akashi1530:master
May 15, 2026
Merged

Add --auth-values option to ddl apistate set command#163
jfilak merged 3 commits into
jfilak:masterfrom
Akashi1530:master

Conversation

@Akashi1530
Copy link
Copy Markdown

Adds support for setting Authorization Default Value in API release state management for CDS views via the --auth-values CLI option.

Rohac and others added 3 commits May 14, 2026 13:53
Enable setting Authorization Default Value in API release state management for CDS views.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds support for an --auth-values option to the sapcli ddl apistate set command, allowing users to update a contract's authorization default value setting. The change spans the data layer, CLI argument parsing and validation, contract application logic, and comprehensive test coverage.

Changes

Authorization Default Value Support

Layer / File(s) Summary
Contract field propagation and deserialization
sap/adt/apirelease.py, test/unit/test_sap_adt_apirelease.py
The create_auth_values field is now propagated from an existing contract when copying, and deserialization tests verify the field is correctly parsed from API responses.
CLI argument parsing and validation
sap/cli/apirelease.py, test/unit/test_sap_cli_apirelease.py
The --auth-values option is wired into the argument parser with validation requiring at least one of --state, --comment, --cloud-dev, --key-user-apps, or --auth-values; capability checking enforces the option is only allowed when authorization default values are enabled.
CLI application to contract and comprehensive tests
sap/cli/apirelease.py, test/unit/test_sap_cli_apirelease.py
The parsed option is normalized and applied to the contract; tests cover the happy path, capability enforcement failure, normalization of yes/no/true/false inputs, and mock argument handling across multiple helper tests.
User-facing command documentation
doc/commands/ddl.md
The apistate set command synopsis is updated to include `[--auth-values YES

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • jfilak/sapcli#151: Introduces the initial apistate list/set CLI and copy_contract payload-building logic that this PR extends with create_auth_values field propagation and the new --auth-values command option.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.37% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding the --auth-values option to the ddl apistate set command, which is reflected throughout the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining that the change adds support for setting Authorization Default Value via the --auth-values CLI option.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Akashi1530 Akashi1530 marked this pull request as ready for review May 14, 2026 12:13
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@doc/commands/ddl.md`:
- Line 82: Update the user-facing option text for the --auth-values flag to use
consistent capitalization: change "authorization Default Value" to
"Authorization Default Value" wherever the --auth-values option description
appears (ensure the capital "A" is used to match terminology used elsewhere in
the document).

In `@test/unit/test_sap_cli_apirelease.py`:
- Line 344: The two multiline calls to _parse in the test (the one including the
args '--state', 'Released', '--cloud-dev', 'No', '--key-user-apps', 'Yes' and
the similar call around line 416) are over-indented and trigger Flake8 E127;
reformat each call so the continuation lines are indented either to align under
the first argument after the opening parenthesis or use a consistent hanging
indent (one level) inside the _parse( ... ) invocation, ensuring the arguments
line up vertically and no extra spaces cause an over-indentation error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 348c8a99-4a02-4626-ac94-f79e8cd7ef12

📥 Commits

Reviewing files that changed from the base of the PR and between 9e91606 and 5d0aea4.

📒 Files selected for processing (5)
  • doc/commands/ddl.md
  • sap/adt/apirelease.py
  • sap/cli/apirelease.py
  • test/unit/test_sap_adt_apirelease.py
  • test/unit/test_sap_cli_apirelease.py

Comment thread doc/commands/ddl.md
- **--comment** - free-text comment
- **--cloud-dev** - use in Cloud Development: Yes or No
- **--key-user-apps** - use in Key User Apps: Yes or No
- **--auth-values** - authorization Default Value: Yes or No
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix capitalization for consistency in user-facing option text.

Use Authorization Default Value (capital A) to match the terminology used elsewhere in this document.

✏️ Proposed doc fix
-- **--auth-values** - authorization Default Value: Yes or No
+- **--auth-values** - Authorization Default Value: Yes or No
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **--auth-values** - authorization Default Value: Yes or No
- **--auth-values** - Authorization Default Value: Yes or No
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/commands/ddl.md` at line 82, Update the user-facing option text for the
--auth-values flag to use consistent capitalization: change "authorization
Default Value" to "Authorization Default Value" wherever the --auth-values
option description appears (ensure the capital "A" is used to match terminology
used elsewhere in the document).

console = BufferConsole()
args = _parse(group, 'apistate', 'set', 'c1', 'I_STATISTICALKEYFIGURECAT',
'--state', 'Released', '--cloud-dev', 'No', '--key-user-apps', 'Yes')
'--state', 'Released', '--cloud-dev', 'No', '--key-user-apps', 'Yes',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix Flake8 E127 continuation indentation in multiline _parse calls.

Both lines are currently over-indented and can fail lint checks.

Proposed formatting fix
-        args = _parse(group, 'apistate', 'set', 'c1', 'I_STATISTICALKEYFIGURECAT',
-                       '--state', 'Released', '--cloud-dev', 'No', '--key-user-apps', 'Yes',
-                       '--auth-values', 'No')
+        args = _parse(
+            group, 'apistate', 'set', 'c1', 'I_STATISTICALKEYFIGURECAT',
+            '--state', 'Released', '--cloud-dev', 'No', '--key-user-apps', 'Yes',
+            '--auth-values', 'No',
+        )

-        args = _parse(group, 'apistate', 'set', 'c0', 'I_STATISTICALKEYFIGURECAT',
-                       '--auth-values', 'Yes')
+        args = _parse(
+            group, 'apistate', 'set', 'c0', 'I_STATISTICALKEYFIGURECAT',
+            '--auth-values', 'Yes',
+        )

Also applies to: 416-416

🧰 Tools
🪛 Flake8 (7.3.0)

[error] 344-344: continuation line over-indented for visual indent

(E127)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/unit/test_sap_cli_apirelease.py` at line 344, The two multiline calls to
_parse in the test (the one including the args '--state', 'Released',
'--cloud-dev', 'No', '--key-user-apps', 'Yes' and the similar call around line
416) are over-indented and trigger Flake8 E127; reformat each call so the
continuation lines are indented either to align under the first argument after
the opening parenthesis or use a consistent hanging indent (one level) inside
the _parse( ... ) invocation, ensuring the arguments line up vertically and no
extra spaces cause an over-indentation error.

@jfilak jfilak merged commit 4934060 into jfilak:master May 15, 2026
3 checks passed
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