Skip to content

Conversation

Copy link

Copilot AI commented Aug 24, 2025

This PR updates the cloudfoundry-resources module to comply with the OpenTelemetry Java Contrib style guide by making minimal changes focused on style improvements without altering functionality.

Changes Made

1. @autoservice Usage

  • Added @AutoService annotations to CloudFoundryResourceProvider and CloudFoundryResourceDetector to automatically generate META-INF/services files
  • Removed manual META-INF/services files that were previously maintained by hand
  • Added necessary dependencies for @AutoService annotation processing

2. Final Class Declaration

  • Made public non-internal classes final as recommended by the style guide:
    • CloudFoundryResourceProvider
    • CloudFoundryResourceDetector

3. Static Imports

  • Added static imports for commonly used methods per style guide recommendations:
    • AttributeKey.stringKey in CloudFoundryResource
    • StandardCharsets.UTF_8, Collections.emptyMap, Collectors.joining, Assertions.fail in CloudFoundryResourceTest

Verification

  • All existing tests continue to pass
  • Build succeeds with proper formatting
  • @autoservice correctly generates the same service provider files that were manually maintained
  • No functional changes to the module behavior

The changes bring the module into full compliance with the documented style guide while maintaining backward compatibility and existing functionality.

Fixes #244.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 24, 2025 20:00
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Update cloudfoundry-resources module to follow style guide Update cloudfoundry-resources module to follow style guide Aug 24, 2025
Copilot AI requested a review from trask August 24, 2025 20:03
Copilot finished work on behalf of trask August 24, 2025 20:03
@trask trask closed this Aug 24, 2025
@trask trask deleted the copilot/fix-244 branch October 20, 2025 17:14
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.

Update cloudfoundry-resources module to follow style guide

2 participants