Skip to content

Commit

Permalink
Added new prospecting type for Editorial (Airtable) submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
rolf-moz committed Aug 31, 2024
1 parent 1a1e8b7 commit 8130c97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/content-common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export enum ProspectType {
COUNTS_MODELED = 'COUNTS_MODELED',
DISMISSED = 'DISMISSED',
DOMAIN_ALLOWLIST = 'DOMAIN_ALLOWLIST',
EXTERNAL_EDITORIAL = 'EXTERNAL_EDITORIAL',
RECOMMENDED = 'RECOMMENDED',
RSS_LOGISTIC = 'RSS_LOGISTIC',
RSS_LOGISTIC_RECENT = 'RSS_LOGISTIC_RECENT',
Expand Down Expand Up @@ -231,6 +232,7 @@ export const ScheduledSurfaces: ScheduledSurface[] = [
ProspectType.RSS_LOGISTIC,
ProspectType.RSS_LOGISTIC_RECENT,
ProspectType.SLATE_SCHEDULER_V2,
ProspectType.EXTERNAL_EDITORIAL,
],
accessGroup: MozillaAccessGroup.NEW_TAB_CURATOR_ENUS,
},
Expand All @@ -246,6 +248,7 @@ export const ScheduledSurfaces: ScheduledSurface[] = [
ProspectType.TITLE_URL_MODELED,
ProspectType.RSS_LOGISTIC,
ProspectType.SLATE_SCHEDULER_V2,
ProspectType.EXTERNAL_EDITORIAL
],
accessGroup: MozillaAccessGroup.NEW_TAB_CURATOR_DEDE,
},
Expand Down
1 change: 1 addition & 0 deletions servers/curated-corpus-api/schema-admin.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ enum ProspectType {
RSS_LOGISTIC
RSS_LOGISTIC_RECENT
SLATE_SCHEDULER_V2
EXTERNAL_EDITORIAL
}

"""
Expand Down

5 comments on commit 8130c97

@pocket-github-bot
Copy link

Choose a reason for hiding this comment

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

Plan Result (prospect-translation-lambda-cdk)

CI link

Plan: 0 to add, 1 to change, 0 to destroy.
  • Update
    • aws_lambda_function.translation-lambda_translation-sqs-lambda_B9BDF6BA
Change Result (Click me)
  # aws_lambda_function.translation-lambda_translation-sqs-lambda_B9BDF6BA will be updated in-place
  ~ resource "aws_lambda_function" "translation-lambda_translation-sqs-lambda_B9BDF6BA" {
        id                             = "ProspectAPI-Prod-Sqs-Translation-Function"
        tags                           = {
            "app_code"       = "content"
            "component_code" = "content-prospectapi"
            "env_code"       = "prod"
            "environment"    = "Prod"
            "service"        = "ProspectAPI-Sqs-Translation"
        }
        # (21 unchanged attributes hidden)

      ~ environment {
          ~ variables = {
              ~ "GIT_SHA"                      = (sensitive value)
                # (4 unchanged elements hidden)
            }
        }

        # (4 unchanged blocks hidden)
    }

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

@pocket-github-bot
Copy link

Choose a reason for hiding this comment

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

Plan Result (corpus-scheduler-lambda-cdk)

CI link

Plan: 0 to add, 1 to change, 0 to destroy.
  • Update
    • aws_lambda_function.corpus-scheduler-sqs-lambda_F2ECDF9F
Change Result (Click me)
  # aws_lambda_function.corpus-scheduler-sqs-lambda_F2ECDF9F will be updated in-place
  ~ resource "aws_lambda_function" "corpus-scheduler-sqs-lambda_F2ECDF9F" {
        id                             = "CorpusSchedulerLambda-Prod-SQS-Function"
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:996905175585:function:CorpusSchedulerLambda-Prod-SQS-Function:147" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:996905175585:function:CorpusSchedulerLambda-Prod-SQS-Function:147/invocations" -> (known after apply)
        tags                           = {
            "app_code"       = "content"
            "component_code" = "content-corpusschedulerlambda"
            "env_code"       = "prod"
            "environment"    = "Prod"
            "service"        = "CorpusSchedulerLambda"
        }
      ~ version                        = "147" -> (known after apply)
        # (19 unchanged attributes hidden)

      ~ environment {
          ~ variables = {
              ~ "GIT_SHA"                          = (sensitive value)
                # (7 unchanged elements hidden)
            }
        }

        # (4 unchanged blocks hidden)
    }

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

@pocket-github-bot
Copy link

Choose a reason for hiding this comment

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

Plan Result (curated-corpus-api-cdk)

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 2 to add, 2 to change, 1 to destroy.
  • Create
    • local_file.application_ecs_service_appspec_94386B9C
  • Update
    • pagerduty_service.pagerduty_pagerduty-critical_464EE7CD
    • pagerduty_service.pagerduty_pagerduty-non-critical_B4CB3938
  • Replace
    • null_resource.application_ecs_service_create-task-definition-file_6BADBAF7
Change Result (Click me)
  # local_file.application_ecs_service_appspec_94386B9C will be created
  + resource "local_file" "application_ecs_service_appspec_94386B9C" {
      + content              = jsonencode(
            {
              + Resources = [
                  + {
                      + TargetService = {
                          + Properties = {
                              + LoadBalancerInfo = {
                                  + ContainerName = "app"
                                  + ContainerPort = 4025
                                }
                              + TaskDefinition   = "arn:aws:ecs:us-east-1:996905175585:task-definition/CuratedCorpusAPI-Prod:770"
                            }
                          + Type       = "AWS::ECS::Service"
                        }
                    },
                ]
              + version   = 1
            }
        )
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "appspec.json"
      + id                   = (known after apply)
    }

  # null_resource.application_ecs_service_create-task-definition-file_6BADBAF7 must be replaced
-/+ resource "null_resource" "application_ecs_service_create-task-definition-file_6BADBAF7" {
      ~ id       = "6703839965151366398" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "alwaysRun" = "2024-08-30T01:53:06Z" -> (known after apply)
        }
    }

  # pagerduty_service.pagerduty_pagerduty-critical_464EE7CD will be updated in-place
  ~ resource "pagerduty_service" "pagerduty_pagerduty-critical_464EE7CD" {
      ~ alert_creation          = "create_alerts_and_incidents" -> "create_incidents"
        id                      = "PBM69SO"
        name                    = "CuratedCorpusAPI-Prod-PagerDuty-Critical"
        # (10 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # pagerduty_service.pagerduty_pagerduty-non-critical_B4CB3938 will be updated in-place
  ~ resource "pagerduty_service" "pagerduty_pagerduty-non-critical_B4CB3938" {
      ~ alert_creation          = "create_alerts_and_incidents" -> "create_incidents"
        id                      = "PFYUN4B"
        name                    = "CuratedCorpusAPI-Prod-PagerDuty-Non-Critical"
        # (9 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

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

@pocket-github-bot
Copy link

Choose a reason for hiding this comment

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

Plan Result (prospect-api-cdk)

CI link

Plan: 1 to add, 5 to change, 0 to destroy.
  • Create
    • local_file.application_ecs_service_appspec_94386B9C
  • Update
    • aws_dynamodb_table.dynamodb_prospects_dynamodb_table_9854E41E
    • aws_iam_policy.application_ecs_service_ecs-iam_ecs-task-role-policy_6FC89FB6
    • aws_lambda_function.bridge-lambda_bridge-sqs-lambda_343B543A
    • pagerduty_service.pagerduty_pagerduty-critical_464EE7CD
    • pagerduty_service.pagerduty_pagerduty-non-critical_B4CB3938
Change Result (Click me)
  # data.aws_iam_policy_document.application_ecs_service_ecs-iam_data-ecs-task-role-policy_090CC3AD will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_iam_policy_document" "application_ecs_service_ecs-iam_data-ecs-task-role-policy_090CC3AD" {
      + id      = (known after apply)
      + json    = (known after apply)
      + version = "2012-10-17"

      + statement {
          + actions   = [
              + "dynamodb:BatchGet*",
              + "dynamodb:DescribeTable",
              + "dynamodb:Get*",
              + "dynamodb:Query",
              + "dynamodb:Scan",
              + "dynamodb:UpdateItem",
            ]
          + effect    = "Allow"
          + resources = [
              + "arn:aws:dynamodb:us-east-1:996905175585:table/PROAPI-Prod-Prospects",
              + "arn:aws:dynamodb:us-east-1:996905175585:table/PROAPI-Prod-Prospects/*",
            ]
        }
      + statement {
          + actions   = [
              + "s3:*",
            ]
          + effect    = "Allow"
          + resources = [
              + "arn:aws:s3:::pocket-prospectapi-prod-images",
              + "arn:aws:s3:::pocket-prospectapi-prod-images/*",
            ]
        }
      + statement {
          + actions   = [
              + "events:PutEvents",
            ]
          + effect    = "Allow"
          + resources = [
              + "arn:aws:events:us-east-1:996905175585:event-bus/PocketEventBridge-Prod-Shared-Event-Bus",
            ]
        }
      + statement {
          + actions   = [
              + "logs:CreateLogGroup",
              + "logs:CreateLogStream",
              + "logs:DescribeLogGroups",
              + "logs:DescribeLogStreams",
              + "logs:PutLogEvents",
              + "xray:GetSamplingRules",
              + "xray:GetSamplingStatisticSummaries",
              + "xray:GetSamplingTargets",
              + "xray:PutTelemetryRecords",
              + "xray:PutTraceSegments",
            ]
          + effect    = "Allow"
          + resources = [
              + "*",
            ]
        }
    }

  # aws_dynamodb_table.dynamodb_prospects_dynamodb_table_9854E41E will be updated in-place
  ~ resource "aws_dynamodb_table" "dynamodb_prospects_dynamodb_table_9854E41E" {
        id                          = "PROAPI-Prod-Prospects"
        name                        = "PROAPI-Prod-Prospects"
        tags                        = {
            "app_code"       = "content"
            "component_code" = "content-prospectapi"
            "env_code"       = "prod"
            "environment"    = "Prod"
            "service"        = "ProspectAPI"
        }
        # (9 unchanged attributes hidden)

      - global_secondary_index {
          - hash_key           = "scheduledSurfaceGuid" -> null
          - name               = "scheduledSurfaceGuid-prospectType" -> null
          - non_key_attributes = [] -> null
          - projection_type    = "ALL" -> null
          - range_key          = "prospectType" -> null
          - read_capacity      = 0 -> null
          - write_capacity     = 0 -> null
        }
      + global_secondary_index {
          + hash_key           = "scheduledSurfaceGuid"
          + name               = "scheduledSurfaceGuid-prospectType"
          + non_key_attributes = []
          + projection_type    = "ALL"
          + range_key          = "prospectType"
          + read_capacity      = 5
          + write_capacity     = 5
        }

        # (5 unchanged blocks hidden)
    }

  # aws_iam_policy.application_ecs_service_ecs-iam_ecs-task-role-policy_6FC89FB6 will be updated in-place
  ~ resource "aws_iam_policy" "application_ecs_service_ecs-iam_ecs-task-role-policy_6FC89FB6" {
        id        = "arn:aws:iam::996905175585:policy/ProspectAPI-Prod-TaskRolePolicy"
        name      = "ProspectAPI-Prod-TaskRolePolicy"
      ~ policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = [
                          - "dynamodb:UpdateItem",
                          - "dynamodb:Scan",
                          - "dynamodb:Query",
                          - "dynamodb:Get*",
                          - "dynamodb:DescribeTable",
                          - "dynamodb:BatchGet*",
                        ]
                      - Effect   = "Allow"
                      - Resource = [
                          - "arn:aws:dynamodb:us-east-1:996905175585:table/PROAPI-Prod-Prospects/*",
                          - "arn:aws:dynamodb:us-east-1:996905175585:table/PROAPI-Prod-Prospects",
                        ]
                    },
                  - {
                      - Action   = "s3:*"
                      - Effect   = "Allow"
                      - Resource = [
                          - "arn:aws:s3:::pocket-prospectapi-prod-images/*",
                          - "arn:aws:s3:::pocket-prospectapi-prod-images",
                        ]
                    },
                  - {
                      - Action   = "events:PutEvents"
                      - Effect   = "Allow"
                      - Resource = "arn:aws:events:us-east-1:996905175585:event-bus/PocketEventBridge-Prod-Shared-Event-Bus"
                    },
                  - {
                      - Action   = [
                          - "xray:PutTraceSegments",
                          - "xray:PutTelemetryRecords",
                          - "xray:GetSamplingTargets",
                          - "xray:GetSamplingStatisticSummaries",
                          - "xray:GetSamplingRules",
                          - "logs:PutLogEvents",
                          - "logs:DescribeLogStreams",
                          - "logs:DescribeLogGroups",
                          - "logs:CreateLogStream",
                          - "logs:CreateLogGroup",
                        ]
                      - Effect   = "Allow"
                      - Resource = "*"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> (known after apply)
        tags      = {
            "app_code"       = "content"
            "component_code" = "content-prospectapi"
            "env_code"       = "prod"
            "environment"    = "Prod"
            "service"        = "ProspectAPI"
        }
        # (4 unchanged attributes hidden)
    }

  # aws_lambda_function.bridge-lambda_bridge-sqs-lambda_343B543A will be updated in-place
  ~ resource "aws_lambda_function" "bridge-lambda_bridge-sqs-lambda_343B543A" {
        id                             = "ProspectAPI-Prod-Sqs-Bridge-Function"
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:996905175585:function:ProspectAPI-Prod-Sqs-Bridge-Function:191" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:996905175585:function:ProspectAPI-Prod-Sqs-Bridge-Function:191/invocations" -> (known after apply)
        tags                           = {
            "app_code"       = "content"
            "component_code" = "content-prospectapi"
            "env_code"       = "prod"
            "environment"    = "Prod"
            "service"        = "ProspectAPI"
        }
      ~ version                        = "191" -> (known after apply)
        # (19 unchanged attributes hidden)

      ~ environment {
          ~ variables = {
              ~ "GIT_SHA"                  = (sensitive value)
                # (5 unchanged elements hidden)
            }
        }

        # (4 unchanged blocks hidden)
    }

  # local_file.application_ecs_service_appspec_94386B9C will be created
  + resource "local_file" "application_ecs_service_appspec_94386B9C" {
      + content              = jsonencode(
            {
              + Resources = [
                  + {
                      + TargetService = {
                          + Properties = {
                              + LoadBalancerInfo = {
                                  + ContainerName = "app"
                                  + ContainerPort = 4026
                                }
                              + TaskDefinition   = "arn:aws:ecs:us-east-1:996905175585:task-definition/ProspectAPI-Prod:401"
                            }
                          + Type       = "AWS::ECS::Service"
                        }
                    },
                ]
              + version   = 1
            }
        )
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "appspec.json"
      + id                   = (known after apply)
    }

  # pagerduty_service.pagerduty_pagerduty-critical_464EE7CD will be updated in-place
  ~ resource "pagerduty_service" "pagerduty_pagerduty-critical_464EE7CD" {
      ~ alert_creation          = "create_alerts_and_incidents" -> "create_incidents"
        id                      = "PTPUWNY"
        name                    = "ProspectAPI-Prod-PagerDuty-Critical"
        # (9 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # pagerduty_service.pagerduty_pagerduty-non-critical_B4CB3938 will be updated in-place
  ~ resource "pagerduty_service" "pagerduty_pagerduty-non-critical_B4CB3938" {
      ~ alert_creation          = "create_alerts_and_incidents" -> "create_incidents"
        id                      = "PWLFWML"
        name                    = "ProspectAPI-Prod-PagerDuty-Non-Critical"
        # (9 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

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

@pocket-github-bot
Copy link

Choose a reason for hiding this comment

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

Plan Result (collection-api-cdk)

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 2 to add, 2 to change, 1 to destroy.
  • Create
    • local_file.application_ecs_service_appspec_94386B9C
  • Update
    • pagerduty_service.pagerduty_pagerduty-critical_464EE7CD
    • pagerduty_service.pagerduty_pagerduty-non-critical_B4CB3938
  • Replace
    • null_resource.application_ecs_service_create-task-definition-file_6BADBAF7
Change Result (Click me)
  # local_file.application_ecs_service_appspec_94386B9C will be created
  + resource "local_file" "application_ecs_service_appspec_94386B9C" {
      + content              = jsonencode(
            {
              + Resources = [
                  + {
                      + TargetService = {
                          + Properties = {
                              + LoadBalancerInfo = {
                                  + ContainerName = "app"
                                  + ContainerPort = 4004
                                }
                              + TaskDefinition   = "arn:aws:ecs:us-east-1:996905175585:task-definition/CollectionAPI-Prod:932"
                            }
                          + Type       = "AWS::ECS::Service"
                        }
                    },
                ]
              + version   = 1
            }
        )
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "appspec.json"
      + id                   = (known after apply)
    }

  # null_resource.application_ecs_service_create-task-definition-file_6BADBAF7 must be replaced
-/+ resource "null_resource" "application_ecs_service_create-task-definition-file_6BADBAF7" {
      ~ id       = "2108898985798815561" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "alwaysRun" = "2024-08-30T01:53:41Z" -> (known after apply)
        }
    }

  # pagerduty_service.pagerduty_pagerduty-critical_464EE7CD will be updated in-place
  ~ resource "pagerduty_service" "pagerduty_pagerduty-critical_464EE7CD" {
      ~ alert_creation          = "create_alerts_and_incidents" -> "create_incidents"
        id                      = "PYE23V6"
        name                    = "CollectionAPI-Prod-PagerDuty-Critical"
        # (9 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # pagerduty_service.pagerduty_pagerduty-non-critical_B4CB3938 will be updated in-place
  ~ resource "pagerduty_service" "pagerduty_pagerduty-non-critical_B4CB3938" {
      ~ alert_creation          = "create_alerts_and_incidents" -> "create_incidents"
        id                      = "PV4E2FG"
        name                    = "CollectionAPI-Prod-PagerDuty-Non-Critical"
        # (10 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

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

Please sign in to comment.