Skip to content

fix(ApplicationLogs): reject invalid getapplicationlog triggerType - #1108

Merged
shargon merged 4 commits into
neo-project:master-n3from
cschuchardt88:fix/applog-invalid-trigger
Sep 8, 2026
Merged

fix(ApplicationLogs): reject invalid getapplicationlog triggerType#1108
shargon merged 4 commits into
neo-project:master-n3from
cschuchardt88:fix/applog-invalid-trigger

Conversation

@cschuchardt88

Copy link
Copy Markdown
Member

Docs say an invalid trigger throws. Enum.TryParse failing skipped the filter, so callers got unfiltered executions. Numeric strings such as 16 also parsed as undefined enum values.

Require a named TriggerType or return InvalidParams.

Independent of other PRs.

Docs say an invalid trigger throws. Enum.TryParse failing skipped the filter, so callers got unfiltered executions. Numeric strings such as 16 also parsed as undefined enum values.
@github-actions github-actions Bot added the N3 label Aug 29, 2026
@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 51.42%. Comparing base (e56bcce) to head (74cdc5d).

Files with missing lines Patch % Lines
plugins/ApplicationLogs/LogReader.cs 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           master-n3    #1108      +/-   ##
=============================================
- Coverage      51.48%   51.42%   -0.07%     
=============================================
  Files            284      284              
  Lines          16699    16703       +4     
  Branches        2148     2149       +1     
=============================================
- Hits            8598     8590       -8     
- Misses          7527     7541      +14     
+ Partials         574      572       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

if (!string.IsNullOrEmpty(triggerType))
{
if (!Enum.TryParse(triggerType, true, out TriggerType trigger)
|| !Enum.GetNames<TriggerType>().Any(n => n.Equals(triggerType, StringComparison.OrdinalIgnoreCase)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't TryParse enough?

@superboyiii superboyiii Sep 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems not enough. .NET’s Enum.TryParse accepts numeric strings as well as names. So values like "16" (undefined) or "64" (Application =0x40) both succeed, even though they aren’t named TriggerType values.

@superboyiii superboyiii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested. It works.

@shargon
shargon merged commit d7f3ef1 into neo-project:master-n3 Sep 8, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants