Skip to content

Fix metadata updater JSON handling#24155

Merged
davsclaus merged 1 commit into
apache:mainfrom
fallintoplace:fix-metadata-updater-json
Jun 22, 2026
Merged

Fix metadata updater JSON handling#24155
davsclaus merged 1 commit into
apache:mainfrom
fallintoplace:fix-metadata-updater-json

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • Use Python JSON serialization when formatting metadata keys, string values, and array items.
  • Exit with an error when a requested metadata file has no matching target to update.

Root cause

The metadata updater manually wrapped strings in quotes while preserving the generated Jackson-like layout. That could emit invalid JSON when existing metadata values or new service versions contained characters that need escaping. The script also ignored update results, so a missing match could leave generated metadata stale while the workflow continued.

Validation

  • python3 -m py_compile .github/actions/check-container-upgrade/update-metadata-version.py
  • git diff --check
  • Ran temp-file checks covering quoted/backslash/newline values, successful updates across both metadata files, and the no-match failure path.

Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@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.

@davsclaus davsclaus 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.

Clean fix — replacing manual string formatting with json.dumps() properly handles escaping for special characters, and the no-match error exit is the right behavior for a CI script. LGTM.

Minor note: commit title doesn't follow the CAMEL-XXXX: convention, but this is a CI infrastructure fix so it's not a blocker.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

@davsclaus davsclaus merged commit 2201b63 into apache:main Jun 22, 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.

3 participants