Skip to content

[Automated] Sync master after 2201.13.6 release - #6415

Open
ballerina-cicd-bot wants to merge 179 commits into
masterfrom
release-2201.13.6-Alpha2
Open

[Automated] Sync master after 2201.13.6 release#6415
ballerina-cicd-bot wants to merge 179 commits into
masterfrom
release-2201.13.6-Alpha2

Conversation

@ballerina-cicd-bot

@ballerina-cicd-bot ballerina-cicd-bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
  • Updated release metadata, dependency versions, license inventory, and publishing workflow settings for the new snapshot.
  • Added logging configuration examples for file output and time- or size-based rotation.
  • Updated XML examples to use ballerina/data.xmldata and current conversion APIs.
  • Added the library package integration test and expanded example metadata with Central dependency requirements.
  • Updated custom logger and MCP service APIs to support configurable log levels and optional sessions.
  • Refreshed documentation, build behavior, sample configuration, and dependency tracking.

keizer619 and others added 30 commits November 7, 2025 11:46
[Automated] Sync master after 2201.13.0 release
[Automated] Sync master after 2201.13.1 release
Include sticky and offline flags for bbe tests
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Thevakumar-Luheerathan and others added 21 commits July 27, 2026 09:34
Bump the http, tcp version for 2201.13.5 release
[2201.13.x] Update the ftp version to 2.20.1
Update stdlibEdiVersion and stdlibFtpVersion
[Automated] Sync master after 2201.13.5 release
…ities-2201.13.x

Add trivy ignore entries for jackson and netty CVEs
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
13 out of 14 committers have signed the CLA.

✅ keizer619
✅ niveathika
✅ RadCod3
✅ ThisaruGuruge
✅ ballerina-cicd-bot
✅ VellummyilumVinoth
✅ MohamedSabthar
✅ Thevakumar-Luheerathan
✅ TharmiganK
✅ NipunaRanasinghe
✅ NipunaMadhushan
✅ chiranSachintha
✅ Nuvindu
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request updates release metadata, dependency and license records, offline build behavior, integration coverage, logging examples, XML and MCP examples, and example documentation.

Changes

Distribution update

Layer / File(s) Summary
Release and dependency metadata
.github/workflows/publish-release.yml, .trivyignore, gradle.properties, ballerina/LICENSE, build.gradle, ballerina-test-automation/gradle.properties
Release values, vulnerability entries, dependency versions, license inventories, and standard-library dependencies are updated.
Offline builds and integration coverage
ballerina/build.gradle, examples/index.json, stdlib-integration-tests/*
Examples use offline sticky builds when applicable. Standard-library setup checks for existing manifests. A library-package integration test is added.
Logging configuration examples
examples/custom-logger/*, examples/http-access-logs/*, examples/http-trace-logs/*, examples/log-file-rotation/*, examples/logger-from-config/*, examples/logging-configuration/*
Logging examples add configurable levels, file destinations, and size- or time-based rotation settings with related documentation.
Data and service example updates
examples/xml-*/, examples/mcp-service-advanced/*
XML examples use data.xmldata and typed parsing. The advanced MCP service accepts an optional session.
Example documentation alignment
examples/azure-functions-cosmosdb-trigger/*, examples/natural-expressions/*, examples/string-templates/*
Example instructions, supported-version text, and source/output references are updated.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: keizer619, gimantha, niveathika

Poem

A rabbit checks the logs at night,
Rotating files by time and size.
New versions hop through build scripts,
XML finds typed records in disguise.
Tests join the trail with Central out of sight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description and does not provide any required template sections or testing and release information. Add a description that completes the required template sections, including purpose, approach, testing, security checks, documentation, and migration details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies an automated master-branch synchronization after the 2201.13.6 release, which matches the primary changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch release-2201.13.6-Alpha2
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release-2201.13.6-Alpha2

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.

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@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: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/publish-release.yml:
- Around line 118-121: Update the workflow action versions at
.github/workflows/publish-release.yml lines 118-121 and 704-706: replace
actions/setup-node@v2 and actions/setup-dotnet@v1 with supported releases,
respectively, while preserving their existing configuration and workflow
behavior.

In @.trivyignore:
- Around line 8-22: Upgrade the bundled Jackson dependencies referenced by
ballerina/LICENSE to at least 2.18.8/2.21.4 and Netty native transport
dependencies to at least 4.1.135.Final/4.2.15.Final, then remove the
corresponding CVE and GHSA entries from .trivyignore so the release scan reports
no suppressed unresolved vulnerabilities.

In `@ballerina/build.gradle`:
- Around line 964-966: Update the Windows command construction around the
needCentral condition to store --sticky and --offline as separate option
elements, rather than appending them to one argument string. Pass the options
list when invoking bal.bat, and only join the complete command for the shell
execution.

In `@ballerina/LICENSE`:
- Around line 167-225: Regenerate the bundled license inventory in
ballerina/LICENSE from the current generated release artifacts rather than
manually retaining stale JAR entries. Update all listed dependency versions,
including ballerina-time, ballerina-data.xmldata, ballerina-log,
ballerina-crypto, and any other resolved artifacts, so the shipped license
notice exactly matches the distribution.

In `@examples/custom-logger/custom_logger.bal`:
- Around line 64-69: Update withContext so the contextual logger retains the
parent logger’s dynamic level binding instead of copying self.level, and ensure
child setLevel returns the log API’s unsupported-operation error. Add a test
that creates a child, changes the parent level afterward, and verifies the child
reflects the updated level.
- Around line 10-18: Update the logger print methods to honor the configured
level through the existing level accessor or comparison semantics: add ordering
checks in printInfo, printWarn, printError, and printDebug, and delegate to the
corresponding log functions only when enabled. Ensure all four levels emit
appropriately while disabled levels produce no output, preserving the log:Logger
contract for getLevel/setLevel.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 81c76bd6-869f-48eb-bd18-aeab926df9c8

📥 Commits

Reviewing files that changed from the base of the PR and between 2b0432a and 6e33574.

⛔ Files ignored due to path filters (8)
  • examples/log-file-rotation/app_log_rotation.out is excluded by !**/*.out
  • examples/log-file-rotation/log_file_rotation.out is excluded by !**/*.out
  • examples/logger-from-config/audit_logs.out is excluded by !**/*.out
  • examples/logger-from-config/logger_from_config.out is excluded by !**/*.out
  • examples/logger-from-config/metrics_logs.out is excluded by !**/*.out
  • examples/xml-from-json-conversion/xml_from_json_conversion.out is excluded by !**/*.out
  • examples/xml-to-json-conversion/xml_to_json_conversion.out is excluded by !**/*.out
  • examples/xml-to-record-conversion/xml_to_record_conversion.out is excluded by !**/*.out
📒 Files selected for processing (36)
  • .github/workflows/publish-release.yml
  • .trivyignore
  • ballerina-test-automation/gradle.properties
  • ballerina/LICENSE
  • ballerina/build.gradle
  • build.gradle
  • examples/azure-functions-cosmosdb-trigger/azure_functions_cosmosdb_trigger.md
  • examples/custom-logger/custom_logger.bal
  • examples/http-access-logs/Config.toml
  • examples/http-access-logs/http_access_logs.md
  • examples/http-trace-logs/Config.toml
  • examples/http-trace-logs/http_trace_logs.md
  • examples/index.json
  • examples/log-file-rotation/Config.toml
  • examples/log-file-rotation/log_file_rotation.bal
  • examples/log-file-rotation/log_file_rotation.md
  • examples/log-file-rotation/log_file_rotation.metatags
  • examples/logger-from-config/logger_from_config.bal
  • examples/logger-from-config/logger_from_config.md
  • examples/logging-configuration/Config.toml
  • examples/logging-configuration/logging_configuration.md
  • examples/mcp-service-advanced/mcp_service_advanced.bal
  • examples/natural-expressions/natural_expressions.md
  • examples/string-templates/string_templates.md
  • examples/xml-from-json-conversion/xml_from_json_conversion.bal
  • examples/xml-from-json-conversion/xml_from_json_conversion.md
  • examples/xml-from-record-conversion/xml_from_record_conversion.bal
  • examples/xml-from-record-conversion/xml_from_record_conversion.md
  • examples/xml-to-json-conversion/xml_to_json_conversion.bal
  • examples/xml-to-json-conversion/xml_to_json_conversion.md
  • examples/xml-to-record-conversion/xml_to_record_conversion.bal
  • examples/xml-to-record-conversion/xml_to_record_conversion.md
  • gradle.properties
  • stdlib-integration-tests/index.json
  • stdlib-integration-tests/library_package_test/Ballerina.toml
  • stdlib-integration-tests/library_package_test/main.bal

Comment on lines 118 to +121
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: "14"

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow snippets =="
sed -n '90,135p' .github/workflows/publish-release.yml || true
sed -n '690,715p' .github/workflows/publish-release.yml || true

echo "== actionlint availability =="
if command -v actionlint >/dev/null 2>&1; then
  actionlint --version || true
  actionlint .github/workflows/publish-release.yml 2>&1 || true
else
  echo "actionlint not installed"
fi

echo "== npm/actionlint availability =="
if command -v npm >/dev/null 2>&1; then
  npx --no-install actionlint --version 2>&1 || true
else
  echo "npm not available"
fi

echo "== check pinned action refs vs upstream tags =="
python3 - <<'PY'
from urllib.request import urlopen
import json
import re
repo_map = {
    ("actions","setup-node"): "https://api.github.com/repos/actions/setup-node/git/refs/tags/v2",
    ("actions","setup-dotnet"): "https://api.github.com/repos/actions/setup-dotnet/git/refs/tags/v1",
}
tags = ["v2", "v1"]
for (owner, repo), url in repo_map.items():
    print(f"## {owner}/{repo}")
    data = None
    try:
        req = urlopen(url, timeout=10)
        data = json.load(req)
    except Exception as e:
        print("GET", url, type(e).__name__, s := getattr(e, "code", None))
    if data:
        print("ref:", data.get("ref"))
        obj = data.get("object", {})
        print("object_type:", obj.get("type"))
        if obj.get("type") == "tag":
            tag_obj = json.load(urlopen(obj["url"], timeout=10))
            print("dereferenced_commit:", tag_obj.get("object", {}).get("sha"))
        else:
            print("commit:", obj.get("sha"))
        # current branch HEAD for context
        ref_json = json.load(urlopen(f"https://api.github.com/repos/{owner}/{repo}/git/refs/heads/main", timeout=10))
        print("main_sha:", ref_json.get("object", {}).get("sha"))
PY

Repository: ballerina-platform/ballerina-distribution

Length of output: 6952


🌐 Web query:

GitHub Actions actions/setup-node v2 support deprecated GitHub Actions v2 Node 16 removed

💡 Result:

The actions/setup-node v2 action is effectively deprecated, and relying on it in modern workflows is strongly discouraged due to its outdated underlying runtime [1][2][3]. Key details regarding this deprecation: 1. Outdated Runtime: The actions/setup-node v2 action was built using an older Node.js runtime (Node 16) [4]. Node 16 itself has reached end-of-life (EOL), and GitHub has mandated that GitHub Actions must transition to newer, supported Node.js versions (e.g., Node 20 and Node 24) for the action runners themselves [5][3]. 2. Upgrade Recommendation: You should update your workflows to use the latest major version of the action (currently v7) [2][6][7]. Newer versions of actions/setup-node have been updated to support modern Node.js environments and include critical improvements, such as updated runtime support (e.g., Node 24) [1][2][7]. 3. Why "Node 16 Removed" Matters: When GitHub performs environment upgrades on hosted runners, workflows using actions/setup-node v2 may trigger warnings, fail, or experience compatibility issues because the action's internal implementation depends on a runtime version that is no longer recommended or supported by GitHub's infrastructure [8][3]. To resolve any issues, update your workflow files from: - uses: actions/setup-node@v2 To: - uses: actions/setup-node@v7 [6][7] Check the official actions/setup-node repository releases for any specific breaking changes you might need to address when upgrading from v2 to v7 [1][2].

Citations:


🌐 Web query:

GitHub Actions actions/setup-dotnet v1 support deprecated GitHub Actions v1 Node 16 removed

💡 Result:

The actions/setup-dotnet v1 action is long deprecated and incompatible with modern GitHub Actions environments, which have moved past Node 16 [1][2][3]. Key details regarding this deprecation: 1. Node 16 Removal: GitHub Actions removed support for Node 16 on November 12, 2024 [2]. All GitHub-hosted runners now require actions to run on newer Node.js versions (specifically Node 20, with a transition to Node 24 occurring throughout 2026) [2][4]. Any action attempting to run on Node 16 will fail [2][3]. 2. Actions/setup-dotnet Evolution: - Version v1 is obsolete and no longer supported [5][6]. - As of August 2026, the current major version is v6 [6]. - You should migrate immediately to the latest version (v6 or higher) to ensure compatibility with current runner images and modern Node.js requirements [7][6]. 3. Recommended Action: Update your workflow YAML files to replace actions/setup-dotnet@v1 with the latest version, such as: - uses: actions/setup-dotnet@v6 Using the latest version also provides access to newer features, such as the ability to specify dotnet-version: latest for automatic SDK resolution [8][9]. For further details on the transition from older Node versions, see the official GitHub Actions changelog regarding Node 16 [2] and Node 20 [4] deprecations.

Citations:


Update the unsupported setup actions.

actionlint reports that these pinned actions cannot run on current GitHub Actions runners because the action runtimes are deprecated. Update each action to a supported release before using this workflow for publishing.

  • .github/workflows/publish-release.yml#L118-L121: Replace actions/setup-node@v2 with a supported version.
  • .github/workflows/publish-release.yml#L704-L706: Replace actions/setup-dotnet@v1 with a supported version.
🧰 Tools
🪛 actionlint (1.7.12)

[error] 119-119: the runner of "actions/setup-node@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

📍 Affects 1 file
  • .github/workflows/publish-release.yml#L118-L121 (this comment)
  • .github/workflows/publish-release.yml#L704-L706
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish-release.yml around lines 118 - 121, Update the
workflow action versions at .github/workflows/publish-release.yml lines 118-121
and 704-706: replace actions/setup-node@v2 and actions/setup-dotnet@v1 with
supported releases, respectively, while preserving their existing configuration
and workflow behavior.

Source: Linters/SAST tools

Comment thread .trivyignore
Comment on lines +8 to +22
CVE-2026-56740
CVE-2026-56741

# jackson-core / jackson-databind - needs dependency upgrade to 2.18.8+/2.21.4+
GHSA-r7wm-3cxj-wff9
CVE-2026-54512
CVE-2026-54513
CVE-2026-54514
CVE-2026-54515
CVE-2026-59888
CVE-2026-59889
GHSA-mhm7-754m-9p8w

# netty-transport-native-epoll / netty-transport-native-kqueue - needs dependency upgrade to 4.1.135.Final/4.2.15.Final+
CVE-2026-45536

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not suppress unresolved vulnerabilities.

Lines 8-22 classify these findings as needing a fix, but .trivyignore suppresses them during the release scan. The bundled Jackson and Netty versions in ballerina/LICENSE are below the stated fixed versions. Upgrade the dependencies and remove these suppressions before release.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.trivyignore around lines 8 - 22, Upgrade the bundled Jackson dependencies
referenced by ballerina/LICENSE to at least 2.18.8/2.21.4 and Netty native
transport dependencies to at least 4.1.135.Final/4.2.15.Final, then remove the
corresponding CVE and GHSA entries from .trivyignore so the release scan reports
no suppressed unresolved vulnerabilities.

Comment thread ballerina/build.gradle
Comment on lines +964 to +966
if (!bbe.needCentral) {
additionalParams += " --sticky --offline"
}

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the relevant Gradle section and nearby Windows/Unix command construction.
fd -a 'build.gradle' . | sed 's#^\./##' | head -20
echo '--- ballerina/build.gradle lines 920-990 ---'
sed -n '920,990p' ballerina/build.gradle | nl -ba -v920

echo '--- search for additionalParams usage ---'
rg -n "additionalParams|balancedArgs|commandLine|workDir|BalBean|task|doLast" ballerina/build.gradle

Repository: ballerina-platform/ballerina-distribution

Length of output: 1123


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- ballerina/build.gradle lines 930-985 ---'
sed -n '930,985p' ballerina/build.gradle | cat -n

echo '--- search for addAdditionalParams/additionalParams/commandLine/workDir ---'
rg -n "addAdditionalParams|additionalParams|commandLine|workDir|Bal|BalBean|winPath|win|Windows" ballerina/build.gradle

echo '--- outline for relevant subprojects/tasks if available ---'
wc -l ballerina/build.gradle
sed -n '880,930p' ballerina/build.gradle | cat -n

Repository: ballerina-platform/ballerina-distribution

Length of output: 12957


🌐 Web query:

Gradle ExecSpec commandLine multiple arguments no shell

💡 Result:

Gradle's ExecSpec does not use a shell to execute processes [1]. It invokes the specified executable directly, ensuring that multiple arguments are passed as discrete elements to the process, which avoids common shell-injection and quoting issues [2][3][4]. To provide multiple arguments without a shell, use the following approaches: 1. Using commandLine with multiple arguments: The commandLine method accepts an iterable or a varargs list where the first element is the executable and the subsequent elements are the arguments [2][4]. task runCommand(type: Exec) { // The executable is the first element, followed by individual arguments commandLine 'my-executable', '--arg1', 'value1', '--arg2', 'value2' } 2. Separating the executable and arguments: You can explicitly set the executable and use the args method to append arguments [2][5]. task runCommand(type: Exec) { executable 'my-executable' args '--arg1', 'value1', '--arg2', 'value2' } Because Gradle does not use a shell, you do not need to wrap arguments in quotes to handle spaces or special characters in the same way you would in a shell script [1]. Each argument passed to commandLine or args is treated as a distinct command-line parameter for the underlying process [2][3]. If you specifically need shell features (like pipes or wildcards), you must invoke the shell explicitly as the executable, passing your command string as its arguments (e.g., commandLine 'sh', '-c', 'my-command | grep pattern') [5][1].

Citations:


Pass --sticky and --offline as separate Windows arguments.

The Windows path builds one string and passes it as a single cmd /c argument, so bal.bat receives --sticky --offline as one option. Use a list of options for Windows and keep joining only the shell command.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ballerina/build.gradle` around lines 964 - 966, Update the Windows command
construction around the needCentral condition to store --sticky and --offline as
separate option elements, rather than appending them to one argument string.
Pass the options list when invoking bal.bat, and only join the complete command
for the shell execution.

Comment thread ballerina/LICENSE
Comment on lines +167 to +225
ballerina-time-2.8.0.jar jar apache2
ballerina-ftp-2.15.1.jar jar apache2
ballerina-ai.intelligence-1.7.0.jar jar apache2
ballerina-ai.observe-1.7.0.jar jar apache2
ballerina-ai-1.7.0.jar jar apache2
ballerina-lang.future-0.0.0.jar jar apache2
ballerina-io-1.8.0.jar jar apache2
ballerina-lang.boolean-0.0.0.jar jar apache2
ballerina-lang.decimal-0.0.0.jar jar apache2
ballerina-avro-1.2.0.jar jar apache2
ballerina-lang.function-0.0.0.jar jar apache2
ballerina-auth-2.14.0.jar jar apache2
ballerina-tcp-1.13.0.jar jar apache2
ballerina-tcp-1.13.2.jar jar apache2
ballerina-lang.array-0.0.0.jar jar apache2
ballerina-lang.string-0.0.0.jar jar apache2
ballerina-data.jsondata-1.1.0.jar jar apache2
ballerina-data.jsondata-1.1.3.jar jar apache2
ballerina-lang.object-0.0.0.jar jar apache2
ballerina-lang.transaction-0.0.0.jar jar apache2
ballerina-random-1.7.0.jar jar apache2
ballerina-lang.typedesc-0.0.0.jar jar apache2
ballerina-websocket-2.14.0.jar jar apache2
ballerina-websocket-2.15.0.jar jar apache2
ballerina-jballerina.java-0.0.0.jar jar apache2
ballerina-observe-1.5.0.jar jar apache2
ballerina-observe.mockextension-1.5.0.jar jar apache2
ballerina-observe-1.6.0.jar jar apache2
ballerina-observe.mockextension-1.6.0.jar jar apache2
ballerina-uuid-1.10.0.jar jar apache2
ballerina-email-2.12.0.jar jar apache2
ballerina-task-2.7.0.jar jar apache2
ballerina-edi-1.5.0.jar jar apache2
ballerina-email-2.13.0.jar jar apache2
ballerina-task-2.11.0.jar jar apache2
ballerina-edi-1.5.3.jar jar apache2
ballerina-lang.query-0.0.0.jar jar apache2
ballerina-cloud-3.3.0.jar jar apache2
ballerina-url-2.6.0.jar jar apache2
ballerina-cloud-4.0.0.jar jar apache2
ballerina-url-2.6.1.jar jar apache2
ballerina-lang.stream-0.0.0.jar jar apache2
ballerina-cache-3.10.0.jar jar apache2
ballerina-sql-1.16.0.jar jar apache2
ballerina-sql-1.17.1.jar jar apache2
ballerina-lang.int-0.0.0.jar jar apache2
ballerina-xslt-2.9.0.jar jar apache2
ballerina-xslt-2.9.1.jar jar apache2
ballerina-lang.error-0.0.0.jar jar apache2
ballerina-lang.float-0.0.0.jar jar apache2
ballerina-lang.value-0.0.0.jar jar apache2
ballerina-data.csv-0.8.0.jar jar apache2
ballerina-data.csv-0.8.1.jar jar apache2
ballerina-persist-1.6.0.jar jar apache2
ballerina-math.vector-1.2.0.jar jar apache2
ballerina-lang.runtime-0.0.0.jar jar apache2
ballerina-websubhub-1.15.0.jar jar apache2
ballerina-data.xmldata-1.3.0.jar jar apache2
ballerina-data.xmldata-1.5.2.jar jar apache2
ballerina-protobuf.types.any-1.8.0.jar jar apache2
ballerina-protobuf-1.8.0.jar jar apache2
ballerina-protobuf.types.duration-1.8.0.jar jar apache2
ballerina-protobuf.types.timestamp-1.8.0.jar jar apache2
ballerina-protobuf.types.wrappers-1.8.0.jar jar apache2
ballerina-protobuf.types.empty-1.8.0.jar jar apache2
ballerina-protobuf.types.struct-1.8.0.jar jar apache2
ballerina-log-2.12.0.jar jar apache2
ballerina-jwt-2.15.0.jar jar apache2
ballerina-oauth2-2.14.0.jar jar apache2
ballerina-log-2.14.0.jar jar apache2
ballerina-ai.np-0.5.1.jar jar apache2
ballerina-jwt-2.15.1.jar jar apache2
ballerina-mcp-1.0.0.jar jar apache2
ballerina-oauth2-2.15.0.jar jar apache2
ballerina-mime-2.12.0.jar jar apache2
ballerina-crypto-2.9.0.jar jar apache2
ballerina-crypto-2.9.2.jar jar apache2

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.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n 'stdlib(Time|DataXmldata|Log|Crypto)Version' gradle.properties
rg -n 'ballerina-(time|data\.xmldata|log|crypto)-' ballerina/LICENSE

Repository: ballerina-platform/ballerina-distribution

Length of output: 857


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== gradle.properties relevant pins =="
sed -n '1,80p' gradle.properties

echo
echo "== ballerina/LICENSE header/context =="
sed -n '1,240p' ballerina/LICENSE

echo
echo "== build scripts referencing standard library artifacts =="
rg -n 'stdlib(Time|DataXmldata|Log|Crypto)Version|ballerina-(time|data\.xmldata|log|crypto)-|Ballerina|License|license|BUNDLED' -g '*.gradle' -g '*.gradle.kts' -g '*.properties' .

Repository: ballerina-platform/ballerina-distribution

Length of output: 49549


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '== LICENSE vs gradle.properties relevant version pins ==\n'
python3 - <<'PY'
from pathlib import Path
import re

props = {}
for line in Path('gradle.properties').read_text().splitlines():
    m = re.match(r'([A-Za-z0-9_]+)Version=(.+)', line)
    if m:
        props[m.group(1)] = m.group(2)

license_text = Path('ballerina/LICENSE').read_text()

for var in ['Time', 'DataXmldata', 'Log', 'Crypto']:
    prop = props.get(f'stdlib{var}Version')
    jars = re.findall(rf'ballerina-\\b{var}\\b.?[^\\s]+', license_text)
    print(f'{var}: gradle.properties {prop}; in ballerina/LICENSE: {jars}' if jars else f'{var}: gradle.properties {prop}; in ballerina/LICENSE: none')
PY

printf '\n== build.gradle stdlib declarations around referenced constants ==\n'
sed -n '120,175p' build.gradle
sed -n '1420,1485p' build.gradle
sed -n '1980,2035p' build.gradle

Repository: ballerina-platform/ballerina-distribution

Length of output: 3911


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n 'License|Bundled License|license|GENERATE|generate.*license|jar-file|Jars|JarFile|copyJar|bndJar' build.gradle
rg -n 'License|Bundled License|license|GENERATE|generate.*license|jar-file|Jars|JarFile|copyJar|bndJar' ballerina/build.gradle gradle -g '*.gradle' -g '*.gradle.kts'

Repository: ballerina-platform/ballerina-distribution

Length of output: 1983


Regenerate the bundled-license inventory.

ballerina/LICENSE lists older versions for several generated standard-library JARs, while the build resolves newer versions, for example time 2.8.0 vs 2.8.1, xmldata 1.5.2 vs 1.6.3, log 2.14.0 vs 2.17.0, and crypto 2.9.2 vs 2.12.1. Use the generated release artifacts for this inventory so the shipped license notice matches the distribution.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ballerina/LICENSE` around lines 167 - 225, Regenerate the bundled license
inventory in ballerina/LICENSE from the current generated release artifacts
rather than manually retaining stale JAR entries. Update all listed dependency
versions, including ballerina-time, ballerina-data.xmldata, ballerina-log,
ballerina-crypto, and any other resolved artifacts, so the shipped license
notice exactly matches the distribution.

Comment on lines +10 to +18
private log:Level level;

public isolated function init(string applicationName, string version, log:KeyValues context = {}) {
public isolated function init(string applicationName, string version, log:KeyValues context = {},
log:Level level = log:INFO) {
self.applicationName = applicationName;
self.version = version;
self.context = context.cloneReadOnly();
self.level = level;
}

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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
git ls-files | grep -F 'examples/custom-logger/custom_logger.bal' || true

echo "== file excerpt =="
if [ -f examples/custom-logger/custom_logger.bal ]; then
  nl -ba examples/custom-logger/custom_logger.bal | sed -n '1,120p'
fi

echo "== search for logger level APIs in repo examples =="
rg -n "setLevel|getLevel|printInfo|printDebug|printWarn|printError|log:Logger" examples -S || true

echo "== try Ballerina tooling availability =="
command -v bal || true
if command -v bal >/dev/null 2>&1; then
  bal --version 2>&1 | head
fi

Repository: ballerina-platform/ballerina-distribution

Length of output: 297


🏁 Script executed:

#!/bin/bash
set -u

echo "== file excerpt =="
if [ -f examples/custom-logger/custom_logger.bal ]; then
  awk '{ printf "%6d\t%s\n", NR, $0 }' examples/custom-logger/custom_logger.bal | sed -n '1,140p'
fi

echo "== search for logger level APIs in repo examples =="
grep -RInE "setLevel|getLevel|printInfo|printDebug|printWarn|printError|log:Logger" examples 2>/dev/null || true

echo "== Ballerina tooling availability =="
command -v bal || true
if command -v bal >/dev/null 2>&1; then
  bal --version 2>&1 | head -n 5
fi

Repository: ballerina-platform/ballerina-distribution

Length of output: 29636


🌐 Web query:

Ballerina log module Logger printDebug printWarn printError printInfo setLevel Level semantics

💡 Result:

The Ballerina log module provides a structured way to log application information with configurable levels and formats [1][2]. Log Levels and Semantics The module supports four primary log levels, ordered by priority (from highest to lowest): 1. ERROR: Indicates significant issues requiring immediate attention [1][3]. 2. WARN: Indicates potential issues or unexpected events that are not critical errors [1][3]. 3. INFO: Indicates general operational messages (default level) [1][3]. 4. DEBUG: Indicates detailed information typically useful for diagnosing issues [1][3]. By default, the system logs messages at the INFO level and higher (i.e., INFO, WARN, and ERROR) [1][2]. Logging API Functions The module provides the following functions to log messages at their respective levels: - log:printError(string msg, error? 'error =, *log:KeyValues keyValues): Logs an error, optionally including error details and contextual key-value pairs [1][4]. - log:printWarn(string msg, *log:KeyValues keyValues): Logs a warning message [2][4]. - log:printInfo(string msg, *log:KeyValues keyValues): Logs an informational message [2][4]. - log:printDebug(string msg, *log:KeyValues keyValues): Logs a debug message [2][4]. Configuration Log levels are configured in the Config.toml file [1][2]. You can set the global log level or define specific levels for individual modules [1][4]. Example Config.toml configuration: [ballerina.log] level = "DEBUG" # Or per-module [[ballerina.log.modules]] name = "my_org/my_module" level = "WARN" The log module also supports contextual logging, runtime log level modifications, log rotation, and sensitive data masking [1][2][3]. Logs are written to stderr by default in logfmt format, but this can be modified via configuration to support different destinations and JSON formatting [1][2][4].

Citations:


Make level gate logger output.

level is stored and inherited, but the print methods do not read it. printInfo still calls log:printInfo, and the other levels do not emit. If getLevel()/setLevel() should follow the log:Logger contract, add ordering checks in printInfo, printWarn, printError, and printDebug, and delegate only the enabled levels.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/custom-logger/custom_logger.bal` around lines 10 - 18, Update the
logger print methods to honor the configured level through the existing level
accessor or comparison semantics: add ordering checks in printInfo, printWarn,
printError, and printDebug, and delegate to the corresponding log functions only
when enabled. Ensure all four levels emit appropriately while disabled levels
produce no output, preserving the log:Logger contract for getLevel/setLevel.

Source: MCP tools

Comment on lines +64 to +69
log:Level parentLevel;
lock {
// Child loggers inherit the level from the parent logger
parentLevel = self.level;
}
return new ApplicationLogger(self.applicationName, self.version, newContext, parentLevel);

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Locate relevant files"
fd -a 'custom_logger.bal|Logger|ApplicationLogger|setLevel|withContext' . | sed 's#^\./##'

echo
echo "File outline/contents for custom_logger.bal"
wc -l examples/custom-logger/custom_logger.bal
cat -n examples/custom-logger/custom_logger.bal

Repository: ballerina-platform/ballerina-distribution

Length of output: 4321


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Search for logger-related usages/tests"
rg -n "withContext|setLevel|Level|ApplicationLogger|parent|contextual|custom-logger" . || true

echo
echo "Check Ballerina log spec references in repo"
rg -n "log:Level|applicationLogger|withContext|setLevel|Logger" -g '*.md' -g '*.bal' -g '*.toml' . || true

Repository: ballerina-platform/ballerina-distribution

Length of output: 27271


🌐 Web query:

Ballerina log logger withContext setLevel contextual logger getLevel

💡 Result:

In the Ballerina log module, you can manage log levels and contextual logging using the Logger object [1][2]. Contextual Logging and withContext The withContext method is used to create a new, derived Logger instance that includes additional key-value pairs in its context [1][2]. - Child loggers created via withContext do not have their own independent log levels [1][2]. - Instead, they always inherit the effective log level from their parent logger [1][2]. Log Level Management (getLevel and setLevel) The Logger object provides methods to manage log levels at runtime [1][2]: - getLevel(): Returns the effective log:Level of the logger [1][2]. For root or loggers created via fromConfig, this is their explicitly set level [1][2]. For child loggers (created via withContext), this method returns the level inherited from the parent [1][2]. - setLevel(log:Level level): Updates the log level of the logger at runtime [1][2]. - This operation is supported for root loggers and loggers created via fromConfig [1][2]. - Attempting to call setLevel on a child logger (created via withContext) will return an error, as these loggers must always inherit the parent's level [1][2]. To change the effective level of a child logger, you must change the level of the parent logger from which it was derived [1][2]. Loggers created via fromConfig can also be registered and discovered via the logger registry for runtime updates [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Check for tests around custom_logger example"
fd -a 'custom_logger|custom-log|custom_logger' . | sed 's#^\./##'

echo
echo "Search for appLogger.orderLogger pattern or setLevel test in Ballerina core/source tests"
rg -n "appLogger|orderLogger|ApplicationLogger|setLevel\\(|withContext\\(" -g '*test*' -g '*.bal' -g '*.java' . | head -n200

Repository: ballerina-platform/ballerina-distribution

Length of output: 2271


🌐 Web query:

bal langspec Logger withContext getLevel setLevel contextual logger spec

💡 Result:

In the Ballerina language log library, contextual and configurable logging is managed through the log:Logger object [1][2]. Key aspects of the requested API components include: withContext The withContext function is used to create a new child or derived logger that includes additional key-value pairs in its context [1][3]. Signature: public isolated function withContext(*KeyValues keyValues) returns Logger|error; [1] Behavior: Child loggers created via withContext do not have their own independent log level configuration; instead, they always inherit the effective log level from their parent logger [1][2]. getLevel The getLevel function retrieves the effective log level of the logger [1]. Signature: public isolated function getLevel() returns Level; [1] Behavior: For the root logger or custom loggers created via fromConfig, it returns the explicitly set level [1][2]. For child loggers, it delegates to the parent logger's getLevel() [1]. If the parent logger's level changes, the child logger's effective level changes automatically [1]. setLevel The setLevel function allows for modifying the log level of a logger at runtime [1][2]. Signature: public isolated function setLevel(Level level) returns error?; [1] Behavior: This operation is supported on the root logger and custom loggers registered in the logger registry (those created via fromConfig) [1][2]. It is not supported on child loggers (created via withContext), and calling setLevel on a child logger will return an error, as these loggers are designed to strictly inherit from their parent [1][2][4]. In summary, while you can programmatically manage the log levels of primary or custom-configured loggers at runtime, child loggers defined via withContext are designed to maintain consistency with their parent by inheriting its level settings rather than having their own modifiable configurations [1][4].

Citations:


🌐 Web query:

https://ballerina.io/spec/log getLevel setLevel contextual logs

💡 Result:

In the Ballerina log module, getLevel() and setLevel() are methods associated with log:Logger instances that allow for the management of log levels [1][2]. Log Levels and Configuration The log module supports four log levels, ordered by priority: ERROR, WARN, INFO, and DEBUG [2][3]. By default, INFO and higher levels are logged [2]. While global and per-module log levels can be configured statically at startup via Config.toml, runtime modifications are possible for loggers created using log:fromConfig [2]. Runtime Level Management Loggers created via log:fromConfig(id = "...", ...) are registered in a central registry [2]. - getLevel: Returns the effective log level of the logger [1]. For root or custom (registered) loggers, this is the explicitly set level [1]. - setLevel(log:Level): Updates the log level of a registered logger at runtime [1][2]. - Registry Access: You can use log:getLoggerRegistry() to discover all registered loggers via their unique IDs and update them programmatically [2]. Contextual Logging The log module supports contextual logging, which allows you to create child (derived) loggers that inherit settings from a parent [1][2]. - Inheritance: Child loggers created via withContext are not independently registered in the logger registry [1][2]. They always inherit their effective log level from their parent logger [1]. - getLevel: Calling getLevel() on a child logger delegates the request to its parent [1]. - setLevel: Attempting to call setLevel() on a child logger will result in an unsupported operation error [1]. To change the effective log level of a child logger, you must change the log level of its parent [1].

Citations:


Preserve dynamic level inheritance for contextual loggers.

withContext currently copies self.level, so later parent setLevel() calls do not update the child. Child logger setLevel() also succeeds instead of returning an unsupported-operation error. Keep the child bound to the parent level from the Ballerina log API, and add a test that changes the parent level after creating the child.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/custom-logger/custom_logger.bal` around lines 64 - 69, Update
withContext so the contextual logger retains the parent logger’s dynamic level
binding instead of copying self.level, and ensure child setLevel returns the log
API’s unsupported-operation error. Add a test that creates a child, changes the
parent level afterward, and verifies the child reflects the updated level.

Source: MCP tools

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.