-
-
Notifications
You must be signed in to change notification settings - Fork 171
chore: move ansible migration tests to nix flake check #1493
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 | ||
---|---|---|---|---|
@@ -1,43 +1,38 @@ | ||||
BEGIN; | ||||
create extension if not exists postgis_sfcgal with schema "extensions" cascade; | ||||
ROLLBACK; | ||||
begin; | ||||
do $_$ | ||||
begin | ||||
if not exists (select 1 from pg_extension where extname = 'orioledb') then | ||||
-- create postgis tiger as supabase_admin | ||||
create extension if not exists postgis_tiger_geocoder cascade; | ||||
|
||||
BEGIN; | ||||
create extension if not exists postgis_raster with schema "extensions" cascade; | ||||
ROLLBACK; | ||||
-- \ir ansible/files/postgresql_extension_custom_scripts/postgis_tiger_geocoder/after-create.sql | ||||
grant usage on schema tiger, tiger_data to postgres with grant option; | ||||
grant all privileges on all tables in schema tiger, tiger_data to postgres with grant option; | ||||
grant all privileges on all routines in schema tiger, tiger_data to postgres with grant option; | ||||
grant all privileges on all sequences in schema tiger, tiger_data to postgres with grant option; | ||||
alter default privileges in schema tiger, tiger_data grant all on tables to postgres with grant option; | ||||
alter default privileges in schema tiger, tiger_data grant all on routines to postgres with grant option; | ||||
alter default privileges in schema tiger, tiger_data grant all on sequences to postgres with grant option; | ||||
SET search_path TO extensions, public, tiger, tiger_data; | ||||
-- postgres role should have access | ||||
set local role postgres; | ||||
perform tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); | ||||
|
||||
BEGIN; | ||||
-- create postgis tiger as supabase_admin | ||||
create extension if not exists address_standardizer with schema extensions; | ||||
create extension if not exists postgis_tiger_geocoder cascade; | ||||
-- other roles can be granted access | ||||
grant usage on schema tiger, tiger_data to authenticated; | ||||
grant select on all tables in schema tiger, tiger_data to authenticated; | ||||
grant execute on all routines in schema tiger, tiger_data to authenticated; | ||||
|
||||
-- \ir ansible/files/postgresql_extension_custom_scripts/postgis_tiger_geocoder/after-create.sql | ||||
grant usage on schema tiger, tiger_data to postgres with grant option; | ||||
grant all privileges on all tables in schema tiger, tiger_data to postgres with grant option; | ||||
grant all privileges on all routines in schema tiger, tiger_data to postgres with grant option; | ||||
grant all privileges on all sequences in schema tiger, tiger_data to postgres with grant option; | ||||
alter default privileges in schema tiger, tiger_data grant all on tables to postgres with grant option; | ||||
alter default privileges in schema tiger, tiger_data grant all on routines to postgres with grant option; | ||||
alter default privileges in schema tiger, tiger_data grant all on sequences to postgres with grant option; | ||||
SET search_path TO extensions, public, tiger, tiger_data; | ||||
-- postgres role should have access | ||||
set local role postgres; | ||||
select tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); | ||||
-- authenticated role should have access now | ||||
set local role authenticated; | ||||
perform tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); | ||||
reset role; | ||||
|
||||
-- other roles can be granted access | ||||
grant usage on schema tiger, tiger_data to authenticated; | ||||
grant select on all tables in schema tiger, tiger_data to authenticated; | ||||
grant execute on all routines in schema tiger, tiger_data to authenticated; | ||||
|
||||
-- authenticated role should have access now | ||||
set local role authenticated; | ||||
select tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); | ||||
ROLLBACK; | ||||
|
||||
BEGIN; | ||||
-- address standardizer creates a table in extensions schema, owned by supabase_admin | ||||
create extension if not exists address_standardizer_data_us with schema extensions; | ||||
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. This Line 5 in 9eaaa41
but the logic that tests the postgres role is able to select |
||||
-- postgres role should have access | ||||
set local role postgres; | ||||
select * from extensions.us_lex; | ||||
ROLLBACK; | ||||
-- postgres role should have access to address_standardizer_data_us | ||||
set local role postgres; | ||||
perform 1 from us_lex; | ||||
reset role; | ||||
end if; | ||||
end | ||||
$_$; | ||||
rollback; |
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
BEGIN; | ||
create extension if not exists pgrouting with schema "extensions" cascade; | ||
ROLLBACK; | ||
begin; | ||
do $_$ | ||
begin | ||
if not exists (select 1 from pg_extension where extname = 'orioledb') then | ||
create extension if not exists pgrouting with schema "extensions" cascade; | ||
end if; | ||
end | ||
$_$; | ||
rollback; |
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
BEGIN; | ||
create extension if not exists timescaledb with schema "extensions"; | ||
ROLLBACK; | ||
begin; | ||
do $_$ | ||
begin | ||
if not exists (select 1 from pg_extension where extname = 'orioledb') then | ||
create extension if not exists timescaledb with schema "extensions"; | ||
end if; | ||
end | ||
$_$; | ||
rollback; |
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
BEGIN; | ||
create extension if not exists plv8 with schema "pg_catalog"; | ||
ROLLBACK; | ||
begin; | ||
do $_$ | ||
begin | ||
if not exists (select 1 from pg_extension where extname = 'orioledb') then | ||
create extension if not exists plv8 with schema "pg_catalog"; | ||
end if; | ||
end | ||
$_$; | ||
rollback; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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 exceptions from orioledb are now done properly using SQL on each test by checking if the orioledb extension is loaded. (there's no file removal needed)