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

Improve the text displayed when using the command line #6884

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

justinclift
Copy link
Member

@justinclift justinclift commented Apr 12, 2024

What type of PR is this?

  • Bug Fix

Description

A recent commit causes debugging level output to be shown to cli users. This PR removes that, and changes one of the related strings to be a useful message.

Before:

$ make create_database
docker compose run server create_db
[+] Creating 3/3
 ✔ Network redash_default       Created    0.1s 
 ✔ Container redash-postgres-1  Created    0.7s 
 ✔ Container redash-redis-1     Created    0.6s 
[+] Running 2/2
 ✔ Container redash-redis-1     Started    0.7s 
 ✔ Container redash-postgres-1  Started    0.8s 
Starting attempt 0 of 5
[2024-04-12 16:19:52,702][PID:8][INFO][xmlschema] Resource 'XMLSchema.xsd' is already loaded
[2024-04-12 16:19:53,711][PID:8][INFO][alembic.runtime.migration] Context impl PostgresqlImpl.
[2024-04-12 16:19:53,711][PID:8][INFO][alembic.runtime.migration] Will assume transactional DDL.
[2024-04-12 16:19:53,719][PID:8][INFO][alembic.runtime.migration] Running stamp_revision  -> 7205816877ec
[2024-04-12 16:20:02,092][PID:45][INFO][xmlschema] Resource 'XMLSchema.xsd' is already loaded
[2024-04-12 16:20:02,834][PID:45][INFO][alembic.runtime.migration] Context impl PostgresqlImpl.
[2024-04-12 16:20:02,835][PID:45][INFO][alembic.runtime.migration] Will assume transactional DDL.
Return code: 0
Status: [2024-04-12 16:20:11,159][PID:83][INFO][xmlschema] Resource 'XMLSchema.xsd' is already loaded
{
  "version": "24.04.0-dev",
  "workers": [],
  "redis_used_memory": 906664,
  "redis_used_memory_human": "885.41K",
  "queries_count": 0,
  "query_results_count": 0,
  "unused_query_results_count": 0,
  "dashboards_count": 0,
  "widgets_count": 0,
  "manager": {
    "queues": {}
  },
  "database_metrics": {
    "metrics": [
      [
        "Query Results Size",
        24576
      ],
      [
        "Redash DB Size",
        8753635
      ]
    ]
  }
}

After:

$ make create_database
docker compose run server create_db
[+] Creating 3/3
 ✔ Network redash_default       Created    0.1s 
 ✔ Container redash-postgres-1  Created    0.6s 
 ✔ Container redash-redis-1     Created    0.6s 
[+] Running 2/2
 ✔ Container redash-postgres-1  Started    0.8s 
 ✔ Container redash-redis-1     Started    0.8s 
Creating or updating Redash database, attempt 1 of 5
[2024-04-12 16:17:46,224][PID:8][INFO][xmlschema] Resource 'XMLSchema.xsd' is already loaded
[2024-04-12 16:17:47,235][PID:8][INFO][alembic.runtime.migration] Context impl PostgresqlImpl.
[2024-04-12 16:17:47,235][PID:8][INFO][alembic.runtime.migration] Will assume transactional DDL.
[2024-04-12 16:17:47,243][PID:8][INFO][alembic.runtime.migration] Running stamp_revision  -> 7205816877ec
[2024-04-12 16:17:55,631][PID:45][INFO][xmlschema] Resource 'XMLSchema.xsd' is already loaded
[2024-04-12 16:17:56,381][PID:45][INFO][alembic.runtime.migration] Context impl PostgresqlImpl.
[2024-04-12 16:17:56,381][PID:45][INFO][alembic.runtime.migration] Will assume transactional DDL.

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)

This removes some debugging output, and makes an unexpected text
string useful by explaining what's happening.
@justinclift
Copy link
Member Author

@AndrewChubatiuk That debugging output turned out to be a bit of a (small) problem after all.

So, this PR is removing that and making the loop counter notice a bit friendlier.

@justinclift justinclift marked this pull request as ready for review April 12, 2024 16:37
@AndrewChubatiuk
Copy link
Contributor

LGTM!

@justinclift
Copy link
Member Author

Thanks heaps @AndrewChubatiuk. 😄

@justinclift justinclift merged commit b9875a2 into master Apr 13, 2024
14 checks passed
@justinclift justinclift deleted the cli_text_improvement_v1 branch April 13, 2024 01:51
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