Skip to content

Conversation

Copy link

Copilot AI commented Aug 20, 2025

Summary

This PR migrates the last remaining usage of deprecated Envoy v2 API to the modern v3 API in the compression filter factory.

Problem

The codebase was still using a deprecated v2 import for gzip compression level constants:

import io.envoyproxy.envoy.config.filter.http.gzip.v2.Gzip.CompressionLevel.Enum.BEST_VALUE

This usage was in the fallback case when compression quality configuration is not provided:

val compressionLevel = Gzip.CompressionLevel.forNumber(
    group.compressionConfig.gzip?.quality
        ?: properties.compression.gzip.quality
) ?: Gzip.CompressionLevel.forNumber(BEST_VALUE)  // v2 API usage

Solution

Updated the code to use the v3 API equivalent:

val compressionLevel = Gzip.CompressionLevel.forNumber(
    group.compressionConfig.gzip?.quality
        ?: properties.compression.gzip.quality
) ?: Gzip.CompressionLevel.BEST_SPEED  // v3 API usage

The migration maintains identical behavior since both v2.BEST_VALUE and v3.BEST_SPEED have the same numeric value (1), representing the fastest compression level.

Changes

  • Removed: Deprecated v2 import io.envoyproxy.envoy.config.filter.http.gzip.v2.Gzip.CompressionLevel.Enum.BEST_VALUE
  • Updated: Fallback compression level to use Gzip.CompressionLevel.BEST_SPEED directly

Verification

  • ✅ All existing tests pass
  • ✅ Full project builds successfully without deprecation warnings
  • ✅ Comprehensive scan confirms no other v2 API usage remains
  • ✅ Backward compatibility maintained (same numeric values)

The codebase now exclusively uses modern Envoy v3 APIs with no deprecated dependencies.


💡 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.

Copilot AI changed the title [WIP] Search for cases where Envoy API used is deprecated and migrate it to new API. Migrate deprecated Envoy v2 gzip compression API to v3 Aug 20, 2025
Copilot AI requested a review from kozjan August 20, 2025 12:43
Copilot finished work on behalf of kozjan August 20, 2025 12:43
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.

2 participants