Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Add database connection config #91

Merged
merged 41 commits into from
Nov 2, 2021
Merged

Add database connection config #91

merged 41 commits into from
Nov 2, 2021

Conversation

cduhn17
Copy link
Collaborator

@cduhn17 cduhn17 commented Oct 28, 2021

🗣 Description

Create a method to securely make a connection to pe-reports postgres database to use in downstream functions/classes. Resolves #76

💭 Motivation and context

This script sets up the foundation in making a centralized single point for connections to the pe-reports database . This configuration also makes a reference to the raw credentials in place of having the raw credentials in the script.

🧪 Testing

This current PR needs to pass current pytest /tests

✅ Checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

dav3r and others added 26 commits August 26, 2021 09:56
This hook should now work as expected in most, if not all of our repos 
now that we are finally updating to terraform 0.13.x (on our way to 
1.0.x).
…f_0.13

This change will be reverted when testing is completed.
Initialization will now be done during the "terraform validate" step.
…date

Enable terraform validate pre-commit hook
Add Python 3.10 to the matrices of versions used by the `test` and `build`
steps.
Ensure that the versions listed in the version matrices used by the `test` and
`build` jobs are interpreted as strings. Without this change the version `3.10`
is interpreted as `3.1` when converted to a fixnum. Since these are intended to
be interpreted as string values we should enforce it for all versions listed.
Update pre-commit hooks using `pre-commit autoupdate`. The `ansible-lint` hook
is intentionally held back due to issues with switching to v5.
This file is copied from cisagov/skeleton-ansible-role#85 and tweaked to pass
pre-commit. See here for for a list of the elements that can exist in this
file: https://ansible-lint.readthedocs.io/en/latest/configuring.html

Co-authored-by: Shane Frasier <jeremy.frasier@trio.dhs.gov>
…re-commit_version

Update the `ansible-lint` Version in the pre-commit Configuration
This will configure `dependabot` to scan Terraform configurations if they exist
in a repository. If a repository stores a Terraform configuration in a sub-
directory this configuration will need to be modified or an additional
configuration must be added if there still exists a Terraform configuration in
the root directory.
…uration_for_terraform

Add `dependabot` Configuration for Terraform
Change from using an environment variable to the outputs of the
cisagov/setup-env-github-action instead.
We use a `PACKER_VERSION` environment variable for the "Install Packer" step
that is populated from the `setup-env` outputs to get around `yamllint` lint
length limits.
We change the "Install shfmt" step to use two local environment variables to
provide the package's URL and version to install. This allows us to work around
`yamllint` line length limits.
We change the "Install Terraform-docs" step to use two local environment
variables to provide the package's URL and version to install. This allows us
to work around `yamllint` line length limits.
This changes from using an environment variable to using a step output to store
the Go version that is installed. This mirrors changes made to the other
program versions and how they're stored.
Use Outputs of cisagov/setup-env-github-action to Control Installed Program Versions
@cduhn17 cduhn17 added improvement This issue or pull request will add or improve functionality, maintainability, or ease of use upstream update This issue or pull request pulls in upstream updates labels Oct 28, 2021
@coveralls
Copy link

coveralls commented Oct 28, 2021

Pull Request Test Coverage Report for Build 1412761643

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.987%

Totals Coverage Status
Change from base Build 1333521899: 0.0%
Covered Lines: 174
Relevant Lines: 217

💛 - Coveralls

Copy link
Collaborator

@schmelz21 schmelz21 left a comment

Choose a reason for hiding this comment

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

@cduhn17, Made some suggestions to the docstring definitions. Other than that looking good.

src/pe_reports/data/config.py Outdated Show resolved Hide resolved
src/pe_reports/data/config.py Outdated Show resolved Hide resolved
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Please take a look at my suggested changes and let me know what you think.

src/pe_reports/data/config.py Outdated Show resolved Hide resolved
src/pe_reports/data/config.py Outdated Show resolved Hide resolved
src/pe_reports/data/config.py Outdated Show resolved Hide resolved
mcdonnnj and others added 13 commits October 29, 2021 13:44
Lineage pull request for: skeleton
Override the default by setting `fail-fast` to `false` for the test and build
jobs in our GHA build workflow. This ensure that all matrix jobs run regardless
of a failure.
…_test_and_build_jobs

Disable `fail-fast` for GitHub Actions Jobs with a Matrix Strategy
Lineage pull request for: skeleton
Co-authored-by: schmelz21 <81192860+schmelz21@users.noreply.github.com>
Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
@cduhn17
Copy link
Collaborator Author

cduhn17 commented Nov 1, 2021

@schmelz21
Could you review again since Ive made some changes after others have reviewed?

Copy link
Collaborator

@schmelz21 schmelz21 left a comment

Choose a reason for hiding this comment

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

Looks good!

@dav3r
Copy link
Member

dav3r commented Nov 2, 2021

@cduhn17 - Just about good to go here; I will re-review after you respond to #91 (comment).

cduhn17 and others added 2 commits November 2, 2021 09:38
Co-authored-by: schmelz21 <81192860+schmelz21@users.noreply.github.com>
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Good stuff! 🎉

@cduhn17 cduhn17 merged commit 46c05c1 into develop Nov 2, 2021
@cduhn17 cduhn17 deleted the CD-wip-db-config branch November 2, 2021 15:01
@schmelz21 schmelz21 moved this from PR to DONE in Sprint 6 (10/15 - 12/1) Nov 2, 2021
cisagovbot pushed a commit that referenced this pull request Mar 7, 2022
Lineage pull request for: skeleton
aloftus23 pushed a commit that referenced this pull request Apr 13, 2022
Add database connection config
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use upstream update This issue or pull request pulls in upstream updates
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Create configuration scripts to connect to db.
5 participants