Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into inaki-fix-back-text
Browse files Browse the repository at this point in the history
  • Loading branch information
inaki committed Mar 8, 2024
2 parents fc10870 + 9e903c3 commit 79d769a
Show file tree
Hide file tree
Showing 34 changed files with 530 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0
with:
platforms: linux/amd64,linux/arm64
- name: Authenticate docker
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ jobs:
github.com:443
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download website build artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ needs.build.outputs.website-artifacts-key }}
path: ${{ needs.build.outputs.website-artifacts-path }}
- name: Download docker build attestation artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ needs.build.outputs.server-attestation-artifacts-key }}
path: ${{ needs.build.outputs.server-attestation-artifacts-path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ jobs:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
name: Cache plugin dir
with:
path: .tflint.d/plugins
Expand All @@ -279,4 +279,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run TFLint
run: tflint --format compact --recursive --minimum-failure-severity=error
run: tflint --format compact --recursive --minimum-failure-severity=warning
4 changes: 2 additions & 2 deletions .github/workflows/terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
registry.terraform.io:443
releases.hashicorp.com:443
- name: Download Terraform artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ inputs.tf-plan-artifacts-key }}
path: ${{ github.workspace }}/terraform
Expand All @@ -94,7 +94,7 @@ jobs:
with:
terraform_version: ${{ steps.get_tf_version.outputs.TF_VERSION }}
- name: Download website artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ inputs.website-artifacts-key }}
path: ${{ inputs.website-artifacts-path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
env:
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
- name: Download website artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ inputs.website-artifacts-key }}
path: ${{ inputs.website-artifacts-path }}
Expand Down
8 changes: 7 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"recommendations": ["Vue.volar", "dbaeumer.vscode-eslint"]
"recommendations": [
"Vue.volar",
"hashicorp.terraform",
"ms-azuretools.vscode-docker",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
2 changes: 1 addition & 1 deletion docs/decisions/0007-adopt-vue-recommended-linting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 0007. Adopt vue/recommended linting

Date: 2024-02-26
Status: Proposed
Status: Accepted

## Context and Problem Statement

Expand Down
113 changes: 109 additions & 4 deletions packages/client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
es6: true,
},
extends: [
'plugin:vue/essential',
'plugin:vue/recommended',
'@vue/airbnb',
],
parserOptions: {
Expand All @@ -24,11 +24,116 @@ module.exports = {
'no-restricted-syntax': 'off',

'import/prefer-default-export': 'off',

'vue/multi-word-component-names': 'off',
'vue/no-mutating-props': 'off',
},
overrides: [
// This override is part of the process of upgrading plugin:vue/essential -> plugin:vue/recommended.
// In order to avoid a huge stop-the-world PR, we're introducing the plugin upgrade and a file list here
// that ignores the added rules. That way, we can bring individual files into compliance in smaller, less
// disruptive PRs. We'll plan to burn down the list of files in this list until we're done and can remove
// this override entirely.
{
files: [
// File list to ignore generated by `yarn run lint --no-fix --format unix | sed -E 's/:.+//g' | uniq`
'./src/App.vue',
'./src/arpa_reporter/App.vue',
'./src/arpa_reporter/components/AlertBox.vue',
'./src/arpa_reporter/components/DownloadButton.vue',
'./src/arpa_reporter/components/DownloadFileButton.vue',
'./src/arpa_reporter/components/DownloadFileButtonSmall.vue',
'./src/arpa_reporter/components/DownloadTemplateBtn.vue',
'./src/arpa_reporter/components/Navigation.vue',
'./src/arpa_reporter/components/StandardForm.vue',
'./src/arpa_reporter/views/Agencies.vue',
'./src/arpa_reporter/views/Agency.vue',
'./src/arpa_reporter/views/Home.vue',
'./src/arpa_reporter/views/Login.vue',
'./src/arpa_reporter/views/NewTemplate.vue',
'./src/arpa_reporter/views/NewUpload.vue',
'./src/arpa_reporter/views/ReportingPeriod.vue',
'./src/arpa_reporter/views/ReportingPeriods.vue',
'./src/arpa_reporter/views/Subrecipient.vue',
'./src/arpa_reporter/views/Subrecipients.vue',
'./src/arpa_reporter/views/Upload.vue',
'./src/arpa_reporter/views/Uploads.vue',
'./src/arpa_reporter/views/User.vue',
'./src/arpa_reporter/views/Users.vue',
'./src/arpa_reporter/views/Validation.vue',
'./src/components/GrantsTable.vue',
'./src/components/Layout.vue',
'./src/components/Modals/AddKeyword.vue',
'./src/components/Modals/AddOrganization.vue',
'./src/components/Modals/AddTeam.vue',
'./src/components/Modals/AddUser.vue',
'./src/components/Modals/EditOrganization.vue',
'./src/components/Modals/EditTeam.vue',
'./src/components/Modals/EditUser.vue',
'./src/components/Modals/GrantDetailsLegacy.vue',
'./src/components/Modals/ImportTeams.vue',
'./src/components/Modals/ImportUsers.vue',
'./src/components/Modals/ProfileSettings.vue',
'./src/components/Modals/SavedSearchPanel.vue',
'./src/components/Modals/SearchPanel.vue',
'./src/components/SearchFilter.vue',
'./src/components/Uploader.vue',
'./src/components/UserAvatar.vue',
'./src/main.js',
'./src/views/ArpaAnnualPerformanceReporter.vue',
'./src/views/Dashboard.vue',
'./src/views/EligibilityCodes.vue',
'./src/views/GrantDetails.vue',
'./src/views/Grants.vue',
'./src/views/Home.vue',
'./src/views/Keywords.vue',
'./src/views/Login.vue',
'./src/views/MyGrants.vue',
'./src/views/MyProfile.vue',
'./src/views/NotFound.vue',
'./src/views/Organizations.vue',
'./src/views/RecentActivity.vue',
'./src/views/Teams.vue',
'./src/views/UpcomingClosingDates.vue',
'./src/views/Users.vue',
],
rules: {
// List of essential rules we previously had turned off
'vue/multi-word-component-names': 'off',
'vue/no-mutating-props': 'off',
// List of strongly recommended rules introduced (https://eslint.vuejs.org/rules/#priority-b-strongly-recommended-improving-readability)
'vue/attribute-hyphenation': 'off',
'vue/component-definition-name-casing': 'off',
'vue/first-attribute-linebreak': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/html-closing-bracket-spacing': 'off',
'vue/html-end-tags': 'off',
'vue/html-indent': 'off',
'vue/html-quotes': 'off',
'vue/html-self-closing': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/mustache-interpolation-spacing': 'off',
'vue/no-multi-spaces': 'off',
'vue/no-spaces-around-equal-signs-in-attribute': 'off',
'vue/no-template-shadow': 'off',
'vue/one-component-per-file': 'off',
'vue/prop-name-casing': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/require-prop-types': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/v-bind-style': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/v-on-style': 'off',
'vue/v-slot-style': 'off',
// List of recommended rules introduced (https://eslint.vuejs.org/rules/#priority-b-strongly-recommended-improving-readability)
'vue/attributes-order': 'off',
'vue/component-tags-order': 'off',
'vue/no-lone-template': 'off',
'vue/no-multiple-slot-args': 'off',
'vue/no-v-html': 'off',
'vue/order-in-components': 'off',
'vue/this-in-template': 'off',
},
},
{
files: [
'**/__tests__/*.{j,t}s?(x)',
Expand Down
12 changes: 6 additions & 6 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ resource "aws_ecs_cluster" "default" {
}

resource "aws_ecs_cluster_capacity_providers" "default" {
count = length(aws_ecs_cluster.default.*)
count = length(aws_ecs_cluster.default[*])

cluster_name = aws_ecs_cluster.default[count.index].name
capacity_providers = ["FARGATE"]
Expand All @@ -166,8 +166,8 @@ module "api" {
]

# Cluster
ecs_cluster_id = join("", aws_ecs_cluster.default.*.id)
ecs_cluster_name = join("", aws_ecs_cluster.default.*.name)
ecs_cluster_id = join("", aws_ecs_cluster.default[*].id)
ecs_cluster_name = join("", aws_ecs_cluster.default[*].name)

# Task configuration
docker_tag = var.api_container_image_tag
Expand Down Expand Up @@ -219,7 +219,7 @@ module "consume_grants" {
security_group_ids = [module.api_to_postgres_security_group.id]

# Task configuration
ecs_cluster_name = join("", aws_ecs_cluster.default.*.name)
ecs_cluster_name = join("", aws_ecs_cluster.default[*].name)
docker_tag = var.api_container_image_tag
unified_service_tags = local.unified_service_tags
datadog_environment_variables = var.consume_grants_datadog_environment_variables
Expand Down Expand Up @@ -260,7 +260,7 @@ module "arpa_audit_report" {
security_group_ids = [module.arpa_audit_report_security_group.id]

# Task configuration
ecs_cluster_name = join("", aws_ecs_cluster.default.*.name)
ecs_cluster_name = join("", aws_ecs_cluster.default[*].name)
docker_tag = var.api_container_image_tag
unified_service_tags = local.unified_service_tags
stop_timeout_seconds = 120
Expand Down Expand Up @@ -348,7 +348,7 @@ module "arpa_treasury_report" {
security_group_ids = [module.arpa_treasury_report_security_group.id]

# Task configuration
ecs_cluster_name = join("", aws_ecs_cluster.default.*.name)
ecs_cluster_name = join("", aws_ecs_cluster.default[*].name)
docker_tag = var.api_container_image_tag
unified_service_tags = local.unified_service_tags
stop_timeout_seconds = 120
Expand Down
8 changes: 4 additions & 4 deletions terraform/modules/gost_api/autoscaling.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "aws_appautoscaling_target" "desired_count" {

service_namespace = "ecs"
scalable_dimension = "ecs:service:DesiredCount"
resource_id = "service/${var.ecs_cluster_name}/${join("", aws_ecs_service.default.*.name)}"
resource_id = "service/${var.ecs_cluster_name}/${join("", aws_ecs_service.default[*].name)}"

min_capacity = var.autoscaling_desired_count_minimum
max_capacity = var.autoscaling_desired_count_maximum
Expand All @@ -14,9 +14,9 @@ resource "aws_appautoscaling_policy" "average_cpu_target_tracking" {

name = "${var.namespace}-api-CPU-TargetTrackingScaling"
policy_type = "TargetTrackingScaling"
service_namespace = join("", aws_appautoscaling_target.desired_count.*.service_namespace)
resource_id = join("", aws_appautoscaling_target.desired_count.*.resource_id)
scalable_dimension = join("", aws_appautoscaling_target.desired_count.*.scalable_dimension)
service_namespace = join("", aws_appautoscaling_target.desired_count[*].service_namespace)
resource_id = join("", aws_appautoscaling_target.desired_count[*].resource_id)
scalable_dimension = join("", aws_appautoscaling_target.desired_count[*].scalable_dimension)

target_tracking_scaling_policy_configuration {
predefined_metric_specification {
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/gost_api/ecs_exec.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "ecs_exec_policy" {
"logs:PutLogEvents",
]
resources = [
for arn in aws_cloudwatch_log_group.default.*.arn : "${arn}:log-stream:*"
for arn in aws_cloudwatch_log_group.default[*].arn : "${arn}:log-stream:*"
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/gost_api/gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module "api_gateway" {
max_age = 86400 // 24 hours, in seconds
}

default_stage_access_log_destination_arn = join("", aws_cloudwatch_log_group.default.*.arn)
default_stage_access_log_destination_arn = join("", aws_cloudwatch_log_group.default[*].arn)
default_stage_access_log_format = jsonencode({
requestId = "$context.requestId"
ip = "$context.identity.sourceIp"
Expand All @@ -93,7 +93,7 @@ module "api_gateway" {
"$default" = {
connection_type = "VPC_LINK"
vpc_link = "api-service"
integration_uri = join("", aws_service_discovery_service.default.*.arn)
integration_uri = join("", aws_service_discovery_service.default[*].arn)
integration_type = "HTTP_PROXY"
integration_method = "ANY"
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/gost_api/logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module "write_api_logs_policy" {
"logs:PutLogEvents",
]
resources = flatten([
for arn in aws_cloudwatch_log_group.default.*.arn :
for arn in aws_cloudwatch_log_group.default[*].arn :
[
arn,
"${arn}:log-stream:*"
Expand Down
16 changes: 15 additions & 1 deletion terraform/modules/gost_api/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
data "aws_region" "current" {}
data "aws_partition" "current" {}
data "aws_caller_identity" "current" {}

terraform {
required_version = "1.3.6"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.67.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.6.0"
}
}
}

module "this" {
source = "cloudposse/label/null"
version = "0.25.0"
Expand Down
8 changes: 4 additions & 4 deletions terraform/modules/gost_api/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ output "base_url_alias" {
Note that externally-managed DNS authorities may not always point this URL to the base_url;
use base_url if you need to ensure that requests target this particular deployment.
EOF
value = var.enabled ? "https://${join("", aws_route53_record.alias.*.fqdn)}" : null
value = var.enabled ? "https://${join("", aws_route53_record.alias[*].fqdn)}" : null
}

output "ecs_cluster_name" {
value = var.ecs_cluster_name
}

output "ecs_service_name" {
value = join("", aws_ecs_service.default.*.name)
value = join("", aws_ecs_service.default[*].name)
}

output "ecs_service_arn" {
value = join("", aws_ecs_service.default.*.id)
value = join("", aws_ecs_service.default[*].id)
}

output "ecs_task_role_name" {
value = join("", aws_iam_role.task.*.name)
value = join("", aws_iam_role.task[*].name)
}

output "arpa_audit_reports_bucket_id" {
Expand Down
8 changes: 4 additions & 4 deletions terraform/modules/gost_api/scraper.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ module "grants_scraper" {
retry_policy_max_event_age = { hours = 4 }

// Permissions
task_role_arn = join("", aws_ecs_task_definition.default.*.task_role_arn)
task_execution_role_arn = join("", aws_ecs_task_definition.default.*.execution_role_arn)
task_role_arn = join("", aws_ecs_task_definition.default[*].task_role_arn)
task_execution_role_arn = join("", aws_ecs_task_definition.default[*].execution_role_arn)
permissions_boundary_arn = var.permissions_boundary_arn

// Task settings
cluster_arn = join("", data.aws_ecs_cluster.default.*.arn)
task_definition_arn = join("", aws_ecs_task_definition.default.*.arn)
cluster_arn = join("", data.aws_ecs_cluster.default[*].arn)
task_definition_arn = join("", aws_ecs_task_definition.default[*].arn)
task_revision = "LATEST"
launch_type = "FARGATE"
enable_ecs_managed_tags = true
Expand Down
Loading

0 comments on commit 79d769a

Please sign in to comment.