Skip to content
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

Core: Support removing keys from EnvironmentContext #12103

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rshkv
Copy link

@rshkv rshkv commented Jan 25, 2025

Tiny change to support removing keys from EnvironmentContext.

Useful when a JVM is shared by multiple jobs and jobs want to express different environment properties.

@github-actions github-actions bot added the core label Jan 25, 2025
@rshkv rshkv force-pushed the wr/environment-context-remove branch from ae4c7be to 05453bf Compare January 25, 2025 16:26
*
* @param key The key whose value to remove
*/
public static void remove(String key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe the return type should be String here and the method would return PROPERTIES.remove(key). That way the test wouldn't need to check assertThatNoException().isThrownBy(() -> EnvironmentContext.remove("test-key")); but rather would make sure that the method returned the value on the first remove and null on the second remove

Copy link
Author

Choose a reason for hiding this comment

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

Yeah that's nice: 84b2adf

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.

2 participants