Skip to content
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

fix: Github action logic for release-generator #479

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

bryan-robitaille
Copy link
Contributor

Summary | Résumé

Adds logic to check for head branch of pull request to determine which terraform plan must be run.

Also adds SHA of last release so changelog will only contain updates since then for the new version.

@github-actions
Copy link

Staging: cognito

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

⚠️   Warning: resources will be destroyed by this change!

Plan: 1 to add, 1 to change, 1 to destroy
Show summary
CHANGE NAME
update aws_lambda_function.cognito_email_sender
recreate aws_lambda_layer_version.cognito_email_sender_nodejs
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_lambda_function.cognito_email_sender will be updated in-place
  ~ resource "aws_lambda_function" "cognito_email_sender" {
        id                             = "Cognito_Email_Sender"
      ~ layers                         = [
          - "arn:aws:lambda:ca-central-1:687401027353:layer:cognito_email_sender_node_packages:12",
        ] -> (known after apply)
        tags                           = {
            "CostCentre" = "forms-platform-staging"
            "Terraform"  = "true"
        }
        # (19 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.cognito_email_sender_nodejs must be replaced
-/+ resource "aws_lambda_layer_version" "cognito_email_sender_nodejs" {
      ~ arn                         = "arn:aws:lambda:ca-central-1:687401027353:layer:cognito_email_sender_node_packages:12" -> (known after apply)
      - compatible_architectures    = [] -> null
      ~ created_date                = "2023-08-15T15:35:20.227+0000" -> (known after apply)
      ~ id                          = "arn:aws:lambda:ca-central-1:687401027353:layer:cognito_email_sender_node_packages:12" -> (known after apply)
      ~ layer_arn                   = "arn:aws:lambda:ca-central-1:687401027353:layer:cognito_email_sender_node_packages" -> (known after apply)
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      ~ source_code_hash            = "u6J74Ho/5YDhMmlrfw36uOZdFOTSPzqf3qTAAlgx1yY=" -> "qs5cRdZWWVSfafohxew27cuy4hk3mS87FPivY+FhcwQ=" # forces replacement
      ~ source_code_size            = 14656566 -> (known after apply)
      ~ version                     = "12" -> (known after apply)
        # (4 unchanged attributes hidden)
    }

Plan: 1 to add, 1 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Releasing state lock. This may take a few moments...
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.cognito_email_sender"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.cognito_pre_sign_up"]
WARN - plan.json - main - Missing Common Tags: ["aws_cognito_user_pool.forms"]

20 tests, 17 passed, 3 warnings, 0 failures, 0 exceptions

@github-actions
Copy link

Staging: network

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 0 to add, 2 to change, 0 to destroy
Show summary
CHANGE NAME
update aws_security_group.forms_database
aws_security_group.forms_redis
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_security_group.forms_database will be updated in-place
  ~ resource "aws_security_group" "forms_database" {
        id                     = "sg-0b80bb714d886b8ff"
      ~ ingress                = [
          - {
              - cidr_blocks      = []
              - description      = ""
              - from_port        = 5432
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = [
                  - "sg-0328cae235e1dce04",
                ]
              - self             = false
              - to_port          = 5432
            },
          - {
              - cidr_blocks      = []
              - description      = "Security group rule for Forms DB ingress"
              - from_port        = 5432
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = [
                  - "sg-0554e1d0a9da92168",
                ]
              - self             = false
              - to_port          = 5432
            },
          + {
              + cidr_blocks      = []
              + from_port        = 5432
              + ipv6_cidr_blocks = []
              + prefix_list_ids  = []
              + protocol         = "tcp"
              + security_groups  = [
                  + "sg-0328cae235e1dce04",
                ]
              + self             = false
              + to_port          = 5432
            },
        ]
        name                   = "forms-database"
        tags                   = {
            "CostCentre" = "forms-platform-staging"
            "Terraform"  = "true"
        }
        # (7 unchanged attributes hidden)
    }

  # aws_security_group.forms_redis will be updated in-place
  ~ resource "aws_security_group" "forms_redis" {
        id                     = "sg-092fddfbbac0e15aa"
      ~ ingress                = [
          - {
              - cidr_blocks      = []
              - description      = ""
              - from_port        = 6379
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = [
                  - "sg-0328cae235e1dce04",
                ]
              - self             = false
              - to_port          = 6379
            },
          - {
              - cidr_blocks      = []
              - description      = "Security group rule for Forms Redis ingress"
              - from_port        = 6379
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = [
                  - "sg-0554e1d0a9da92168",
                ]
              - self             = false
              - to_port          = 6379
            },
          + {
              + cidr_blocks      = []
              + from_port        = 6379
              + ipv6_cidr_blocks = []
              + prefix_list_ids  = []
              + protocol         = "tcp"
              + security_groups  = [
                  + "sg-0328cae235e1dce04",
                ]
              + self             = false
              + to_port          = 6379
            },
        ]
        name                   = "forms-redis"
        tags                   = {
            "CostCentre" = "forms-platform-staging"
            "Terraform"  = "true"
        }
        # (7 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Releasing state lock. This may take a few moments...
Show Conftest results
18 tests, 18 passed, 0 warnings, 0 failures, 0 exceptions

@bryan-robitaille bryan-robitaille merged commit dbb3a77 into develop Sep 12, 2023
2 checks passed
@bryan-robitaille bryan-robitaille deleted the chore/release_generator branch September 12, 2023 12:57
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