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

fix: Share resource to use REFERENCE_USAGE instead of USAGE #762

Merged
merged 4 commits into from
Nov 17, 2021

Conversation

joncourt
Copy link
Contributor

@joncourt joncourt commented Nov 17, 2021

Modified the share resource to use REFERENCE_USAGE instead of USAGE on the short lived TEMP db used to allow accounts to be attached to the share where a database isn't already associated. This was causing a conflict during an update action where accounts are modified because a share can be granted usage to only one database - and that is already taken by another database on the share during an update operation.

Note that the USAGE privilege will be automatically added to a share when REFERENCE_USAGE is granted to the first database assigned to the share so the revoke operation must remain. Where USAGE hasn't been granted a revoke operation is not an error so it is safe to leave the revoke in place for the cases where it's needed without a check.

I've also updated the readme with some actions I had to apply to get acceptance tests running in my local fork.

The SKIP_DATABASE_TESTS and SKIP_WAREHOUSE_TESTS variables didn't seem to stop tests that required an enterprise account - so I used a trial enterprise account and updated the readme to say to just use that.

I also had to set the REVIEWDOG_GITHUB_API_TOKEN variable with a token I'd given read/write privileges on the discussion - which I added to the readme.

Accounts still cannot be deleted using the share resource - I suspect that is by design? I did update that but reverted it because I realised it would pick up any manually added accounts and delete them too which scared me, particularly for our 'in use' public listings.

Test Plan

  • acceptance tests
  • relevant internal/unit tests updated in share_test.go

References

@joncourt joncourt closed this Nov 17, 2021
@joncourt joncourt reopened this Nov 17, 2021
@alldoami
Copy link
Contributor

/ok-to-test sha=45eefa8

@alldoami alldoami changed the title Allow share account update fix: Allow share account update Nov 17, 2021
@alldoami alldoami changed the title fix: Allow share account update fix: Share resource to use REFERENCE_USAGE instead of USAGE Nov 17, 2021
@github-actions
Copy link

Integration tests success for 45eefa8

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