Skip to content
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

AB2D-5819/Create cron job to run AttributionDataShare procedure on the database #1296

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

smirnovaae
Copy link
Contributor

@smirnovaae smirnovaae commented Nov 21, 2023

🎫 Ticket

https://jira.cms.gov/browse/AB2D-5819

🛠 Changes

  • Partitions for 2024/2025 years.
  • New current_mbi table and procedure to update the table.
  • Schedule automation call the procedure

ℹ️ Context for reviewers

Due to deployment issue we had to revert 2 PR:
#1295
#1294
In this PR, I have included changes for partitions, a new table and procedure that were previously reviewed and approved.

I commented out create_pg_cron_extension.sql in liquibase changelog, because testing is currently blocked by
PLT-246 Set pg_cron in parameter group for AB2D DBs.
We will test the scheduled procedure call in a follow up ticket: AB2D-5868
Test cron job to run AttributionDataShare procedure on the database

✅ Acceptance Validation

I've deployed this branch on dev environment and ran a job
Job completed without any exceptions.
Database contains new partitions, new table and procedure

🔒 Security Implications

  • This PR adds a new software dependency or dependencies.
  • This PR modifies or invalidates one or more of our security controls.
  • This PR stores or transmits data that was not stored or transmitted before.
  • This PR requires additional review of its security implications for other reasons.

If any security implications apply, add Jason Ashbaugh (GitHub username: StewGoin) as a reviewer and do not merge this PR without his approval.

@smirnovaae smirnovaae requested a review from a team as a code owner November 21, 2023 18:24
for values in (2023);

create table if not exists tst_2023 partition of tst
Copy link

@laurenkrugen-navapbc laurenkrugen-navapbc Nov 21, 2023

Choose a reason for hiding this comment

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

Should the create statement here and on line 27 be checking against the upcoming year instead of tst_2023?

Ex:
create table if not exists tst_2024 partition of tst
create table if not exists tst_2025 partition of tst

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops! I mistyped
Fixed

end;
$$;
--
-- CREATE OR REPLACE PROCEDURE update_current_mbi_2024()

Choose a reason for hiding this comment

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

Would it be an option to put this in a new v2024 directory, similar to the ones in here instead of having this commented out in the v2023/... folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link

@laurenkrugen-navapbc laurenkrugen-navapbc left a comment

Choose a reason for hiding this comment

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

LGTM!

@smirnovaae smirnovaae merged commit 729c925 into master Nov 22, 2023
1 check passed
@smirnovaae smirnovaae deleted the AB2D/Partitions_Current_mbi_table branch November 22, 2023 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants