Skip to content

Commit

Permalink
fix(v2): default migration_mode to PRE_MIGRATION_SURFACE_ONLY
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Apr 14, 2023
1 parent 8ae9eee commit 2851cd5
Show file tree
Hide file tree
Showing 307 changed files with 21 additions and 46,188 deletions.
2 changes: 1 addition & 1 deletion rules_php_gapic/php_gapic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def php_gapic_srcjar(
rest_numeric_enums = False,
generate_snippets = True,
# Supported values validated and specified in src/Utils/MigrationMode.php.
migration_mode = "MIGRATION_MODE_UNSPECIFIED",
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
generator_binary = Label("//rules_php_gapic:php_gapic_generator_binary"),
**kwargs):
plugin_file_args = {}
Expand Down
4 changes: 2 additions & 2 deletions src/CodeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function generateFromDescriptor(
bool $numericEnums = false,
int $licenseYear = -1,
bool $generateSnippets = true,
string $migrationMode = MigrationMode::MIGRATION_MODE_UNSPECIFIED,
string $migrationMode = MigrationMode::PRE_MIGRATION_SURFACE_ONLY,
) {
$descSet = new FileDescriptorSet();
$descSet->mergeFromString($descBytes);
Expand Down Expand Up @@ -133,7 +133,7 @@ public static function generate(
bool $numericEnums = false,
int $licenseYear = -1,
bool $generateSnippets = true,
string $migrationMode = MigrationMode::MIGRATION_MODE_UNSPECIFIED
string $migrationMode = MigrationMode::PRE_MIGRATION_SURFACE_ONLY
) {
if ($licenseYear < 0) {
$licenseYear = (int)date('Y');
Expand Down
2 changes: 1 addition & 1 deletion src/Generation/ServiceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function __construct(
ServiceDescriptorProto $desc,
FileDescriptorProto $fileDesc,
int $transportType = Transport::GRPC_REST,
string $migrationMode = MigrationMode::MIGRATION_MODE_UNSPECIFIED
string $migrationMode = MigrationMode::PRE_MIGRATION_SURFACE_ONLY
) {
$this->catalog = $catalog;
$this->package = $package;
Expand Down
2 changes: 1 addition & 1 deletion src/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function readOptions($opts, $sideLoadedRootDir = null)
$migrationMode = $opts['migration-mode'];
MigrationMode::validateMode($migrationMode);
} else {
$migrationMode = MigrationMode::MIGRATION_MODE_UNSPECIFIED;
$migrationMode = MigrationMode::PRE_MIGRATION_SURFACE_ONLY;
}

// Flip the flag value because PHP is weird: the presence of the --metadata flag evaluates to false.
Expand Down
1 change: 1 addition & 0 deletions tests/Integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ php_gapic_library(
gapic_yaml = "@com_google_googleapis//google/cloud/redis/v1:redis_gapic.yaml",
grpc_service_config = "@com_google_googleapis//google/cloud/redis/v1:redis_grpc_service_config.json",
service_yaml = "@com_google_googleapis//google/cloud/redis/v1:redis_v1.yaml",
migration_mode = "MIGRATION_MODE_UNSPECIFIED",
deps = [
":redis_php_grpc",
":redis_php_proto",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2851cd5

Please sign in to comment.