Skip to content

Fix copy-paste error in camel-dhis2 Dhis2ResourceTables (found by OpenScanHub SAST)#23173

Merged
davsclaus merged 1 commit into
apache:mainfrom
tedwon:fix/dhis2-copy-paste-error
May 13, 2026
Merged

Fix copy-paste error in camel-dhis2 Dhis2ResourceTables (found by OpenScanHub SAST)#23173
davsclaus merged 1 commit into
apache:mainfrom
tedwon:fix/dhis2-copy-paste-error

Conversation

@tedwon
Copy link
Copy Markdown
Contributor

@tedwon tedwon commented May 13, 2026

What

Fix a copy-paste error in Dhis2ResourceTables.analytics() where skipEvents != null was used instead of skipAggregate != null when deciding whether to set the skipAggregate query parameter.

Why

The skipAggregate parameter is only sent to the DHIS2 API when skipEvents is non-null, regardless of whether skipAggregate was actually set. This means:

  • If skipEvents is null but skipAggregate is set, the skipAggregate parameter is silently dropped
  • If skipEvents is non-null but skipAggregate is null, the parameter is sent with a null value

Fix

Change the condition on line 38 from skipEvents != null to skipAggregate != null.

Found via static analysis (Coverity COPY_PASTE_ERROR checker).

Dhis2ResourceTables.analytics() checked skipEvents != null instead of
skipAggregate != null when setting the skipAggregate parameter, causing
it to be sent based on the wrong variable.
@tedwon tedwon changed the title Fix copy-paste error in camel-dhis2 Dhis2ResourceTables Fix copy-paste error in camel-dhis2 Dhis2ResourceTables (found by OpenScanHub SAST) May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-dhis2/camel-dhis2-api
All tested modules (9 modules)
  • Camel :: DHIS2
  • Camel :: DHIS2 API
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@davsclaus davsclaus merged commit a4b81ba into apache:main May 13, 2026
6 checks passed
davsclaus pushed a commit that referenced this pull request May 13, 2026
Dhis2ResourceTables.analytics() checked skipEvents != null instead of
skipAggregate != null when setting the skipAggregate parameter, causing
it to be sent based on the wrong variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants