-
Notifications
You must be signed in to change notification settings - Fork 7
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
Make section names constants #1956
Conversation
Terraform plan for meta Plan: 4 to add, 0 to change, 0 to destroy.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.environments["dev"].local_file.cf_org will be created
+ resource "local_file" "cf_org" {
+ content = <<-EOT
cf_org_name = "gsa-tts-oros-fac"
EOT
+ content_base64sha256 = (known after apply)
+ content_base64sha512 = (known after apply)
+ content_md5 = (known after apply)
+ content_sha1 = (known after apply)
+ content_sha256 = (known after apply)
+ content_sha512 = (known after apply)
+ directory_permission = "0777"
+ file_permission = "0644"
+ filename = "./../dev/orgname.auto.tfvars"
+ id = (known after apply)
}
# module.environments["preview"].local_file.cf_org will be created
+ resource "local_file" "cf_org" {
+ content = <<-EOT
cf_org_name = "gsa-tts-oros-fac"
EOT
+ content_base64sha256 = (known after apply)
+ content_base64sha512 = (known after apply)
+ content_md5 = (known after apply)
+ content_sha1 = (known after apply)
+ content_sha256 = (known after apply)
+ content_sha512 = (known after apply)
+ directory_permission = "0777"
+ file_permission = "0644"
+ filename = "./../preview/orgname.auto.tfvars"
+ id = (known after apply)
}
# module.environments["production"].local_file.cf_org will be created
+ resource "local_file" "cf_org" {
+ content = <<-EOT
cf_org_name = "gsa-tts-oros-fac"
EOT
+ content_base64sha256 = (known after apply)
+ content_base64sha512 = (known after apply)
+ content_md5 = (known after apply)
+ content_sha1 = (known after apply)
+ content_sha256 = (known after apply)
+ content_sha512 = (known after apply)
+ directory_permission = "0777"
+ file_permission = "0644"
+ filename = "./../production/orgname.auto.tfvars"
+ id = (known after apply)
}
# module.environments["staging"].local_file.cf_org will be created
+ resource "local_file" "cf_org" {
+ content = <<-EOT
cf_org_name = "gsa-tts-oros-fac"
EOT
+ content_base64sha256 = (known after apply)
+ content_base64sha512 = (known after apply)
+ content_md5 = (known after apply)
+ content_sha1 = (known after apply)
+ content_sha256 = (known after apply)
+ content_sha512 = (known after apply)
+ directory_permission = "0777"
+ file_permission = "0644"
+ filename = "./../staging/orgname.auto.tfvars"
+ id = (known after apply)
}
Plan: 4 to add, 0 to change, 0 to destroy. ✅ Plan applied in Deploy to Development and Management Environment #164 |
Terraform plan for dev No changes. Your infrastructure matches the configuration.
✅ Plan applied in Deploy to Development and Management Environment #164 |
Metaclass wrangling to set up a class that has read-only class-level attributes containing the all_caps section names, each of which has the corresponding snake_case as its value.
70da325
to
1d015dd
Compare
Minimum allowed coverage is Generated by 🐒 cobertura-action against a961b0c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! All tests passing, manual check is good, and no conflicts following a merge with main.
Naming things is hard—
Metaclasses for the win.
Now names are constants.
Add an
NC
class toaudit/cross_validation/naming.py
that has class-level read-only attributes storing the canonical snake-case section names.This makes it possible to use e.g.
NC.GENERAL_INFORMATION
instead of the string"general_information"
.This PR uses that class in
audit/cross_validation/submission_progress_check.py
instead of strings.NC
has a deliberately short name so as to make the switch from strings to using it relatively painless and only add one character to line length.This PR only uses
NC
in a very limited number of places, so this shouldn’t change anything. No features should change, so local test runs and code review should be sufficient.Uses metaclass wrangling to set up a class that has read-only class-level attributes containing the all_caps section names, each of which has the corresponding snake_case as its value.
PR checklist: submitters
main
into your branch shortly before creating the PR. (You should also be mergingmain
into your branch regularly during development.)PR checklist: reviewers
make docker clean; make docker-first-run && docker compose up
; then rundocker compose exec web /bin/bash -c "python manage.py test"
The larger the PR, the stricter we should be about these points.