-
Notifications
You must be signed in to change notification settings - Fork 15
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-8350: Add workflow to generate database docs #994
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b5ad623
test dbdoc
kyeah 6fa201f
Add workflow
kyeah beeabdc
Update workflow
kyeah 1cee1f4
decrypt secrets
kyeah fe6ce91
oops typo
kyeah 4dcb2b3
Checkout ref
kyeah a9e216e
Generate dbdocs
github-actions[bot] 5e65306
remove old folder
kyeah fcc8daf
revert shared_files
kyeah 9fb9812
cleanup
kyeah 56e52af
Generate dbdocs
github-actions[bot] 62d83b4
Readd shared files
kyeah e84578e
Update .github/workflows/dbdocs.yml
kyeah 7e00c0b
Update dbdocs.yml
kyeah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow generates database documentation and ERD files. | ||
# | ||
name: Generate dbdocs | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/dbdocs.yml | ||
- db/migrations/bcda | ||
- db/migrations/bcda_queue | ||
|
||
env: | ||
VAULT_PW: ${{ secrets.VAULT_PW }} | ||
|
||
jobs: | ||
generate-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Decrypt secrets | ||
run: | | ||
echo $VAULT_PW > .vault_password | ||
bash ops/secrets --decrypt | ||
mv -fv shared_files/encrypted/* shared_files/decrypted/ | ||
|
||
- name: Start DB | ||
run: make reset-db | ||
|
||
- name: Generate DB docs | ||
run: make dbdocs | ||
|
||
- uses: EndBug/add-and-commit@v9 | ||
kyeah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
add: dbdocs | ||
message: "Generate dbdocs" | ||
default_author: github_actions | ||
|
||
- name: Cleanup secrets | ||
if: always() | ||
run: rm -r shared_files/decrypted | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to rm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# bcda | ||
|
||
## Tables | ||
|
||
| Name | Columns | Comment | Type | | ||
| ---- | ------- | ------- | ---- | | ||
| [public.schema_migrations_bcda](public.schema_migrations_bcda.md) | 2 | | BASE TABLE | | ||
| [public.acos](public.acos.md) | 10 | | BASE TABLE | | ||
| [public.cclf_beneficiaries](public.cclf_beneficiaries.md) | 7 | | BASE TABLE | | ||
| [public.cclf_files](public.cclf_files.md) | 10 | | BASE TABLE | | ||
| [public.job_keys](public.job_keys.md) | 7 | | BASE TABLE | | ||
| [public.jobs](public.jobs.md) | 9 | | BASE TABLE | | ||
| [public.suppression_files](public.suppression_files.md) | 6 | | BASE TABLE | | ||
| [public.suppressions](public.suppressions.md) | 18 | | BASE TABLE | | ||
| [public.alr](public.alr.md) | 12 | | BASE TABLE | | ||
| [public.alr_meta](public.alr_meta.md) | 5 | | BASE TABLE | | ||
|
||
## Stored procedures and functions | ||
|
||
| Name | ReturnType | Arguments | Type | | ||
| ---- | ------- | ------- | ---- | | ||
| public.trigger_set_timestamp | trigger | | FUNCTION | | ||
|
||
## Relations | ||
|
||
![er](schema.svg) | ||
|
||
--- | ||
|
||
> Generated by [tbls](https://github.com/k1LoW/tbls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# public.acos | ||
|
||
## Description | ||
|
||
## Columns | ||
|
||
| Name | Type | Default | Nullable | Children | Parents | Comment | | ||
| ---- | ---- | ------- | -------- | -------- | ------- | ------- | | ||
| uuid | uuid | | false | [public.jobs](public.jobs.md) | | | | ||
| name | text | | false | | | | | ||
| created_at | timestamp with time zone | now() | false | | | | | ||
| updated_at | timestamp with time zone | now() | false | | | | | ||
| id | integer | nextval('acos_id_seq'::regclass) | false | | | | | ||
| client_id | text | | true | | | | | ||
| cms_id | varchar(8) | | true | | | | | ||
| group_id | text | | true | | | | | ||
| system_id | text | | true | | | | | ||
| termination_details | jsonb | | true | | | | | ||
|
||
## Constraints | ||
|
||
| Name | Type | Definition | | ||
| ---- | ---- | ---------- | | ||
| acos_pkey | PRIMARY KEY | PRIMARY KEY (uuid) | | ||
| acos_cms_id_key | UNIQUE | UNIQUE (cms_id) | | ||
|
||
## Indexes | ||
|
||
| Name | Definition | | ||
| ---- | ---------- | | ||
| acos_pkey | CREATE UNIQUE INDEX acos_pkey ON public.acos USING btree (uuid) | | ||
| acos_cms_id_key | CREATE UNIQUE INDEX acos_cms_id_key ON public.acos USING btree (cms_id) | | ||
|
||
## Triggers | ||
|
||
| Name | Definition | | ||
| ---- | ---------- | | ||
| set_timestamp | CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.acos FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp() | | ||
|
||
## Relations | ||
|
||
![er](public.acos.svg) | ||
|
||
--- | ||
|
||
> Generated by [tbls](https://github.com/k1LoW/tbls) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# public.alr | ||
|
||
## Description | ||
|
||
## Columns | ||
|
||
| Name | Type | Default | Nullable | Children | Parents | Comment | | ||
| ---- | ---- | ------- | -------- | -------- | ------- | ------- | | ||
| created_at | timestamp with time zone | now() | false | | | | | ||
| updated_at | timestamp with time zone | now() | false | | | | | ||
| id | bigint | nextval('alr_id_seq'::regclass) | false | | | | | ||
| metakey | bigint | | false | | [public.alr_meta](public.alr_meta.md) | | | ||
| mbi | character(11) | | false | | | | | ||
| hic | character(12) | | true | | | | | ||
| firstname | varchar(30) | | true | | | | | ||
| lastname | varchar(40) | | true | | | | | ||
| sex | character(1) | | true | | | | | ||
| dob | timestamp without time zone | | true | | | | | ||
| dod | timestamp without time zone | | true | | | | | ||
| keyvalue | bytea | | true | | | | | ||
|
||
## Constraints | ||
|
||
| Name | Type | Definition | | ||
| ---- | ---- | ---------- | | ||
| foreign_key_alr | FOREIGN KEY | FOREIGN KEY (metakey) REFERENCES alr_meta(id) ON UPDATE RESTRICT ON DELETE RESTRICT | | ||
|
||
## Triggers | ||
|
||
| Name | Definition | | ||
| ---- | ---------- | | ||
| set_timestamp | CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.alr FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp() | | ||
|
||
## Relations | ||
|
||
![er](public.alr.svg) | ||
|
||
--- | ||
|
||
> Generated by [tbls](https://github.com/k1LoW/tbls) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These github actions dont leave any kind of artifacts anywhere I assume?
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.
oh hm! I don't think so, I copied this from the existing ci-workflow.yml. We're good to keep decrypted secrets on the public GA machines, right @CMSgov/ab2d-bcda-dpc-platform?
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.
Better not to leave them lying around if we can avoid it. There was a vulnerability found recently in GitHub Actions artifacts. That doesn't apply directly here, but does point toward the potential for leaks.