Skip to content

refactor(infra): deprecate namespace in favor of instance-name#173

Open
dwnoble wants to merge 1 commit into
datacommonsorg:mainfrom
dwnoble:deprecate-namespace
Open

refactor(infra): deprecate namespace in favor of instance-name#173
dwnoble wants to merge 1 commit into
datacommonsorg:mainfrom
dwnoble:deprecate-namespace

Conversation

@dwnoble

@dwnoble dwnoble commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Deprecates the use of the word 'namespace' for prefixing resource names in Terraform configurations and scaffolding, replacing it with the clearer term 'instance_name'. Main changes include variables, default values, validations, and documentation updates while preserving backward compatibility.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the namespace variable with instance_name across the Terraform configurations, CLI, tests, and documentation to improve resource naming clarity, while maintaining backward compatibility. The review feedback recommends adding a validation block to the new instance_name variable to enforce GCP naming conventions and prevent deployment failures, as well as cleaning up several extra consecutive blank lines introduced in the Terraform files.

Comment thread infra/dcp/variables.tf
Comment on lines +16 to 20
variable "instance_name" {
description = "A unique identifier used as a prefix for resource naming. This prevents naming conflicts when deploying multiple isolated environments (like dev, staging, or feature branches) within the same GCP project."
type = string
default = ""
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

To prevent deployment failures due to invalid resource names (e.g., containing underscores or exceeding length limits), it is highly recommended to add a validation block to var.instance_name. This ensures that any user-provided value conforms to GCP naming conventions (lowercase alphanumeric characters and dashes, up to 16 characters) when defined directly in terraform.tfvars.

variable "instance_name" {
  description = "A unique identifier used as a prefix for resource naming. This prevents naming conflicts when deploying multiple isolated environments (like dev, staging, or feature branches) within the same GCP project."
  type        = string
  default     = ""

  validation {
    condition     = var.instance_name == "" || (length(var.instance_name) <= 16 && can(regex("^[a-z]([-a-z0-9]*[a-z0-9])?$", var.instance_name)))
    error_message = "The instance_name must be 16 characters or less, start with a lowercase letter, end with a lowercase letter or number, and contain only lowercase alphanumeric characters and dashes."
  }
}

Comment on lines 33 to 36
clean_namespace_prefix = local.clean_namespace_prefix


enable_redis_cache_clearing = var.enable_redis_cache_clearing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Remove the extra consecutive blank lines to maintain clean and consistent Terraform formatting.

    clean_namespace_prefix         = local.clean_namespace_prefix
    enable_redis_cache_clearing    = var.enable_redis_cache_clearing

Comment on lines 48 to 52
}



variable "ingestion_helper_service_name" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Remove the extra consecutive blank lines to keep the variable definitions clean and readable.

}

variable "ingestion_helper_service_name" {

Comment on lines 229 to 232
}


module "redis" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Remove the extra consecutive blank lines to maintain clean and consistent formatting across module declarations.

}

module "redis" {

@dwnoble
dwnoble force-pushed the deprecate-namespace branch from 5491f9a to 17f0207 Compare July 17, 2026 11:13
@dwnoble
dwnoble requested review from clincoln8 and gmechali July 17, 2026 18:21

@gmechali gmechali left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks Dan!

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