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

BCDA-8215: Remove completed job count application logic #964

Merged
merged 10 commits into from
Jul 8, 2024

Conversation

kyeah
Copy link
Contributor

@kyeah kyeah commented Jun 27, 2024

🎫 Ticket

https://jira.cms.gov/browse/BCDA-8215

🛠 Changes

  • Remove all application logic referencing completed job count

ℹ️ Context

This column, by it's own commented definition, is not a reliable indicator of the number of actually completed sub-jobs for an export job. It appears that its only use is in the in-progress job status header to indicate roughly how far along the job processing is.

Instead of attempting to maintain this field, we should be relying on the source of truth (the number of completed job keys). To avoid confusion and to reduce code complexity, we are removing this column.

Before removing the column from the database, we must stop reading it from the application.

🧪 Validation

  • Unit testing

@kyeah kyeah changed the title BCDA-todo: Remove completed job count application logic BCDA-8215: Remove completed job count application logic Jun 27, 2024
kyeah added a commit that referenced this pull request Jul 2, 2024
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-8227

## 🛠 Changes

- Replace completed_job_count with a count of unique job keys (based on
job_key.que_job_id)
- Avoid re-processing ALR job if que job was already processed

## ℹ️ Context

As part of #964, I discovered that the completed_job_count was still
being used as part of ALR jobs. This applies the same fix from the
"normal" export jobs in #962.

Note that many different job keys can be produced by an ALR job. To
simplify the determination of whether a que job was processed, I added a
new "getUniqueJobKeyCount" method.

For some historical context, the ALR endpoints are not enabled in
deployed environments - see #853 for more details. To avoid making a
decision on whether to remove the code entirely, I am applying these
changes for now to remove completed_job_count.

## 🧪 Validation

Unit Testing
@kyeah kyeah marked this pull request as ready for review July 2, 2024 20:07
Copy link
Contributor

@laurenkrugen-navapbc laurenkrugen-navapbc left a comment

Choose a reason for hiding this comment

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

had one question, but other than that, LGTM. For the addition of CountUniq, were there possibility of duplicates being reported before?

Validation:

  • cleared docker locally and ran process to load fixtures and seed database, with no errors
  • ran all tests (unit, postman, etc) with no errors
  • did a command search for instances of completedjobcount and completed_job_count, found no references except for one string in ALR that does not need to be changed.

@kyeah
Copy link
Contributor Author

kyeah commented Jul 5, 2024

For the addition of CountUniq, were there possibility of duplicates being reported before?

Yes - previously it was relying on completed_job_count so it was potentially inaccurate (although didn't really matter much assuming folks weren't using that response header for critical logic!)

@kyeah kyeah merged commit ec9c426 into main Jul 8, 2024
5 checks passed
@kyeah kyeah deleted the kev/rm-completed-job-count branch July 8, 2024 15:35
kyeah added a commit that referenced this pull request Jul 10, 2024
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-8215

## 🛠 Changes

- Remove completed_job_count column

## ℹ️ Context

Removes column from DB after #964 is merged (see related PR for
details.)

Since migrations are run manually, this can be placed in the same
release and run _after_ the application deployment.

## 🧪 Validation

Unit tests

---------

Co-authored-by: alex-dzeda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants