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

Plugin E2E: Fix - skip creating user if it's the default server admin #941

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

sunker
Copy link
Contributor

@sunker sunker commented Jun 3, 2024

What this PR does / why we need it:

This PR fixes an issue related to creating user that was introduced in [email protected] (this PR).

In that PR, user became a Playwright option with a default value of admin:admin. Since the default user is always provided, plugin-e2e would try to create if. Normally this should be fine - if the user already exist, server will return a 412 which will be logged and swallowed by plugin-e2e. However, that doesn't seem to be the case when it's trying to create the server admin account. Then we're getting the following error:

  Error: Could not create user 'admin': {
      "accessErrorId": "ACE8544459724",
      "message": "You'll need additional permissions to perform this action. Permissions needed: users:create",
      "title": "Access denied"
    }

The solution is to not create user if its username and pass matches the default users.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
Some of the scaffolding tests in CI were failing because they were using the broken 1.3.0 version of plugin-e2e which this PR aims to fix. So I have to pin the plugin-e2e version to 1.2.0 to get those tests to work. Will open a follow up PR that changes version to ^1.3.1 as soon as it's released.

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/[email protected]
npm install @grafana/[email protected]
# or 
yarn add @grafana/[email protected]
yarn add @grafana/[email protected]

Copy link

github-actions bot commented Jun 3, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new patch release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

@sunker sunker added patch Increment the patch version when merged release Create a release when this pr is merged labels Jun 3, 2024
@sunker sunker force-pushed the plugin-e2e/fix-create-user-issue branch 2 times, most recently from 68c98d7 to 5d282e6 Compare June 4, 2024 07:22
@sunker sunker added the type/bug Something isn't working label Jun 4, 2024
@sunker sunker marked this pull request as ready for review June 4, 2024 08:02
@sunker sunker requested a review from a team as a code owner June 4, 2024 08:02
@sunker sunker requested review from oshirohugo and removed request for a team June 4, 2024 08:02
@sunker sunker merged commit 468535b into main Jun 4, 2024
20 checks passed
@sunker sunker deleted the plugin-e2e/fix-create-user-issue branch June 4, 2024 08:02
@grafana-plugins-platform-bot
Copy link

🚀 PR was released in @grafana/[email protected], @grafana/[email protected] 🚀

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot added the released This issue/pull request has been released. label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released. type/bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

2 participants