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

App container is calculating an incorrect version number from tag #2389

Closed
thekaveman opened this issue Sep 20, 2024 · 2 comments · Fixed by #2392
Closed

App container is calculating an incorrect version number from tag #2389

thekaveman opened this issue Sep 20, 2024 · 2 comments · Fixed by #2392
Assignees
Labels
bug Something isn't working

Comments

@thekaveman
Copy link
Member

thekaveman commented Sep 20, 2024

Background

In Release 2024.07.2 we went to a tag-based deployment model. See #1527 / #2213 for more context.

Our most recent Release was for 2024.09.2.

I was looking at enrollment data, and noticed that ever since that 2024.07.2 release, our version numbers have been calculating incorrectly at runtime:

Event Type Client Event Time Version Version should be
returned enrollment June 29, 2024, 4:09 PM 2024.6.1
returned enrollment July 1, 2024, 6:03 PM 2024.6.1
returned enrollment July 4, 2024, 6:15 PM 2024.7.1
returned enrollment July 16, 2024, 11:06 AM 2024.7.1
returned enrollment July 19, 2024, 3:54 PM 2024.7.1
returned enrollment July 29, 2024, 10:33 AM 2024.7.1
returned enrollment August 1, 2024, 4:11 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 3, 2024, 11:05 AM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 9, 2024, 2:36 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 9, 2024, 7:17 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 13, 2024, 1:37 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 27, 2024, 1:03 PM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 2, 2024, 1:15 PM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 3, 2024, 11:43 AM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 7, 2024, 9:01 AM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 9, 2024, 5:22 PM 2024.9.2.dev0+gadf41b9.d20240909 2024.9.1
returned enrollment September 13, 2024, 4:24 PM 2024.9.2.dev0+gadf41b9.d20240909 2024.9.1

To Reproduce

Steps to reproduce the behavior:

  1. Checkout a prior release tag, e.g. git checkout 2024.09.2
  2. Make sure you have no pending git changes
  3. docker compose build --no-cache client to rebuild the client (prod app)
  4. docker compose up -d client to bring the client up in the background
  5. docker compose exec -ti client /bin/bash to enter the running container
  6. python manage.py shell to enter a Django shell with settings loaded
  7. import benefits; print(benefits.VERSION) 💥
  8. type exit() to exit the shell
  9. git status 💥

Expected behavior

In the above example, we should have seen 2024.09.2 printed to the screen, and no pending git changes.

Screenshots

error

Additional context

Can we just delete the .git folder from the app container? I don't see why that would be needed once the benefits package is installed.

How do we handle this in eligibility-server? Is the version number correct over there?

@thekaveman thekaveman added the bug Something isn't working label Sep 20, 2024
@thekaveman
Copy link
Member Author

thekaveman commented Sep 20, 2024

A follow-up to this one will be to update old event data going into Metabase to correct the version numbers.

Event Type Client Event Time Version Version should be
returned enrollment June 29, 2024, 4:09 PM 2024.6.1
returned enrollment July 1, 2024, 6:03 PM 2024.6.1
returned enrollment July 4, 2024, 6:15 PM 2024.7.1
returned enrollment July 16, 2024, 11:06 AM 2024.7.1
returned enrollment July 19, 2024, 3:54 PM 2024.7.1
returned enrollment July 29, 2024, 10:33 AM 2024.7.1
returned enrollment August 1, 2024, 4:11 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 3, 2024, 11:05 AM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 9, 2024, 2:36 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 9, 2024, 7:17 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 13, 2024, 1:37 PM 2024.7.3.dev0+gcd3b083.d20240731 2024.7.2
returned enrollment August 27, 2024, 1:03 PM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 2, 2024, 1:15 PM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 3, 2024, 11:43 AM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 7, 2024, 9:01 AM 2024.8.2.dev0+g7664917.d20240821 2024.8.1
returned enrollment September 9, 2024, 5:22 PM 2024.9.2.dev0+gadf41b9.d20240909 2024.9.1
returned enrollment September 13, 2024, 4:24 PM 2024.9.2.dev0+gadf41b9.d20240909 2024.9.1

Note the events above are just successful enrollments, so there are likely many more events with incorrect version numbers.

@thekaveman
Copy link
Member Author

thekaveman commented Sep 20, 2024

How do we handle this in eligibility-server? Is the version number correct over there?

Ah right, we have a multi-stage build there, exactly for this reason... 🤕

See cal-itp/eligibility-server#382

@thekaveman thekaveman self-assigned this Sep 20, 2024
@thekaveman thekaveman moved this from Todo to In progress in Digital Services Sep 20, 2024
@thekaveman thekaveman moved this from In progress to In review in Digital Services Sep 21, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Digital Services Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant