Skip to content

Alignment across repositories #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2024
Merged

Alignment across repositories #23

merged 2 commits into from
Mar 30, 2024

Conversation

brettcurtis
Copy link
Contributor

@brettcurtis brettcurtis commented Mar 30, 2024

Summary by CodeRabbit

  • Chores
    • Streamlined GitHub Actions workflows for non-production, production, and sandbox environments.
    • Updated pre-commit hooks and repository versions for better code quality checks.
  • Documentation
    • Updated README files with new information on Infracost and module versions.
  • Refactor
    • Simplified infrastructure code by centralizing label definitions and using shared backend configurations.
    • Enhanced monitoring and logging configurations for better observability.

@brettcurtis brettcurtis self-assigned this Mar 30, 2024
Copy link
Contributor

coderabbitai bot commented Mar 30, 2024

Walkthrough

Walkthrough

This update streamlines GitHub workflows and Terraform configurations across several environments (non-production, production, sandbox) and updates documentation and configurations for global and regional settings. Key changes include renaming jobs for clarity, updating paths and versions, removing outdated hooks, and enhancing label management. These modifications aim to improve efficiency, simplify processes, and better integrate monitoring and logging configurations.

Changes

Files Change Summary
.github/workflows/... Renamed jobs (global_infra to global, us_east1_infra to us_east1), updated descriptions, working directories, and environment labels.
.pre-commit-config.yaml Removed hooks (infracost_generate_config, infracost_breakdown), updated pre-commit-terraform to v1.88.4.
README.md, global/README.md Updated URLs, module versions, and added monetary estimate for Infracost.
global/... Added shared backend import, introduced and centralized label definitions, updated Datadog configurations.
regional/... Updated Google provider version, added symbolic link for shared backend, introduced label definitions, added labels to resource blocks.

Possibly related issues


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

infracost bot commented Mar 30, 2024

💰 Infracost report

Monthly cost will increase by $25 📈

Changed project Baseline cost Usage cost* Total change New monthly cost
global-infra-production +$0 -$74 -$74 $0
global-infra-sandbox +$0 -$5 -$5 $0
global-production +$0 +$74 +$74 $74
global-sandbox +$0 +$30 +$30 $30
regional-infra-production +$0 -$30 -$30 $0
regional-infra-sandbox +$0 -$30 -$30 $0
regional-production +$0 +$30 +$30 $30
regional-sandbox +$0 +$30 +$30 $30

*Usage costs were estimated with usage defaults, which can also be overridden in the config files.

Cost details (includes details of unsupported resources)
──────────────────────────────────
Project: global-infra-production
Module path: global/infra

- module.datadog[0].google_bigquery_dataset.billing_export[0]
  -$5

    - Queries (on-demand)
      -$5, -0.8 TB*

- module.datadog[0].google_logging_project_sink.integration
  -$5

    - Logging data
      -$5, -10 GB*

- module.datadog[0].google_pubsub_topic.integration
  -$5

    - Message ingestion data
      -$5, -0.125 TiB*

- module.project.google_logging_project_sink.cis_2_2_logging_sink
  -$5

    - Logging data
      -$5, -10 GB*

- module.datadog[0].google_pubsub_subscription.integration
  -$15

    - Message delivery data
      -$5, -0.125 TiB*

    - Retained acknowledged message storage
      -$5, -18 GiB*

    - Snapshot message backlog storage
      -$5, -18 GiB*

- module.datadog[0].google_storage_bucket.cloud_cost_management[0]
  -$40

    - Storage (standard)
      -$5, -192 GiB*

    - Object adds, bucket/object list (class A)
      -$5, -100 10k operations*

    - Object gets, retrieve bucket/object metadata (class B)
      -$5, -1,250 10k operations*

    - Network egress
    
        - Data transfer in same continent
          -$5, -250 GB*
    
        - Data transfer to worldwide excluding Asia, Australia (first 1TB)
          -$5, -41 GB*
    
        - Data transfer to Asia excluding China, but including Hong Kong (first 1TB)
          -$5, -41 GB*
    
        - Data transfer to China excluding Hong Kong (first 1TB)
          -$5, -21 GB*
    
        - Data transfer to Australia (first 1TB)
          -$5, -26 GB*

Monthly cost change for global-infra-production (Module path: global/infra)
Amount:  -$74 ($74 → $0.00)

──────────────────────────────────
Project: global-infra-sandbox
Module path: global/infra

- module.project.google_logging_project_sink.cis_2_2_logging_sink
  -$5

    - Logging data
      -$5, -10 GB*

Monthly cost change for global-infra-sandbox (Module path: global/infra)
Amount:  -$5 ($5 → $0.00)

──────────────────────────────────
Project: global-production
Module path: global

+ module.datadog[0].google_storage_bucket.cloud_cost_management[0]
  +$40

    + Storage (standard)
      +$5, +192 GiB*

    + Object adds, bucket/object list (class A)
      +$5, +100 10k operations*

    + Object gets, retrieve bucket/object metadata (class B)
      +$5, +1,250 10k operations*

    + Network egress
    
        + Data transfer in same continent
          +$5, +250 GB*
    
        + Data transfer to worldwide excluding Asia, Australia (first 1TB)
          +$5, +41 GB*
    
        + Data transfer to Asia excluding China, but including Hong Kong (first 1TB)
          +$5, +41 GB*
    
        + Data transfer to China excluding Hong Kong (first 1TB)
          +$5, +21 GB*
    
        + Data transfer to Australia (first 1TB)
          +$5, +26 GB*

+ module.datadog[0].google_pubsub_subscription.integration
  +$15

    + Message delivery data
      +$5, +0.125 TiB*

    + Retained acknowledged message storage
      +$5, +18 GiB*

    + Snapshot message backlog storage
      +$5, +18 GiB*

+ module.datadog[0].google_bigquery_dataset.billing_export[0]
  +$5

    + Queries (on-demand)
      +$5, +0.8 TB*

+ module.datadog[0].google_logging_project_sink.integration
  +$5

    + Logging data
      +$5, +10 GB*

+ module.datadog[0].google_pubsub_topic.integration
  +$5

    + Message ingestion data
      +$5, +0.125 TiB*

+ module.project.google_logging_project_sink.cis_2_2_logging_sink
  +$5

    + Logging data
      +$5, +10 GB*

Monthly cost change for global-production (Module path: global)
Amount:  +$74 ($0.00 → $74)

──────────────────────────────────
Project: global-sandbox
Module path: global

+ module.datadog[0].google_pubsub_subscription.integration
  +$15

    + Message delivery data
      +$5, +0.125 TiB*

    + Retained acknowledged message storage
      +$5, +18 GiB*

    + Snapshot message backlog storage
      +$5, +18 GiB*

+ module.datadog[0].google_logging_project_sink.integration
  +$5

    + Logging data
      +$5, +10 GB*

+ module.datadog[0].google_pubsub_topic.integration
  +$5

    + Message ingestion data
      +$5, +0.125 TiB*

+ module.project.google_logging_project_sink.cis_2_2_logging_sink
  +$5

    + Logging data
      +$5, +10 GB*

Monthly cost change for global-sandbox (Module path: global)
Amount:  +$30 ($0.00 → $30)

──────────────────────────────────
Project: regional-infra-production
Module path: regional/infra

- google_artifact_registry_repository.docker_remote[0]
  -$10

    - Storage
      -$5, -50 GB*

    - Intercontinental (Excl Oceania)
      -$5, -62 GB*

- google_artifact_registry_repository.docker_standard["platform-docker"]
  -$10

    - Storage
      -$5, -50 GB*

    - Intercontinental (Excl Oceania)
      -$5, -62 GB*

- google_artifact_registry_repository.docker_virtual["platform-docker"]
  -$10

    - Storage
      -$5, -50 GB*

    - Intercontinental (Excl Oceania)
      -$5, -62 GB*

Monthly cost change for regional-infra-production (Module path: regional/infra)
Amount:  -$30 ($30 → $0.00)

──────────────────────────────────
Project: regional-infra-sandbox
Module path: regional/infra

- google_artifact_registry_repository.docker_remote[0]
  -$10

    - Storage
      -$5, -50 GB*

    - Intercontinental (Excl Oceania)
      -$5, -62 GB*

- google_artifact_registry_repository.docker_standard["platform-docker"]
  -$10

    - Storage
      -$5, -50 GB*

    - Intercontinental (Excl Oceania)
      -$5, -62 GB*

- google_artifact_registry_repository.docker_virtual["platform-docker"]
  -$10

    - Storage
      -$5, -50 GB*

    - Intercontinental (Excl Oceania)
      -$5, -62 GB*

Monthly cost change for regional-infra-sandbox (Module path: regional/infra)
Amount:  -$30 ($30 → $0.00)

──────────────────────────────────
Project: regional-production
Module path: regional

+ google_artifact_registry_repository.docker_remote[0]
  +$10

    + Storage
      +$5, +50 GB*

    + Intercontinental (Excl Oceania)
      +$5, +62 GB*

+ google_artifact_registry_repository.docker_standard["platform-docker"]
  +$10

    + Storage
      +$5, +50 GB*

    + Intercontinental (Excl Oceania)
      +$5, +62 GB*

+ google_artifact_registry_repository.docker_virtual["platform-docker"]
  +$10

    + Storage
      +$5, +50 GB*

    + Intercontinental (Excl Oceania)
      +$5, +62 GB*

Monthly cost change for regional-production (Module path: regional)
Amount:  +$30 ($0.00 → $30)

──────────────────────────────────
Project: regional-sandbox
Module path: regional

+ google_artifact_registry_repository.docker_remote[0]
  +$10

    + Storage
      +$5, +50 GB*

    + Intercontinental (Excl Oceania)
      +$5, +62 GB*

+ google_artifact_registry_repository.docker_standard["platform-docker"]
  +$10

    + Storage
      +$5, +50 GB*

    + Intercontinental (Excl Oceania)
      +$5, +62 GB*

+ google_artifact_registry_repository.docker_virtual["platform-docker"]
  +$10

    + Storage
      +$5, +50 GB*

    + Intercontinental (Excl Oceania)
      +$5, +62 GB*

Monthly cost change for regional-sandbox (Module path: regional)
Amount:  +$30 ($0.00 → $30)

──────────────────────────────────
Key: ~ changed, + added, - removed

*Usage costs were estimated with usage defaults from Infracost Cloud, which can also be overridden in the config files.

109 cloud resources were detected:
∙ 16 were estimated
∙ 87 were free
∙ 6 are not supported yet, rerun with --show-skipped to see details

Infracost estimate: Monthly cost will increase by $25 ↑
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Changed project                                    ┃ Baseline cost ┃ Usage cost ┃ Total change ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━┫
┃ global-infra-production                            ┃           +$0 ┃       -$74 ┃         -$74 ┃
┃ global-infra-sandbox                               ┃           +$0 ┃        -$5 ┃          -$5 ┃
┃ global-production                                  ┃           +$0 ┃       +$74 ┃         +$74 ┃
┃ global-sandbox                                     ┃           +$0 ┃       +$30 ┃         +$30 ┃
┃ regional-infra-production                          ┃           +$0 ┃       -$30 ┃         -$30 ┃
┃ regional-infra-sandbox                             ┃           +$0 ┃       -$30 ┃         -$30 ┃
┃ regional-production                                ┃           +$0 ┃       +$30 ┃         +$30 ┃
┃ regional-sandbox                                   ┃           +$0 ┃       +$30 ┃         +$30 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛

Governance checks

🟢 52 passed
50 FinOps policies, 1 Tagging policy, and 1 Guardrail passed.

View report in Infracost Cloud. This comment will be updated when code changes.

@brettcurtis brettcurtis temporarily deployed to Sandbox: Regional - us-east1 March 30, 2024 14:26 — with GitHub Actions Inactive
@brettcurtis brettcurtis temporarily deployed to Sandbox: Regional - us-east1 March 30, 2024 14:41 — with GitHub Actions Inactive
@brettcurtis brettcurtis marked this pull request as ready for review March 30, 2024 14:49
@brettcurtis brettcurtis requested a review from a user March 30, 2024 14:49
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 84e90cb and 15f3a3e.
Files ignored due to path filters (10)
  • global/infra/infracost/non-production.yml is excluded by !**/*.yml
  • global/infra/infracost/production.yml is excluded by !**/*.yml
  • global/infra/infracost/sandbox.yml is excluded by !**/*.yml
  • infracost.yml is excluded by !**/*.yml
  • regional/infra/infracost/us-east1-non-production.yml is excluded by !**/*.yml
  • regional/infra/infracost/us-east1-production.yml is excluded by !**/*.yml
  • regional/infra/infracost/us-east1-sandbox.yml is excluded by !**/*.yml
  • regional/infra/infracost/us-east4-non-production.yml is excluded by !**/*.yml
  • regional/infra/infracost/us-east4-production.yml is excluded by !**/*.yml
  • regional/infra/infracost/us-east4-sandbox.yml is excluded by !**/*.yml
Files selected for processing (14)
  • .github/workflows/non-production.yml (2 hunks)
  • .github/workflows/production.yml (2 hunks)
  • .github/workflows/sandbox.yml (2 hunks)
  • .pre-commit-config.yaml (2 hunks)
  • README.md (1 hunks)
  • global/README.md (1 hunks)
  • global/backend.tf (1 hunks)
  • global/locals.tf (1 hunks)
  • global/main.tf (2 hunks)
  • global/tfvars/sandbox.tfvars (1 hunks)
  • regional/README.md (1 hunks)
  • regional/backend.tf (1 hunks)
  • regional/locals.tf (1 hunks)
  • regional/main.tf (3 hunks)
Files skipped from review due to trivial changes (3)
  • .pre-commit-config.yaml
  • global/backend.tf
  • regional/backend.tf
Additional Context Used
Additional comments not posted (13)
global/tfvars/sandbox.tfvars (1)

1-4: The variable definitions in sandbox.tfvars are clear and align with best practices for Terraform configurations. Ensure that the values provided here are consistent with your infrastructure requirements and security policies.

global/locals.tf (1)

1-12: The use of local values for labels in global/locals.tf is a good practice, enhancing maintainability and consistency across your Terraform configurations. Ensure that the label values accurately reflect the intended use and organizational standards.

regional/locals.tf (1)

1-14: The local values defined in regional/locals.tf, including the reference to data.terraform_remote_state.global.outputs, are well-structured and promote reusability and consistency across your Terraform configurations. Ensure that the global state referenced here is correctly configured and accessible.

global/main.tf (1)

40-41: The consolidation of label assignments to use local.labels in global/main.tf is a good practice, enhancing maintainability and consistency across your Terraform configurations. Ensure that the labels defined in locals.tf meet all the requirements for the resources being provisioned.

Also applies to: 56-57

global/README.md (1)

16-16: The update to the datadog module version in global/README.md ensures that the documentation remains accurate and up-to-date. Good practice in keeping the documentation aligned with the actual versions used in the code.

.github/workflows/sandbox.yml (1)

19-32: The updates to job names, GitHub environment values, and working directories in .github/workflows/sandbox.yml enhance clarity and maintainability. Ensure that these changes are reflected in any documentation or scripts that reference these workflow jobs.

Also applies to: 42-56

.github/workflows/production.yml (1)

18-31: The changes in .github/workflows/production.yml, including the renaming of jobs and updates to GitHub environment labels, are well-executed and contribute to the clarity and maintainability of the workflow configurations. Ensure that these changes are communicated to all team members who interact with these workflows.

Also applies to: 41-55

.github/workflows/non-production.yml (1)

18-31: The updates to job names and GitHub environment descriptions in .github/workflows/non-production.yml improve clarity and maintainability. These changes align with the PR objectives and are consistent across different environments.

Also applies to: 41-55

regional/README.md (1)

12-12: The version of the google provider has been updated to 5.22.0, which is a good practice to keep dependencies up-to-date.

README.md (1)

9-11: The addition of the Infracost shield and the monetary estimate based on Infracost baseline costs is a valuable update, providing clear insights into the cost implications of the infrastructure.

regional/main.tf (3)

38-38: Adding labels = local.labels to the google_artifact_registry_repository.docker_standard resource is a good practice for consistent resource labeling.


49-49: Adding labels = local.labels to the google_artifact_registry_repository.docker_remote resource enhances consistency in labeling across resources.


69-69: The inclusion of labels = local.labels in the google_artifact_registry_repository.docker_virtual resource block is commendable for maintaining labeling consistency.

Comment on lines 9 to 15

| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | 5.18.0 |
| <a name="provider_google"></a> [google](#provider\_google) | 5.22.0 |
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Modules
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [34-34]

There's an extra whitespace before the closing parenthesis in the input_docker_repositories input definition. While this is a minor formatting issue, it's good to maintain consistency in documentation formatting.

- registry_writers = optional(list(string))<br>  }))
+ registry_writers = optional(list(string))<br> }))

@brettcurtis brettcurtis merged commit d6ced24 into main Mar 30, 2024
@brettcurtis brettcurtis deleted the alignment branch March 30, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant