Skip to content

Commit

Permalink
Merge pull request #54 from los-verdes/warning2debug
Browse files Browse the repository at this point in the history
Warning2debug
  • Loading branch information
jeffwecan authored Feb 17, 2024
2 parents 04efd2c + 41e3c32 commit d8ac738
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 27 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/flask_command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ jobs:
image: ${{ steps.flask-command.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup just
uses: extractions/setup-just@v1
uses: taiki-e/install-action@v2
with:
tool: just

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -53,7 +55,7 @@ jobs:
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('requirements.txt') }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/567739286055/locations/global/workloadIdentityPools/los-verdes-digital-membership/providers/los-verdes-digital-membership"
service_account: "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/image_build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:
short_sha_tag: ${{ steps.record_summary.outputs.short_sha_tag }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Authenticate to Google Cloud
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
id: auth
with:
workload_identity_provider: "projects/567739286055/locations/global/workloadIdentityPools/los-verdes-digital-membership/providers/los-verdes-digital-membership"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/just_cloudbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ jobs:
image: ${{ steps.cloudbuild-command.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup just
uses: extractions/setup-just@v1
uses: taiki-e/install-action@v2
with:
tool: just

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/567739286055/locations/global/workloadIdentityPools/los-verdes-digital-membership/providers/los-verdes-digital-membership"
service_account: "[email protected]"
Expand All @@ -38,7 +40,7 @@ jobs:
access_token_lifetime: 1800s

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Build
id: cloudbuild-command
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ jobs:
id-token: "write"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup just
uses: extractions/setup-just@v1
uses: taiki-e/install-action@v2
with:
tool: just

- name: Utilize .terraform cache
uses: actions/cache@v3
Expand All @@ -46,13 +48,13 @@ jobs:
run: just set-tf-ver-output

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ steps.read_tf_version.outputs.terraform_version }}
terraform_wrapper: false

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
id: auth
with:
workload_identity_provider: "projects/567739286055/locations/global/workloadIdentityPools/los-verdes-digital-membership/providers/los-verdes-digital-membership"
Expand Down Expand Up @@ -100,10 +102,12 @@ jobs:
management_sql_user_password: ${{ steps.just-configure-database.outputs.management_sql_user_password }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup just
uses: extractions/setup-just@v1
uses: taiki-e/install-action@v2
with:
tool: just

- name: Utilize .terraform cache
uses: actions/cache@v3
Expand All @@ -116,13 +120,13 @@ jobs:
run: just set-tf-ver-output

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ steps.read_tf_version.outputs.terraform_version }}
terraform_wrapper: false

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
id: auth
with:
workload_identity_provider: "projects/567739286055/locations/global/workloadIdentityPools/los-verdes-digital-membership/providers/los-verdes-digital-membership"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup just
uses: extractions/setup-just@v1
uses: taiki-e/install-action@v2
with:
tool: just

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -80,7 +82,7 @@ jobs:
- run-tests
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
Expand Down
22 changes: 17 additions & 5 deletions member_card/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,32 @@ def ensure_user(
email=email,
)

log_extra = dict(
email=email,
first_name=first_name,
username=username,
password=password,
bigcommerce_id=bigcommerce_id,
)

if not user.fullname and first_name is not None and last_name is not None:
member_name = f"{first_name} {last_name}"
logger.debug(f"No name set yet on {user=}, updating to: {member_name}")
logger.debug(
f"No name set yet on {user=}, updating to: {member_name}", extra=log_extra
)
user.fullname = member_name
user.first_name = first_name
user.last_name = last_name

if user.first_name != first_name:
logger.warning(
f"{user.first_name=} does not match {first_name} for some reason..."
logger.debug(
f"{user.first_name=} does not match {first_name} for some reason...",
extra=log_extra,
)
if user.last_name != last_name:
logger.warning(
f"{user.last_name=} does not match {last_name} for some reason..."
logger.debug(
f"{user.last_name=} does not match {last_name} for some reason...",
extra=log_extra,
)

if username is not None:
Expand Down

0 comments on commit d8ac738

Please sign in to comment.