Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12336 +/- ##
============================================
+ Coverage 18.31% 18.41% +0.10%
- Complexity 16633 16788 +155
============================================
Files 5939 5941 +2
Lines 537748 538274 +526
Branches 65924 66005 +81
============================================
+ Hits 98472 99140 +668
+ Misses 428070 427868 -202
- Partials 11206 11266 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
86379b7 to
c938bd1
Compare
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
getVariableNamesInErrorKeyexplicitly supports whitespace inside placeholders ({{ var }}), but… · New Avoid committing auto-generated TODO stubs in test utilities. Either implement this method… · New The line numbers reported for missing opening/closing braces are incorrect when the file has… · New The CLI exit code behavior forfix/sortdoesn’t match the module docstring (“fix was a no-op” →… · New
10 resolved since last review
This section has invalid indentation (theifunderexceptis not indented) and the… This block has two issues: (1) theelse:branch referencesex, which is only defined in the… Syntax error: theexceptclause is missing a trailing colon, which will prevent the test file… INCLUDE_RESOURCE_ID_FOR_ADMINS_IN_METADATA is currently unused: admin callers will always get the… In the fallback path (when AccountService bean is missing), the computed result is not cached into… Template variable is malformed:{{nicId}is missing a closing}. This will prevent placeholder…String.replace()only replaces the first occurrence, so templates with the same placeholder more… This assertion compares the expected message key toexception.getMessage(). Since this test was… The error key name contains what looks like a typo (sunninginstead ofrunning). Since keys are… Typo in message text: "scalling" → "scaling" (also reads more naturally as "only scaling up is…
Review effort: Lite
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 19603 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19618 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19834 |
|
@blueorangutan test |
|
@vladimirpetrov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
vladimirpetrov
left a comment
There was a problem hiding this comment.
LGTM based on manual testing, let's wait for the smoke tests to finish.
|
[SF] Trillian test result (tid-17347)
|
|
This is PR is all good, but please dont merge it until 4.22.2 release is out |
There was a problem hiding this comment.
🟡 Changes recommended
The catalog tool can silently erase valid entries during fix/sort, and unresolved metadata handling defects can expose internal database IDs and break exception serialization.
9 open issues
Reject unparsed catalog content before rewriting · New Serialize error metadata as structured XML · New Redact IDs in actual VO string formats · New Preserve stable metadata independently of server templates · New Normalize metadata across the throwable graph · New Install the runtime catalog in SUSE packages · New Write separate output files despite the no-change shortcut · New Restore server overrides when setup fails · New Insert metadata literally in replacement strings · New
4 resolved since last review
The CLI exit code behavior forfix/sortdoesn’t match the module docstring (“fix was a no-op” →… The line numbers reported for missing opening/closing braces are incorrect when the file has… Avoid committing auto-generated TODO stubs in test utilities. Either implement this method…getVariableNamesInErrorKeyexplicitly supports whitespace inside placeholders ({{ var }}), but…
Review effort: Balanced
| text = _load_text(args.file) | ||
| entries = parse_entries(text) |
| @SerializedName("errormetadata") | ||
| @Param(description = "the metadata associated with this error", since = "4.22.2") | ||
| private Map<String, String> errorMetadata; |
| if (!isAdmin) { | ||
| result = result.replaceAll("\\bid:\\s*\\d+", "").trim(); |
| Map<String, Object> combinedMetadata = getCombinedMetadataFromErrorTemplate(template, map, | ||
| true); |
| if (object instanceof CloudRuntimeException) { | ||
| Exceptions.normalizeMetadata((CloudRuntimeException)object); | ||
| } |
|
|
||
| # Plugin-specific error-messages-*.json files are runtime/environment-specific only and are never | ||
| # bundled here; an operator or plugin drops them alongside error-messages.json after install. | ||
| cp client/target/conf/messages/error-messages.json ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/messages/error-messages.json |
| print(new_text) | ||
| return 0 | ||
|
|
||
| if new_text == text: |
| self._write_error_messages_file(json.dumps(data, indent=4)) | ||
|
|
||
| # diagnostic: tells a write/targeting bug apart from a reload bug if this ever fails | ||
| readback = self._read_error_messages_file() | ||
| self.assertIsNotNone(readback, "Could not read back %s right after writing it" % self.ERROR_MESSAGES_PATH) | ||
| self.assertIn( | ||
| self.base_marker, readback, | ||
| "The override was not present when reading %s back immediately after writing it" % self.ERROR_MESSAGES_PATH | ||
| ) | ||
|
|
||
| time.sleep(self.SETTLE_DELAY_SECONDS) |
| } | ||
| if (params && params.constructor === Object) { | ||
| for (const paramKey in params) { | ||
| localeMsg = localeMsg.replaceAll(`{{${paramKey}}}`, params[paramKey]) |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>



Description
Framework-level improvements for contextual and localized API error messages
Design spec: Error Message Consistency, Customization, and Localization Framework
Documentation PR: apache/cloudstack-documentation#684
Developed focused documentation is also added at
api/src/main/java/org/apache/cloudstack/error/README.mdTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Refined error message with additional context for admin

User facing error, with localization

Example API response
How Has This Been Tested?
End-to-end testing and the following smoke test,
How did you try to break this feature and the system with this change?