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

ci: Perform basic SQL tests #1086

Merged
merged 1 commit into from
Jun 17, 2024
Merged

ci: Perform basic SQL tests #1086

merged 1 commit into from
Jun 17, 2024

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented Jun 14, 2024

What does this change, and why?

The changes in #1066 created a regression, where the repocop database user lost access to a view.

In this change, we run some SQL in CI in an attempt to catch such regressions earlier.

How has it been verified?

Observe CI. The build log (see below) shows we've switched user, and performed a SELECT * on the view successfully (the query returns 0 rows as the database is empty).

image

The changes in #1066 created a regression, where the `repocop` database user lost access to a view.

In this change, we run some SQL in CI in an attempt to catch such regressions earlier.
@@ -130,6 +130,9 @@ jobs:
- name: perform a DEV database migration
run: npm -w cli start migrate -- --stage DEV

- name: basic database tests
run: psql -d postgresql://postgres:not_at_all_secret@localhost:5432/postgres -v ON_ERROR_STOP=1 -f sql/ci.sql
Copy link
Member Author

Choose a reason for hiding this comment

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

Execute a file, rather than inlining the query, to make it easier to add more tests in future.

@akash1810 akash1810 marked this pull request as ready for review June 14, 2024 12:55
@akash1810 akash1810 requested review from a team as code owners June 14, 2024 12:55
Copy link
Contributor

@NovemberTang NovemberTang left a comment

Choose a reason for hiding this comment

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

🫶

@akash1810 akash1810 merged commit 80306fc into main Jun 17, 2024
4 checks passed
@akash1810 akash1810 deleted the aa/ci-repocop-access branch June 17, 2024 08:01
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.

2 participants