Skip to content

Enforce explicit names for global scripts and refine script id handling #3691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

jhl221123
Copy link
Contributor

This PR addresses issue #3176 by ensuring scripts defined in the global <Scripts> container have explicit, non-blank names. It also introduces a clearer distinction between user-defined names and internal script identifiers.

Key Changes:

  • AbstractScript now provides getName() strictly for user-configured names, which can be null or blank. It also introduces getId() to consistently return a non-blank internal identifier, falling back to toString() if no explicit name is set.
  • ScriptsPlugin now throws a ConfigurationException if any script defined directly under the global <Scripts> element lacks an explicit name.
  • ScriptManager and various script-using components were updated. They now utilize the script.getId() for internal referencing.
  • Added unit tests for AbstractScript and ScriptsPlugin.

…cripts container

This commit introduces a clearer distinction between user-defined script names and internal script identifiers, and enforces explicit naming for global scripts.
- AbstractScript now provides 'getName()' for user-set names and 'getId()' for an internal Id.
- ScriptsPlugin throws a 'ConfigurationException' if global scripts lack a non-blank name via 'getName()'.
- ScriptManager and its users were updated to utilize 'script.getId()' for internal referencing.
- Added unit tests for 'AbstractScript' and 'ScriptsPlugin'.
- Updated 'org.apache.logging.log4j.core.script' package-info to version 2.25.0.
- Added a changelog entry for issue apache#3176.
Copy link

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To triage
Development

Successfully merging this pull request may close these issues.

2 participants