Source of Truth - Long Tracking Branch#4765
Conversation
- Address feedback where we no longer need`_convert_additional_fields()` - it is a duplicate of a method in `utils.py`. - Minor cleanup on `_populate_accesses()`. I no longer felt it needed to be an isolated function while addressing the above bullet point
- Supplied two new arguments, "--disseminated" and "--intake". The first will only fetch SAC data that is disseminated, while the second will only fetch SAC data that has not yet disseminated. - Rather than iterate through 50k SACs at a time, this change introduces a while condition that will continuously migrate batches of 100 until all relevant SACs are migrated. This should mean we only need to run the command once at a time.
Bandit does not like potential SQL injection with string-based query construction, however this logic is only accessed internally.
- Added `migrated_to_audit` flag on `SingleAuditChecklist` for determining which SACs have not yet been migrated. - Added some logic (for local testing ONLY) which cleans up audit data and references to mimic a clean slate.
|
Terraform plan for meta No changes. Your infrastructure matches the configuration.✅ Plan applied in Deploy to Development and Management Environment #973 |
|
Terraform plan for dev Plan: 1 to add, 4 to change, 1 to destroy.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~ update in-place
-/+ destroy and then create replacement
Terraform will perform the following actions:
# module.dev.cloudfoundry_network_policy.app-network-policy will be updated in-place
!~ resource "cloudfoundry_network_policy" "app-network-policy" {
id = "99884884-59ae-8864-786d-a5e33d1b1455"
- policy {
- destination_app = "ea09b23c-eebc-4383-9f4d-29152236ad87" -> null
- port = "61443" -> null
- protocol = "tcp" -> null
- source_app = "bfcc67a1-8ace-45fe-b472-0594da8ab39b" -> null
}
- policy {
- destination_app = "ea09b23c-eebc-4383-9f4d-29152236ad87" -> null
- port = "61443" -> null
- protocol = "tcp" -> null
- source_app = "d7fcdc7a-fd97-4e31-89ae-b823883b5992" -> null
}
+ policy {
+ destination_app = (known after apply)
+ port = "61443"
+ protocol = "tcp"
+ source_app = "bfcc67a1-8ace-45fe-b472-0594da8ab39b"
}
+ policy {
+ destination_app = (known after apply)
+ port = "61443"
+ protocol = "tcp"
+ source_app = "d7fcdc7a-fd97-4e31-89ae-b823883b5992"
}
}
# module.dev.cloudfoundry_network_policy.clamav-network-policy will be updated in-place
!~ resource "cloudfoundry_network_policy" "clamav-network-policy" {
id = "30fc72e9-9a5e-c40d-140c-98bc1b576989"
- policy {
- destination_app = "a6eb3870-2769-4aa9-a8f2-f1a31939f563" -> null
- port = "61443" -> null
- protocol = "tcp" -> null
- source_app = "6eab89ac-271f-4193-893f-cfa1f590f3d9" -> null
}
- policy {
- destination_app = "a6eb3870-2769-4aa9-a8f2-f1a31939f563" -> null
- port = "61443" -> null
- protocol = "tcp" -> null
- source_app = "ea09b23c-eebc-4383-9f4d-29152236ad87" -> null
}
+ policy {
+ destination_app = "a6eb3870-2769-4aa9-a8f2-f1a31939f563"
+ port = "61443"
+ protocol = "tcp"
+ source_app = (known after apply)
}
+ policy {
+ destination_app = "a6eb3870-2769-4aa9-a8f2-f1a31939f563"
+ port = "61443"
+ protocol = "tcp"
+ source_app = (known after apply)
}
}
# module.dev.module.clamav.cloudfoundry_app.clamav_api will be updated in-place
!~ resource "cloudfoundry_app" "clamav_api" {
+ buildpacks = (known after apply)
!~ created_at = "2025-03-14T14:22:42Z" -> (known after apply)
!~ docker_image = "ghcr.io/gsa-tts/fac/clamav@sha256:296c46bb74c5a29e4b71aa0d46a8518dd379b4410026a9a3ab97b0ea8fc7b4bd" -> "ghcr.io/gsa-tts/fac/clamav@sha256:613e32da4c4c3207cf8f1e7ed7f04f0a34f4db14b7404f3cc0b6bf78be90fad8"
!~ health_check_type = "port" -> (known after apply)
!~ id = "************************************" -> (known after apply)
!~ log_rate_limit_per_second = "-1" -> (known after apply)
name = "fac-av-dev"
!~ readiness_health_check_type = "process" -> (known after apply)
!~ stack = null -> (known after apply)
!~ updated_at = "2025-03-31T12:19:40Z" -> (known after apply)
# (9 unchanged attributes hidden)
}
# module.dev.module.cors.null_resource.cors_header must be replaced
-/+ resource "null_resource" "cors_header" {
!~ id = "*******************" -> (known after apply)
!~ triggers = { # forces replacement
!~ "always_run" = "2025-04-02T19:23:28Z" -> (known after apply)
}
}
# module.dev.module.file_scanner_clamav.cloudfoundry_app.clamav_api will be updated in-place
!~ resource "cloudfoundry_app" "clamav_api" {
+ buildpacks = (known after apply)
!~ created_at = "2025-03-14T14:22:42Z" -> (known after apply)
!~ docker_image = "ghcr.io/gsa-tts/fac/clamav@sha256:296c46bb74c5a29e4b71aa0d46a8518dd379b4410026a9a3ab97b0ea8fc7b4bd" -> "ghcr.io/gsa-tts/fac/clamav@sha256:613e32da4c4c3207cf8f1e7ed7f04f0a34f4db14b7404f3cc0b6bf78be90fad8"
!~ health_check_type = "port" -> (known after apply)
!~ id = "************************************" -> (known after apply)
!~ log_rate_limit_per_second = "-1" -> (known after apply)
name = "fac-av-dev-fs"
!~ readiness_health_check_type = "process" -> (known after apply)
!~ stack = null -> (known after apply)
!~ updated_at = "2025-03-31T12:19:41Z" -> (known after apply)
# (9 unchanged attributes hidden)
}
Plan: 1 to add, 4 to change, 1 to destroy.✅ Plan applied in Deploy to Development and Management Environment #973 |
- Updated `generate_audit_indexes` to catch an issue where `auditee_fiscal_period_end` is an empty string for some records. - `migrate_audits` command now uses ORM instead of raw queries for performance improvements. - Improved logging of `migrate_audits` for better monitoring of progress. - Inserted `null=True` into `migrated_to_audit` booleanfield for SACs. - Setting `migrated_to_audit=True` for SACs that get created during intake process. This is because an Audit already gets created with the SAC during this step.
Updating mixins to account for audits
|
This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until all status checks pass. If you see this message, please rerun all status checks before merging. |
Search on Audits, with some refactoring
|
This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until all status checks pass. If you see this message, please rerun all status checks before merging. |
…tions First start at cross validation
Updating the API to account for audit table, and refactoring.
|
This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until all status checks pass. If you see this message, please rerun all status checks before merging. |
Updating the previous references validation to use Audit table
We fixed a number of things in the comparison script, and like where we are. One fix in the API. Ready for iteration.
Cleaning up the logging for search a bit
Bulk export of audit data
Adding api version 1.2.0 for SoT
Ignoring the test file, adding a timeout to `get()`.
…-date Do the date calculations for fac-accepted-date
Hdms/source of truth/api 1 2 0
jadudm
left a comment
There was a problem hiding this comment.
This branch has seen extensive ongoing review; it was a long-lived branch during March while we waited for the busy season to end. Bringing into main for further development and testing.
|
Purpose
This PR will begin creating and updating Audits in the new Audit table.
How
Audit should now be wired into everything all the way through to dissemination. Search and all UIs are still reliant on SAC/dissemination tables.
Testing
Linting, Unit Tests, End to End tests
Notes
I truly apologize about the size of this PR.
There is a large refactor as part of this change.
I will want to do additional thorough manual testing before we move this to production.
Due to the nature of this change, I'm going to request 2 approvals before I merge.
This was originally here: #4737 it got closed when renaming the branch