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

chore: don't use a seperate schema for views_and_triggers #9392

Merged
merged 4 commits into from
May 20, 2024

Conversation

NicholasBlaskey
Copy link
Contributor

@NicholasBlaskey NicholasBlaskey commented May 20, 2024

Ticket

Description

Instead of making views_and_triggers use a separate schema just require people to manually drop them.

Using a separate schema requires us to set the search path requiring extra permissions. Avoid needing more database permissions with this change.

Test Plan

intg passes

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@NicholasBlaskey NicholasBlaskey requested a review from a team as a code owner May 20, 2024 15:41
@cla-bot cla-bot bot added the cla-signed label May 20, 2024
Copy link

netlify bot commented May 20, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit b4714b4
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/664b9f431a2f700008c3688c

Copy link

codecov bot commented May 20, 2024

Codecov Report

Attention: Patch coverage is 53.84615% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 46.01%. Comparing base (0ff09e0) to head (b4714b4).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9392      +/-   ##
==========================================
- Coverage   46.03%   46.01%   -0.02%     
==========================================
  Files        1228     1228              
  Lines      155889   155874      -15     
  Branches     2440     2440              
==========================================
- Hits        71756    71729      -27     
- Misses      83942    83954      +12     
  Partials      191      191              
Flag Coverage Δ
backend 41.81% <53.84%> (-0.05%) ⬇️
harness 64.10% <ø> (ø)
web 38.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
master/internal/db/postgres.go 51.46% <ø> (-2.80%) ⬇️
master/internal/db/migrations.go 62.74% <53.84%> (-3.49%) ⬇️

... and 3 files with indirect coverage changes

@@ -116,10 +116,13 @@ func ensureMigrationUpgrade(tx *pg.Tx) error {
return nil
}

func (db *PgDB) readDBCodeAndCheckIfDifferent(dbCodeDir string) (map[string]string, bool, error) {
files, err := os.ReadDir(dbCodeDir)
func (db *PgDB) readDBCodeAndCheckIfDifferent(
Copy link
Member

Choose a reason for hiding this comment

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

This is really in need of named return values, or a doc comment or something.

Copy link
Contributor

@eecsliu eecsliu 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! My only thought is it'd be nice to check the hash and decide whether to apply changes without having to pass around the hash and bool vars, but that looks difficult to do and I'm ok without it.

@NicholasBlaskey
Copy link
Contributor Author

looks good! My only thought is it'd be nice to check the hash and decide whether to apply changes without having to pass around the hash and bool vars, but that looks difficult to do and I'm ok without it.

Yeah I agree it isn't great. Not sure how to improve it though.

@NicholasBlaskey NicholasBlaskey merged commit 5480c57 into main May 20, 2024
79 of 96 checks passed
@NicholasBlaskey NicholasBlaskey deleted the dont_use_a_seperate_schema_for_views branch May 20, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants