Skip to content

make my last gCTS improvements more mature#174

Merged
jfilak merged 2 commits into
jfilak:masterfrom
filak-sap:gcts_reliability_v2
Jun 12, 2026
Merged

make my last gCTS improvements more mature#174
jfilak merged 2 commits into
jfilak:masterfrom
filak-sap:gcts_reliability_v2

Conversation

@filak-sap

Copy link
Copy Markdown
Contributor

The API for reporting gCTS process errors was not sufficient and generated terrible User experience.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c119e7c1-b07b-4e18-9657-20fd6fce972d

📥 Commits

Reviewing files that changed from the base of the PR and between 71bdf13 and dbf25e3.

📒 Files selected for processing (5)
  • sap/rest/gcts/errors.py
  • sap/rest/gcts/remote_repo.py
  • sap/rest/gcts/repo_task.py
  • sap/rest/gcts/simple.py
  • test/unit/test_sap_rest_gcts.py
✅ Files skipped from review due to trivial changes (1)
  • sap/rest/gcts/remote_repo.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • sap/rest/gcts/errors.py
  • sap/rest/gcts/repo_task.py
  • sap/rest/gcts/simple.py
  • test/unit/test_sap_rest_gcts.py

📝 Walkthrough

Walkthrough

The PR enhances error reporting in the GCTS module by adding process context (name and ID) to exception messages. GCTSProcessError now stores optional process_name and process_id fields and formats messages accordingly. The raise_for_process_message_error helper propagates this context when raising exceptions, and clone_with_task integrates it by specifying process_name='CLONE'. Tests validate the new context propagation.

Changes

Process Error Context Enhancement

Layer / File(s) Summary
Error class contract and format
sap/rest/gcts/errors.py, test/unit/test_sap_rest_gcts.py
GCTSProcessError.__init__ accepts keyword-only process_name and process_id, formats the exception message based on process_name presence, and stores these fields. Test cases verify formatting with various parameter combinations and attribute storage.
Error helper propagation and API clarification
sap/rest/gcts/repo_task.py, sap/rest/gcts/remote_repo.py, test/unit/test_sap_rest_gcts.py
raise_for_process_message_error is extended to accept and forward process_name and process_id to GCTSProcessError. Test cases verify context propagation with and without process identifiers. Remote repo documentation is clarified to explain that process message access returns a fully populated ActionMessage.process_messages with the ActionMessage itself being None.
Clone operation integration
sap/rest/gcts/simple.py, test/unit/test_sap_rest_gcts.py
clone_with_task calls raise_for_process_message_error with process_name='CLONE' and process_id=task.log, with comments documenting the hard-coded process name. The clone error-path test is extended to assert that the raised GCTSProcessError includes expected process context and formatted string output.

Possibly Related PRs

  • jfilak/sapcli#167: Related work using GCTSProcessError in CLI exception handling to print process messages.
  • jfilak/sapcli#170: Introduced raise_for_process_message_error and integrated it into clone_with_task; this PR extends that plumbing to forward process context.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'make my last gCTS improvements more mature' is vague and uses non-descriptive language that does not clearly convey the main change of improving gCTS process error reporting. Provide a more specific title that clearly describes the primary improvement, such as 'Improve gCTS process error reporting with process name and ID' or 'Add process identification context to gCTS error messages'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description appropriately identifies the problem being solved (deficient gCTS process error API producing poor user experience) and aligns with the changeset's improvements to error reporting.
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

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@sap/rest/gcts/remote_repo.py`:
- Around line 575-578: Update the docstring for Repository.messages to correct
the contract: state that when messages_params contains process the returned list
contains a single ActionMessage whose action-level payload is None (created as
ActionMessage(None, msglist)), and callers should not access the action payload
but read the populated process_messages instead; mention the ActionMessage
constructor pattern (ActionMessage(None, msglist)) and the process_messages
attribute to make locating the behavior clear.
🪄 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: 57e8a2ff-0b2a-46c3-b530-3b2faac751ba

📥 Commits

Reviewing files that changed from the base of the PR and between 8e0b41b and 71bdf13.

📒 Files selected for processing (5)
  • sap/rest/gcts/errors.py
  • sap/rest/gcts/remote_repo.py
  • sap/rest/gcts/repo_task.py
  • sap/rest/gcts/simple.py
  • test/unit/test_sap_rest_gcts.py

Comment thread sap/rest/gcts/remote_repo.py Outdated
The comment did not explain the important part and had to confused the
readers.
When GCTSProcessError propagates to the CLI error handler, str(ex)
returns an empty string because the exception was initialized without a
message. This leaves users with no indication of what went wrong and no
way to correlate the failure with gCTS system logs for further
investigation.

Add process_name and process_id to GCTSProcessError so that the string
representation tells the user which gCTS process failed and which log ID
to look up in the system, e.g.:

  gCTS process CLONE failed (log id: ABC123)

The change modifies "public" method signatures but that will hopefully
not hurt anybody as the modified methods have been added quite recently.
@filak-sap filak-sap force-pushed the gcts_reliability_v2 branch from 71bdf13 to dbf25e3 Compare June 12, 2026 18:49
@jfilak jfilak merged commit d49ef69 into jfilak:master Jun 12, 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