Skip to content

fix: lint problems #123

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 4 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
id-token: 'write'
needs:
- 'create-release'
secrets: inherit
secrets: 'inherit'

publish-release:
runs-on: 'ubuntu-latest'
Expand Down Expand Up @@ -164,6 +164,7 @@ jobs:
"contents": "write"
}
}

- name: 'Publish release'
env:
GH_TOKEN: '${{ steps.mint-token.outputs.token }}'
Expand All @@ -173,19 +174,22 @@ jobs:
gh release edit "${RELEASE_VERSION}" \
--repo "${REPO}" \
--draft=false

- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f' # ratchet:google-github-actions/auth@v2
with:
workload_identity_provider: '${{ secrets.wif_provider }}'
service_account: '${{ secrets.wif_service_account_email }}'
token_format: 'access_token'

- name: 'Authenticate to Artifact Registry'
uses: 'docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567' # ratchet:docker/login-action@v3
with:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: '${{ env.DOCKER_REGISTRY }}'

- name: 'Verify Image Exists'
run: |-
if gcloud container images describe ${{ env.DOCKER_REPO }}/${{ env.IMAGE_NAME }}:${{ github.sha }} ; then
Expand All @@ -194,15 +198,18 @@ jobs:
echo "Failed to get image. Check to see if Autopush job failed."
exit 1
fi

- name: 'Pull image via GitHub SHA'
run: |-
docker pull ${{ env.DOCKER_REPO }}/${{ env.IMAGE_NAME }}:${{ github.sha }}

- name: 'Tag Image With Release'
env:
RELEASE_VERSION: 'v${{ needs.create-release.outputs.version }}'
run: |-
docker image tag ${{ env.DOCKER_REPO }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
${{ env.DOCKER_REPO }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}

# It is complicated to undo a pushed tag, so this is the last step.
- name: 'Push Tag to Artifact Registry'
run: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Lint and test'
name: 'test'

on:
push:
Expand All @@ -15,8 +15,5 @@ concurrency:
cancel-in-progress: true

jobs:
go_lint:
uses: 'abcxyz/actions/.github/workflows/go-lint.yml@main' # ratchet:exclude

go_test:
uses: 'abcxyz/actions/.github/workflows/go-test.yml@main' # ratchet:exclude
7 changes: 4 additions & 3 deletions terraform/cloudrun.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ locals {
resource "google_cloud_run_v2_service" "metrics" {
project = var.project_id

name = var.metrics_service_name
location = var.compute_region
ingress = "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"
name = var.metrics_service_name
location = var.compute_region
ingress = "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"
template {
containers {
image = "gcr.io/cloudrun/placeholder"
Expand Down Expand Up @@ -84,6 +84,7 @@ resource "google_service_account_iam_member" "cloud_run_sa_user" {

resource "google_project_service_identity" "run_agent" {
provider = google-beta

project = var.project_id

service = "run.googleapis.com"
Expand Down
2 changes: 1 addition & 1 deletion terraform/gcs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ resource "google_storage_bucket_iam_member" "object_admins" {

resource "google_storage_bucket_iam_member" "object_viewers" {
bucket = google_storage_bucket.default.name
role = "roles/storage.objectViewer"
role = "roles/storage.objectViewer"
member = "allUsers"
}
4 changes: 2 additions & 2 deletions terraform/lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ resource "google_compute_url_map" "default" {
}

path_matcher {
name = "metrics"
name = "metrics"
default_service = google_compute_backend_service.metrics_backend.id
}
}
Expand Down Expand Up @@ -181,6 +181,6 @@ resource "google_compute_backend_service" "metrics_backend" {
}

log_config {
enable = false
enable = false
}
}
2 changes: 1 addition & 1 deletion terraform/logging.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "google_logging_project_sink" "metrics" {
name = "abc-updater-metrics-sink"
destination = "logging.googleapis.com/${google_logging_project_bucket_config.metrics.name}"
unique_writer_identity = true
filter = <<EOF
filter = <<EOF
resource.type="cloud_run_revision" AND
resource.labels.service_name="${var.metrics_service_name}" AND
jsonPayload.message="metric received"
Expand Down
4 changes: 2 additions & 2 deletions terraform/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ output "external_ip_address" {

output "cloud_run_address" {
description = "The uri assigned to the cloud run service. For testing before lb is set up."
value = google_cloud_run_v2_service.metrics.uri
value = google_cloud_run_v2_service.metrics.uri
}

output "cloud_run_agent_email" {
description = "Cloud run service agent email for CI/CD."
value = google_project_service_identity.run_agent.email
value = google_project_service_identity.run_agent.email
}
2 changes: 1 addition & 1 deletion terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ variable "ci_service_account_email" {
}

variable "metrics_service_host" {
type = string
type = string
description = "The host (foo.bar.com) domain traffice for metrics server will come on."
}