Add some documentation

This commit is contained in:
zandercymatics 2024-01-03 09:43:59 -07:00
parent 22450ed964
commit ac4dbd1a64
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 35 additions and 3 deletions

View file

@ -524,3 +524,37 @@ Example: `cf ssh getgov-za`
| 2 | **debug** | Increases logging detail. Defaults to False. | | 2 | **debug** | Increases logging detail. Defaults to False. |
| 3 | **limitParse** | Determines how many domains to parse. Defaults to all. | | 3 | **limitParse** | Determines how many domains to parse. Defaults to all. |
| 4 | **disableIdempotentCheck** | Boolean that determines if we should check for idempotence or not. Compares the proposed extension date to the value in TransitionDomains. Defaults to False. | | 4 | **disableIdempotentCheck** | Boolean that determines if we should check for idempotence or not. Compares the proposed extension date to the value in TransitionDomains. Defaults to False. |
## Patch Federal Agency Info
This section outlines how to use `patch_federal_agency_info.py`
### Running on sandboxes
#### Step 1: Grab the latest `current-full.csv` file from the dotgov-data repo
Download the csv from [here](https://github.com/cisagov/dotgov-data/blob/main/current-full.csv) and place this file under the `src/migrationdata/` directory.
#### Step 2: Transfer the `current-full.csv` file to your sandbox
[Click here to go to the section about transferring data to sandboxes](#step-1-transfer-data-to-sandboxes)
#### Step 3: Login to CloudFoundry
```cf login -a api.fr.cloud.gov --sso```
#### Step 4: SSH into your environment
```cf ssh getgov-{space}```
Example: `cf ssh getgov-za`
#### Step 5: Create a shell instance
```/tmp/lifecycle/shell```
#### Step 6: Patch agency info
```./manage.py patch_federal_agency_info migrationdata/current-full.csv --debug```
### Running locally
```docker-compose exec app ./manage.py patch_federal_agency_info migrationdata/current-full.csv --debug```
##### Optional parameters
| | Parameter | Description |
|:-:|:-------------------------- |:----------------------------------------------------------------------------|
| 1 | **debug** | Increases logging detail. Defaults to False. |

View file

@ -134,7 +134,6 @@ class Command(BaseCommand):
# === Log results and return data === # # === Log results and return data === #
self.log_script_run_summary(debug) self.log_script_run_summary(debug)
# Tracks if this script was successful. If any errors are found, something went very wrong. # Tracks if this script was successful. If any errors are found, something went very wrong.
was_success = len(self.di_failed_to_update) == 0 was_success = len(self.di_failed_to_update) == 0
return was_success return was_success
@ -143,8 +142,7 @@ class Command(BaseCommand):
"""If we encounter any DomainInformation records that do not have data in the associated """If we encounter any DomainInformation records that do not have data in the associated
TransitionDomain record, then check the associated current-full.csv file for this TransitionDomain record, then check the associated current-full.csv file for this
information.""" information."""
self.di_to_update.clear()
self.di_failed_to_update.clear()
# Code execution will stop here if the user prompts "N" # Code execution will stop here if the user prompts "N"
TerminalHelper.prompt_for_execution( TerminalHelper.prompt_for_execution(
system_exit_on_terminate=True, system_exit_on_terminate=True,