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

executor/simple: prohibit setting a resource group to a role #54525

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Jul 9, 2024

What problem does this PR solve?

Issue Number: close #54417, ref #54434.

What changed and how does it work?

Check if a user is a role before assigning a resource group to it.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
image

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed labels Jul 9, 2024
@JmPotato
Copy link
Member Author

JmPotato commented Jul 9, 2024

/cc @nolouch @CbcWestwolf @tangenta

PTAL, thx.

@ti-chi-bot ti-chi-bot bot requested review from CbcWestwolf, nolouch and tangenta July 9, 2024 08:56
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 56.0809%. Comparing base (d8098b9) to head (34ca28f).
Report is 5 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54525         +/-   ##
=================================================
- Coverage   72.8280%   56.0809%   -16.7471%     
=================================================
  Files          1546       1667        +121     
  Lines        436236     609055     +172819     
=================================================
+ Hits         317702     341564      +23862     
- Misses        98945     244161     +145216     
- Partials      19589      23330       +3741     
Flag Coverage Δ
integration 37.3271% <44.4444%> (?)

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.6910% <ø> (+6.8067%) ⬆️

Copy link
Member

@CbcWestwolf CbcWestwolf left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@@ -379,6 +379,11 @@ create user user1;
ALTER USER `user1` RESOURCE GROUP `rg1`;
SELECT CURRENT_RESOURCE_GROUP();

create role role_for_resource_group;
Copy link
Member

Choose a reason for hiding this comment

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

Please add a simple create role role_for_resource_group resource group rg1; to cover s.IsCreateRole branch in executeCreateUser

Copy link
Member Author

Choose a reason for hiding this comment

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

CREATE ROLE syntax doesn't support setting the resource group, so it will directly return an error when parsing the SQL.

image

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 9, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 9, 2024
Copy link

ti-chi-bot bot commented Jul 9, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-09 09:33:23.035915533 +0000 UTC m=+350100.271149645: ☑️ agreed by CbcWestwolf.
  • 2024-07-09 09:56:11.954325959 +0000 UTC m=+351469.189560071: ☑️ agreed by nolouch.

Copy link

ti-chi-bot bot commented Jul 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CbcWestwolf, nolouch, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jul 9, 2024
@JmPotato
Copy link
Member Author

JmPotato commented Jul 9, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit cbf34c5 into pingcap:master Jul 9, 2024
23 checks passed
@JmPotato JmPotato deleted the fix_role_rc branch July 9, 2024 13:16
@JmPotato
Copy link
Member Author

JmPotato commented Jul 10, 2024

/cherry-pick release-7.5

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 10, 2024
@ti-chi-bot
Copy link
Member

@JmPotato: new pull request created to branch release-7.5: #54549.

In response to this:

/cherrypick release-7.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@nolouch
Copy link
Member

nolouch commented Jul 10, 2024

/cherry-pick release-8.1

@ti-chi-bot
Copy link
Member

@nolouch: new pull request created to branch release-8.1: #54551.

In response to this:

/cherry-pick release-8.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@JmPotato
Copy link
Member Author

/cherry-pick release-7.1

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 15, 2024
@ti-chi-bot
Copy link
Member

@JmPotato: new pull request created to branch release-7.1: #54628.

In response to this:

/cherry-pick release-7.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should report errror when create role with resource group
5 participants