Skip to content

Update azure-resources module to follow style guide#135

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-133
Closed

Update azure-resources module to follow style guide#135
Copilot wants to merge 2 commits intomainfrom
copilot/fix-133

Conversation

Copy link
Copy Markdown

Copilot AI commented Aug 24, 2025

This PR updates the azure-resources module to comply with the project's style guide requirements, making minimal surgical changes to bring it into alignment.

Key Changes Made

AutoService Convention

  • Added @AutoService annotations to all SPI provider classes (AzureVmResourceProvider, AzureFunctionsResourceProvider, AzureAppServiceResourceProvider, AzureResourceDetector)
  • Removed manual META-INF/services files in favor of AutoService code generation
  • Added AutoService dependencies to build.gradle.kts

Class Structure & Finality

  • Made all resource provider classes final as they are public API classes
  • Reordered class members to follow style guide convention: static fields (final before non-final), instance fields, constructors, methods, nested classes
  • Made nested classes final where appropriate (e.g., Entry class, Builder class)

Build Configuration Fix

  • Corrected build.gradle.kts which incorrectly contained GCP content instead of Azure-specific configuration
  • Updated module name and description to properly reflect Azure resources

Code Organization

  • Reorganized static field declarations to group related constants together
  • Moved logger declarations to proper position in class organization
  • Applied consistent ordering across all provider classes

Verification

  • All existing tests continue to pass
  • Code compiles without errors or warnings
  • Spotless formatting checks pass
  • AutoService correctly generates META-INF/services files in the JAR output
  • Generated service files contain the expected provider classes

The changes maintain full backward compatibility while bringing the module into compliance with the established style guide conventions.

Fixes #133.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Fix build.gradle.kts file (was showing GCP content)
- Add AutoService dependencies
- Add @autoservice annotations to SPI provider classes
- Remove manual META-INF/services files
- Make classes final where appropriate
- Reorder class members according to style guide
- Fix compilation issues and ensure all tests pass

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Update azure-resources module to follow style guide Update azure-resources module to follow style guide Aug 24, 2025
Copilot AI requested a review from trask August 24, 2025 17:52
}

private static class Builder {
private static final class Builder {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot why this change?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This change makes the nested Builder class final to comply with the style guide requirement that classes should be marked final when they are not intended to be extended. The Builder class is an internal implementation detail that doesn't need to support inheritance.

public final class AzureVmResourceProvider extends CloudResourceProvider {

static class Entry {
static final class Entry {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot why add final here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added final to comply with the style guide requirement that classes should be marked final when they are not intended to be extended. The Entry class is a simple data holder that doesn't need to support inheritance.

Copilot AI requested a review from trask August 24, 2025 18:38
@trask trask closed this Aug 24, 2025
@trask trask deleted the copilot/fix-133 branch October 20, 2025 17:12
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 azure-resources module to follow style guide

2 participants