Giter Site home page Giter Site logo

mariadb / feedback-plugin-backend Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 6.0 33.7 MB

Back End for the MariaDB Server Feedback Plugin

Home Page: https://mariadb.org/feedback_plugin

License: GNU General Public License v2.0

Dockerfile 1.36% Shell 0.28% Python 98.16% HTML 0.20%
feedback-plugin mariadb

feedback-plugin-backend's People

Contributors

an3l avatar andreiahendea avatar cvicentiu avatar dependabot[bot] avatar fauust avatar vainiovano avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

feedback-plugin-backend's Issues

MDBF-422: Create an index page

  • Currently there is no index page and it is not intuitive how to use the feedback plugin
Page not found (404)
Request Method: 	GET
Request URL: 	http://localhost:8000/

Using the URLconf defined in feedback_plugin.urls, Django tried these URL patterns, in this order:

    admin/
    rest/v1/server-count/ [name='server_count']
    rest/v1/version-breakdown/ [name='version_breakdown']
    rest/v1/architecture/ [name='architecture']
    rest/v1/os/ [name='os']
    rest/v1/file-post/ [name='file_post']

The empty path didn’t match any of these.

You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

MDBF-424: Multiple problems when running the tests

One should run tests from src/feedback/tests folder.

$ python manage.py test

However there are couple of problems:

1. Problem - missing alter grant

User has to have alter privilege on all tables

 ./manage.py test
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 73, in execute
    return self.cursor.execute(query, args)
  File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/MySQLdb/connections.py", line 254, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1142, "ALTER command denied to user 'feedback'@'localhost' for table 'django_content_type'")

One need to update the privilege in docker/mariadb/create_database_user.py as it was the example for me which privilege user should have.

  • Observation
    After setting up the alter privilege obtained in 1.problem, we can see that database is created (since we have create priv on all tables), but we need priv on test_feedback_plugin - just notification about reason of having the privilege.
$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_feedback_plugin'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_feedback_plugin', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
Got an error recreating the test database: (1044, "Access denied for user 'feedback'@'localhost' to database 'test_feedback_plugin'")

2. Problem - python 3.9 version of zoneinfo

$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_feedback_plugin'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_feedback_plugin', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
System check identified no issues (0 silenced).
.....E
======================================================================
ERROR: feedback_plugin.tests.test_process_raw_data (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: feedback_plugin.tests.test_process_raw_data
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/anel/mariadb/feedback-plugin-backend/src/feedback_plugin/tests/test_process_raw_data.py", line 3, in <module>
    from zoneinfo import ZoneInfo
ModuleNotFoundError: No module named 'zoneinfo'


----------------------------------------------------------------------
Ran 6 tests in 0.062s

FAILED (errors=1)
Destroying test database for alias 'default'...

Instead one should use alternative module backports.zoneinfo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.