hasura / hasura/graphql-engine

Console: Distinguish between different environments clearly

Open
#8,835 4 comments 3 reactions 0 assignees View on GitHub
c/console estimate/L k/enhancement t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?
Yes, it's a real story, I have my app in three environments (local development, test, and prod) and last week I just had open all of my environments in different tabs in my browser. I just wanted to test a SQL query in my localhost so I wrote my update query to update some rows and then I copied that from my editor to the SQL window in the Hasura console and clicked `Run` button and I realized all of the sudden that I run this script accidentally on my prod database.
Fortunately, I had a good backup that I restored. Also, my app is not so big and I did that at midnight when no user was logged in so I'm sure I'm good.
I asked my colleague and he also had the same issue before, so I think it's a common issue that may be happening to other users.

### Describe the solution you'd like
As a solution I think it's good to choose a different theme or color for each environment then it's clear visually that you are in which environment. For example something like this:

Prod Env:
![2022-08-23_13-48_1](https://user-images.githubusercontent.com/25859075/186150721-c6ae94dd-afcc-4129-939b-8a122c8c23a2.png)

Test Env:
![2022-08-23_13-48](https://user-images.githubusercontent.com/25859075/186150707-f3df7c4b-e106-4b99-b8a1-64f1e40c4d0d.png)

Local Env:
![2022-08-23_13-49](https://user-images.githubusercontent.com/25859075/186150740-d53b59af-c52c-498b-be5c-ac4829b49acf.png)

### Describe alternatives you've considered
We can add an environment variable flag or simple setting to set Hasura console as a `read only` mode then you can disable some dangerous features like: `SQL` or `mutations` or `edit` and `delete` button in the data viewer to prevent these actions in prod, something like this:
![2022-08-23_13-57](https://user-images.githubusercontent.com/25859075/186152057-e7956077-69bb-4879-b609-48a36330216a.png)

### If the feature is approved, would you be willing to submit a PR?
Unfortunately, I don't have a lot of time but I definitely try to contribute as much as I can.

Please use :+1: if you like this feature idea.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by reviewing the Hasura Console UI and its environment/configuration handling, then compare the proposed visual environment distinction with the alternative read-only mode; done means users can clearly identify the active environment before running or editing database operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, typescript
Domain
databases, frontend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.