Skip to content

Send Execution Log to Central Report#4317

Merged
Maheshkale447 merged 8 commits into
Releases/Official-Releasefrom
Feature/SendExecutionLogToCentralReport
Oct 3, 2025
Merged

Send Execution Log to Central Report#4317
Maheshkale447 merged 8 commits into
Releases/Official-Releasefrom
Feature/SendExecutionLogToCentralReport

Conversation

@prashelke

@prashelke prashelke commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Thank you for your contribution.
Before submitting this PR, please make sure:

  • PR description and commit message should describe the changes done in this PR
  • Verify the PR is pointing to correct branch i.e. Release or Beta branch if the code fix is for specific release , else point it to master
  • Latest Code from master or specific release branch is merged to your branch
  • No unwanted\commented\junk code is included
  • No new warning upon build solution
  • Code Summary\Comments are added to my code which explains what my code is doing
  • Existing unit test cases are passed
  • New Unit tests are added for your development
  • Sanity Tests are successfully executed for New and Existing Functionality
  • Verify that changes are compatible with all relevant browsers and platforms.
  • After creating pull request there should not be any conflicts
  • Resolve all Codacy comments
  • Builds and checks are passed before PR is sent for review
  • Resolve code review comments
  • Update the Help Library document to match any feature changes

Summary by CodeRabbit

  • New Features

    • Centralized HTTP logging: batched background transmission with retries, backoff, and graceful shutdown.
    • Runtime controls to set execution ID, instance ID, and central API URL so logs can be correlated with runs.
    • CLI/URL handling extracts instance and execution IDs to initialize logging context.
  • Chores

    • Default batch/flush/retry values added to app settings and logging configuration.
    • Solution download now respects CLI mode (sync vs async).

@coderabbitai

coderabbitai Bot commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@prashelke has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1a5c1d2 and df04f20.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1 hunks)

Walkthrough

Adds a new HTTP log4net appender and supporting API handler to batch and send execution logs to a central service, plus runtime wiring (ExecutionId, InstanceId, ApiUrl), CLI/config integrations, log4net configuration and appSettings, and endpoint resolution helpers.

Changes

Cohort / File(s) Summary
Config: HTTP log appender settings
Ginger/Ginger/App.config
Adds appSettings: HttpLogBatchSize, HttpLogFlushIntervalSeconds, HttpLogMaxRetryDelaySeconds.
Appender: New HTTP log appender + wiring
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs, Ginger/GingerCoreNET/log4netLib/log4net.config
New HttpLogAppender implementing batching, background worker, flush interval, exponential retry, API posting; wired into log4net.config and added to root logger.
Logging facade: runtime configuration
Ginger/GingerCoreNET/log4netLib/GingerLog.cs
Adds SetHTTPLogAppenderExecutionId, SetHTTPLogAppenderInstanceId, SetHTTPLogAppenderAPIUrl to locate/configure HttpLogAppender at runtime with validation and logging.
API handler: execution log send
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs
Adds SendExecutionLogToCentralDBAsync(...), helper REST sender, ExecutionLogPayload, SEND_EXECUTIONLOG path and per-instance LogId correlation.
Run flow: bind execution ID to HTTP logging
Ginger/GingerCoreNET/Run/RunsetExecutor.cs
Introduces local AccountReportApiHandler usage and ExecutionId validation/regeneration when centralized reporting configured; preserves logging of ExecutionId.
CLI: configure API URL and instance ID
Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs, Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs, Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs
Parses instanceId from URL query and validates; sets GingerLog ApiUrl/InstanceId/ExecutionId as appropriate; CLIDynamicFile loads external config and sets appender params; CLIHelper chooses sync vs async solution download for CLI mode.
Endpoint resolution: GingerPlay gateway handling
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs
Adds GetAccountReportServiceUrlByGateWay() and null-safe gateway vs centralized report URL resolution.
App: minor/non-functional changes
Ginger/Ginger/App.xaml.cs
Minor whitespace/formatting change only.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant CLI as CLIProcessor
  participant Dyn as CLIDynamicFile
  participant GLog as GingerLog
  participant App as HttpLogAppender
  participant ARH as AccountReportApiHandler
  participant API as CentralAPI

  User->>CLI: Start with URL (may include ?instanceId=...)
  CLI->>GLog: SetHTTPLogAppenderAPIUrl(baseUrl)
  CLI->>GLog: SetHTTPLogAppenderInstanceId(instanceId)
  CLI->>Dyn: Load dynamic execution JSON
  Dyn->>GLog: SetHTTPLogAppenderExecutionId(executionId)

  note over App: Background worker batches logs by BatchSize or FlushInterval

  CLI->>App: Append logging events
  App->>App: Buffer until batch or interval
  App->>ARH: SendExecutionLogToCentralDBAsync(ApiUrl, ExecutionId, InstanceId, LogData)
  ARH-->>API: POST /execution-log
  API-->>ARH: 200 / error
  alt success
    ARH-->>App: ack
  else failure
    App->>App: retry with backoff up to MaxRetryDelaySeconds
  end
Loading
sequenceDiagram
  autonumber
  participant Run as RunsetExecutor
  participant GLog as GingerLog
  participant App as HttpLogAppender

  Run->>Run: Start RunRunset
  Run->>GLog: SetHTTPLogAppenderExecutionId(ExecutionID)
  note over App: Subsequent logs include ExecutionId for central correlation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • Maheshkale447
  • MeniKadosh1

Poem

Thump-thump, I batch my logs tonight,
Carrots packed in JSON light.
GUIDs stamped, the burrow's clear,
I hop retries when storms are near.
Bounce, deliver — central trace in sight. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description consists only of the generic contributor checklist template and does not include any details about the actual changes made, such as a summary of new features, configuration updates, or testing steps, so it fails to meet the repository’s requirement for a filled-out description. Please replace the placeholder checklist with a completed description that outlines the implemented changes, configuration additions, public API modifications, testing performed, and any upgrade or migration steps following the repository’s template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Send Execution Log to Central Report” succinctly captures the main feature added by this pull request, namely the new capability to transmit execution logs to a centralized reporting endpoint, and it is clear and specific enough for a reviewer to understand the core change at a glance.

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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 31

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5d3652 and cb71074.

📒 Files selected for processing (9)
  • Ginger/Ginger/App.config (1 hunks)
  • Ginger/Ginger/App.xaml.cs (1 hunks)
  • Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (3 hunks)
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs (4 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (2 hunks)
  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs (3 hunks)
  • Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1 hunks)
  • Ginger/GingerCoreNET/log4netLib/log4net.config (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it provides access to the `ObservableList<>` class which is used throughout the file for collections of RunSetConfig, AnalyzerItemBase, and ApplicationPOMModel objects.

Applied to files:

  • Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs
  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it imports the ObservableList<> class which is used throughout the file.

Applied to files:

  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs
  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs
📚 Learning: 2025-03-20T11:10:30.816Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4137
File: Ginger/Ginger/SourceControl/SourceControlProjectsPage.xaml.cs:21-21
Timestamp: 2025-03-20T11:10:30.816Z
Learning: The `Amdocs.Ginger.Common.SourceControlLib` namespace is required in files that reference the `GingerSolution` class for source control operations in the Ginger automation framework.

Applied to files:

  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs
📚 Learning: 2024-10-15T07:06:51.444Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#3958
File: Ginger/Ginger/App.xaml.cs:246-246
Timestamp: 2024-10-15T07:06:51.444Z
Learning: In `Ginger/Ginger/App.xaml.cs`, the `cliProcessor` field is used in multiple methods (`ParseCommandLineArguments` and `RunNewCLI`), so it should remain as a class-level field.

Applied to files:

  • Ginger/Ginger/App.xaml.cs
📚 Learning: 2025-09-05T10:50:57.706Z
Learnt from: Maheshkale447
PR: Ginger-Automation/Ginger#4293
File: Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs:56-60
Timestamp: 2025-09-05T10:50:57.706Z
Learning: In AccountReportApiHandler.cs, the _isRunSetDataSent flag is correctly initialized to true by default. This flag acts as a circuit breaker where true allows operations to proceed and false blocks downstream operations after a RunSet send failure. The optimistic default (true) is necessary to allow the initial RunSet send attempt.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs
📚 Learning: 2025-09-05T10:53:38.154Z
Learnt from: Maheshkale447
PR: Ginger-Automation/Ginger#4293
File: Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs:0-0
Timestamp: 2025-09-05T10:53:38.154Z
Learning: In AccountReportApiHandler.cs, the user confirmed that the _isRunSetDataSent flag follows a "fail first" circuit breaker pattern where it starts optimistically as true to allow initial operations, and only gets set to false after actual failures occur. This prevents unnecessary blocking before any failure has been detected.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
📚 Learning: 2025-09-30T06:03:09.360Z
Learnt from: AmanPrasad43
PR: Ginger-Automation/Ginger#4314
File: Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs:960-976
Timestamp: 2025-09-30T06:03:09.360Z
Learning: In GingerPlayDetails configuration mapping (file: Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs), both EnableAccountReportService and EnableHTMLReportService should be mapped from gingerPlayConfig.GingerPlayReportServiceEnabled as they represent the same underlying service.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
🧬 Code graph analysis (6)
Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (1)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (3)
  • GingerLog (36-269)
  • SetHTTPLogAppenderAPIUrl (239-268)
  • SetHTTPLogAppenderInstanceId (208-237)
Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (1)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (3)
  • GingerLog (36-269)
  • SetHTTPLogAppenderExecutionId (177-206)
  • SetHTTPLogAppenderAPIUrl (239-268)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (20)
  • Task (125-175)
  • Task (177-199)
  • Task (201-216)
  • Task (218-241)
  • Task (243-265)
  • Task (267-289)
  • Task (319-357)
  • Task (360-392)
  • Task (394-439)
  • Task (442-474)
  • Task (476-500)
  • Task (592-618)
  • Task (620-650)
  • Task (652-679)
  • AccountReportApiHandler (39-680)
  • AccountReportApiHandler (66-89)
  • AccountReportApiHandler (90-93)
  • List (502-530)
  • List (532-560)
  • List (562-590)
Ginger/GingerCoreNET/Run/RunsetExecutor.cs (4)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (3)
  • AccountReportApiHandler (39-680)
  • AccountReportApiHandler (66-89)
  • AccountReportApiHandler (90-93)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (2)
  • GingerPlayEndPointManager (27-253)
  • GetAccountReportServiceUrl (69-103)
Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1)
  • WorkSpace (61-1006)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (2)
  • GingerLog (36-269)
  • SetHTTPLogAppenderExecutionId (177-206)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (2)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (1)
  • ToLog (94-125)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (3)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (2)
  • Append (111-131)
  • HttpLogAppender (13-192)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (3)
  • AccountReportApiHandler (39-680)
  • AccountReportApiHandler (66-89)
  • AccountReportApiHandler (90-93)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
🔇 Additional comments (7)
Ginger/GingerCoreNET/Run/RunsetExecutor.cs (1)

26-26: LGTM!

The using directive for Amdocs.Ginger.CoreNET.log4netLib is correctly added to support the new HTTP log appender configuration.

Ginger/GingerCoreNET/log4netLib/log4net.config (1)

23-23: LGTM!

The appender reference is correctly added to the root logger, enabling the HttpLogAppender for all log events.

Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (1)

21-21: LGTM!

The using directive for Amdocs.Ginger.CoreNET.log4netLib is correctly added to support HTTP log appender configuration.

Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (3)

64-64: LGTM: Per-instance LogId for correlation.

The LogId is correctly scoped as instance-level and initialized once per AccountReportApiHandler to correlate all logs sent by this handler instance. This supports tracing multiple concurrent executions.


620-620: Clarify why ApiUrl is a parameter.

The AccountReportApiHandler already has EndPointUrl set in the constructor. Why does SendExecutionLogToCentralDBAsync take ApiUrl as a parameter instead of using EndPointUrl? This creates inconsistency and potential for passing the wrong URL.

Consider refactoring to use EndPointUrl directly, or document why the parameter is necessary.


652-679: LGTM: Clean error handling and response validation.

The helper method correctly sends the REST request, validates the response, and provides clear success/failure logging. Error handling is appropriate with exceptions caught and logged.

Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1)

111-131: LGTM - Proper defensive copying for thread safety.

The implementation correctly creates a defensive copy of the LoggingEvent and snapshots its properties to prevent race conditions when the async worker processes the queue. This is essential for ensuring data integrity in a multi-threaded logging environment.

Comment thread Ginger/Ginger/App.config Outdated
Comment thread Ginger/Ginger/App.xaml.cs Outdated
Comment thread Ginger/GingerCoreNET/log4netLib/GingerLog.cs Outdated
Comment thread Ginger/GingerCoreNET/log4netLib/GingerLog.cs Outdated
Comment thread Ginger/GingerCoreNET/log4netLib/GingerLog.cs Outdated
Comment thread Ginger/GingerCoreNET/Run/RunsetExecutor.cs Outdated
Comment thread Ginger/GingerCoreNET/Run/RunsetExecutor.cs Outdated
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs Outdated
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs Outdated
@prashelke
prashelke changed the base branch from master to Releases/Official-Release October 3, 2025 11:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (1)

151-152: Fix inconsistent error message.

The error message on line 151 mentions "Account Report Service URL" but should reference "HTML Report Service URL" to match the method's purpose.

Apply this diff:

         catch (Exception ex)
         {
-            Reporter.ToLog(eLogLevel.ERROR, $"Error occurred while getting Account Report Service URL: {ex.Message}");
-            Reporter.ToUser(eUserMsgKey.StaticErrorMessage, "Failed to retrieve the Account Report Service URL. Please check the configuration.");
+            Reporter.ToLog(eLogLevel.ERROR, $"Error occurred while getting HTML Report Service URL: {ex.Message}");
+            Reporter.ToUser(eUserMsgKey.StaticErrorMessage, "Failed to retrieve the HTML Report Service URL. Please check the configuration.");
             return null;
         }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb71074 and fcd92cf.

📒 Files selected for processing (11)
  • Ginger/Ginger/App.config (1 hunks)
  • Ginger/Ginger/App.xaml.cs (1 hunks)
  • Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (3 hunks)
  • Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (2 hunks)
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs (4 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (3 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (3 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (4 hunks)
  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs (3 hunks)
  • Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1 hunks)
  • Ginger/GingerCoreNET/log4netLib/log4net.config (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it provides access to the `ObservableList<>` class which is used throughout the file for collections of RunSetConfig, AnalyzerItemBase, and ApplicationPOMModel objects.

Applied to files:

  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it imports the ObservableList<> class which is used throughout the file.

Applied to files:

  • Ginger/GingerCoreNET/log4netLib/GingerLog.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
📚 Learning: 2024-10-15T07:06:51.444Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#3958
File: Ginger/Ginger/App.xaml.cs:246-246
Timestamp: 2024-10-15T07:06:51.444Z
Learning: In `Ginger/Ginger/App.xaml.cs`, the `cliProcessor` field is used in multiple methods (`ParseCommandLineArguments` and `RunNewCLI`), so it should remain as a class-level field.

Applied to files:

  • Ginger/Ginger/App.xaml.cs
📚 Learning: 2025-09-30T06:03:09.397Z
Learnt from: AmanPrasad43
PR: Ginger-Automation/Ginger#4314
File: Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs:960-976
Timestamp: 2025-09-30T06:03:09.397Z
Learning: In GingerPlayDetails configuration mapping (file: Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs), both EnableAccountReportService and EnableHTMLReportService should be mapped from gingerPlayConfig.GingerPlayReportServiceEnabled as they represent the same underlying service.

Applied to files:

  • Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs
  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
📚 Learning: 2025-03-20T11:10:30.816Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4137
File: Ginger/Ginger/SourceControl/SourceControlProjectsPage.xaml.cs:21-21
Timestamp: 2025-03-20T11:10:30.816Z
Learning: The `Amdocs.Ginger.Common.SourceControlLib` namespace is required in files that reference the `GingerSolution` class for source control operations in the Ginger automation framework.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
📚 Learning: 2025-09-05T10:50:57.706Z
Learnt from: Maheshkale447
PR: Ginger-Automation/Ginger#4293
File: Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs:56-60
Timestamp: 2025-09-05T10:50:57.706Z
Learning: In AccountReportApiHandler.cs, the _isRunSetDataSent flag is correctly initialized to true by default. This flag acts as a circuit breaker where true allows operations to proceed and false blocks downstream operations after a RunSet send failure. The optimistic default (true) is necessary to allow the initial RunSet send attempt.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
  • Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs
📚 Learning: 2025-09-05T10:53:38.154Z
Learnt from: Maheshkale447
PR: Ginger-Automation/Ginger#4293
File: Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs:0-0
Timestamp: 2025-09-05T10:53:38.154Z
Learning: In AccountReportApiHandler.cs, the user confirmed that the _isRunSetDataSent flag follows a "fail first" circuit breaker pattern where it starts optimistically as true to allow initial operations, and only gets set to false after actual failures occur. This prevents unnecessary blocking before any failure has been detected.

Applied to files:

  • Ginger/GingerCoreNET/Run/RunsetExecutor.cs
🧬 Code graph analysis (7)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (2)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (2)
  • Append (145-165)
  • HttpLogAppender (19-256)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (4)
Ginger/GingerCoreCommon/External/Configurations/GingerPlayConfiguration.cs (1)
  • GingerPlayConfiguration (23-240)
Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1)
  • WorkSpace (61-1006)
Ginger/GingerCoreCommon/WorkSpaceLib/Solution.cs (2)
  • Solution (43-657)
  • Solution (54-57)
Ginger/GingerCoreCommon/ReportsLib/ExecutionLoggerConfiguration.cs (3)
  • GetCentralLoggerEndPointURLBackwardCompatibility (197-197)
  • GetCentralizedHtmlReportServiceURLBackwardCompatibility (200-200)
  • GetExecutionServiceURLBackwardCompatibility (203-203)
Ginger/GingerCoreNET/Run/RunsetExecutor.cs (2)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (3)
  • AccountReportApiHandler (37-695)
  • AccountReportApiHandler (64-87)
  • AccountReportApiHandler (88-91)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (2)
  • GingerPlayEndPointManager (27-271)
  • GetAccountReportServiceUrl (87-121)
Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (2)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (4)
  • GingerLog (34-225)
  • SetHTTPLogAppenderExecutionId (141-166)
  • SetHTTPLogAppenderAPIUrl (196-224)
  • ToLog (92-123)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (2)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/GingerCoreNET/log4netLib/GingerLog.cs (5)
  • ToLog (92-123)
  • GingerLog (34-225)
  • SetHTTPLogAppenderAPIUrl (196-224)
  • SetHTTPLogAppenderInstanceId (168-194)
  • SetHTTPLogAppenderExecutionId (141-166)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (2)
Ginger/GingerCoreNET/Run/RunsetExecutor.cs (2)
  • Task (430-440)
  • Task (442-663)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (4)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (19)
  • Task (123-173)
  • Task (175-197)
  • Task (199-214)
  • Task (216-239)
  • Task (241-263)
  • Task (265-287)
  • Task (317-355)
  • Task (358-390)
  • Task (392-437)
  • Task (440-472)
  • Task (474-498)
  • Task (590-616)
  • Task (618-665)
  • AccountReportApiHandler (37-695)
  • AccountReportApiHandler (64-87)
  • AccountReportApiHandler (88-91)
  • List (500-528)
  • List (530-558)
  • List (560-588)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (2)
  • GingerPlayEndPointManager (27-271)
  • GetAccountReportServiceUrlByGateWay (78-85)
Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1)
  • WorkSpace (61-1006)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
🔇 Additional comments (9)
Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (1)

333-342: Double-check instanceId parsing type

We now require the instanceId query string to parse as long, but GingerPlay deep links previously handed it out as a GUID. If the gateway still emits GUID values, this will always fail the TryParse, log an error, and abort CLI execution. Please confirm the upstream format (and adjust back to Guid.TryParse if it’s still a GUID) before we ship.

Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (3)

78-85: LGTM!

The new helper method correctly computes the account report service URL from the gateway configuration with proper null-checks.


87-121: LGTM!

The updated logic correctly delegates URL resolution with proper null-safety and includes backward-compatibility migration.


180-211: LGTM!

The execution service URL resolution follows the same safe pattern with proper null-checks and backward-compatibility handling.

Ginger/GingerCoreNET/log4netLib/GingerLog.cs (3)

141-166: LGTM!

The method correctly sets ExecutionId on the HTTP log appender only when provided and not already set, with proper null-checks and error handling.


168-194: LGTM!

The method correctly sets InstanceId on the HTTP log appender only when provided and not already set, following the same safe pattern as SetHTTPLogAppenderExecutionId.


196-224: LGTM!

The method correctly validates and sets ApiUrl on the HTTP log appender with proper null-checks and error handling.

Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (2)

116-143: LGTM!

The lifecycle methods correctly initialize and shut down the background worker with proper cancellation and timeout handling.


145-165: LGTM!

The Append method correctly clones the LoggingEvent and its properties to prevent race conditions between synchronous logging and asynchronous processing.

Comment thread Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs
Comment thread Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs
Comment thread Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (2)

31-45: Fix ApiUrl setter to allow initial assignment
The setter currently requires _apiUrl to already hold a value before accepting a new one, so the very first attempt to configure the appender via GingerLog.SetHTTPLogAppenderAPIUrl(...) is ignored. This leaves the appender permanently pointing to an empty URL and prevents any logs from being sent. Please flip the logic so that we always accept the initial non-empty assignment (and later updates when the value actually changes).

         set
         {
-            if(!string.IsNullOrWhiteSpace(_apiUrl) && !string.IsNullOrWhiteSpace(value) && value != _apiUrl)
+            if (string.IsNullOrWhiteSpace(_apiUrl) || (!string.IsNullOrWhiteSpace(value) && value != _apiUrl))
             {
                 _apiUrl = value;
             }
         }

154-229: Guard numeric config parsing to keep the worker alive
Multiple calls to int.Parse(FlushIntervalSeconds/MaxRetryDelaySeconds) assume perfect configuration; a single non-numeric value (e.g. a typo in appSettings) throws FormatException, aborts ProcessQueue, and stops all log delivery. Please parse and validate these settings once (e.g. during ActivateOptions) using int.TryParse, fall back to sane defaults, and reuse the parsed integers inside ProcessQueue.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcd92cf and dd835ce.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (4)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (19)
  • Task (123-173)
  • Task (175-197)
  • Task (199-214)
  • Task (216-239)
  • Task (241-263)
  • Task (265-287)
  • Task (317-355)
  • Task (358-390)
  • Task (392-437)
  • Task (440-472)
  • Task (474-498)
  • Task (590-616)
  • Task (618-665)
  • AccountReportApiHandler (37-695)
  • AccountReportApiHandler (64-87)
  • AccountReportApiHandler (88-91)
  • List (500-528)
  • List (530-558)
  • List (560-588)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (2)
  • GingerPlayEndPointManager (27-271)
  • GetAccountReportServiceUrlByGateWay (78-85)
Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1)
  • WorkSpace (61-1006)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)

Comment thread Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd835ce and 9d0950e.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs (3)
Ginger/GingerCoreNET/Run/RunListenerLib/CenteralizedExecutionLogger/AccountReportApiHandler.cs (19)
  • Task (123-173)
  • Task (175-197)
  • Task (199-214)
  • Task (216-239)
  • Task (241-263)
  • Task (265-287)
  • Task (317-355)
  • Task (358-390)
  • Task (392-437)
  • Task (440-472)
  • Task (474-498)
  • Task (590-616)
  • Task (618-665)
  • AccountReportApiHandler (37-695)
  • AccountReportApiHandler (64-87)
  • AccountReportApiHandler (88-91)
  • List (500-528)
  • List (530-558)
  • List (560-588)
Ginger/GingerCoreNET/External/GingerPlay/GingerPlayEndPointManager.cs (2)
  • GingerPlayEndPointManager (27-271)
  • GetAccountReportServiceUrlByGateWay (78-85)
Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1)
  • WorkSpace (61-1006)

Comment thread Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs
Comment thread Ginger/GingerCoreNET/log4netLib/HttpLogAppender.cs Outdated
@Maheshkale447
Maheshkale447 merged commit a20e96e into Releases/Official-Release Oct 3, 2025
14 of 16 checks passed
@Maheshkale447
Maheshkale447 deleted the Feature/SendExecutionLogToCentralReport branch October 3, 2025 17:17
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