jazzband/django-simple-history

View on GitHub
Merge pull request #1128 from raunaq-sailo/feat/adding-history-diff #266
Anders authored b8c1a0c0
complete00:00:16
Your first build completed successfully!

Congratulations

Your first build completed successfully!

See the Results

1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
WARNING: engine radon: unrecognized key 'threshold'
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
I, [2024-05-07T04:15:17.162385 #1]  INFO -- : Skipping file runtests.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 160
    def get_default_settings(*, database_name=DEFAULT_DATABASE_NAME):
                              ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.204849 #1]  INFO -- : Skipping file ./simple_history/management/commands/clean_duplicate_history.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 79
    self.log(f"{model} has {found} historical entries", 2)
                                                     ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.214012 #1]  INFO -- : Skipping file ./simple_history/management/commands/populate_history.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 85
    self.stderr.write(f"{e}\n")
                             ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.218659 #1]  INFO -- : Skipping file ./simple_history/management/commands/clean_old_history.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 63
    self.log(f"{model} has {found} old historical entries", 2)
                                                         ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.230800 #1]  INFO -- : Skipping file simple_history/manager.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 269
    },
     ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.244125 #1]  INFO -- : Skipping file simple_history/template_utils.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 14
    def conditional_str(obj: Any) -> str:
                           ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.250789 #1]  INFO -- : Skipping file simple_history/admin.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 112
    self, request, history_manager: HistoryManager, pk_name: str, object_id: Any
                                  ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.256278 #1]  INFO -- : Skipping file simple_history/__init__.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 12
    **records_config,
                    ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.263396 #1]  INFO -- : Skipping file simple_history/middleware.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 33
    async def middleware(request):
            ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.267799 #1]  INFO -- : Skipping file simple_history/utils.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 34
    raise NotHistoricalModelError(f"Cannot find a historical model for {model}.")
                                                                               ^
SyntaxError: invalid syntax


I, [2024-05-07T04:15:17.280602 #1]  INFO -- : Skipping file simple_history/models.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 253
    return f"{self.DEFAULT_MODEL_NAME_PREFIX}{model._meta.object_name}"
                                                                      ^
SyntaxError: invalid syntax
7
bandit
bandit engine documentation
View output
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: None
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[node_visitor]	INFO	Unable to find qualified name for module: runtests.py
[node_visitor]	INFO	Unable to find qualified name for module: setup.py
8
radon
radon engine documentation
View output
Running radon3...
9
sonar-python
sonar-python engine documentation
View output
INFO: Java 1.8.0_111-internal Oracle Corporation (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: Invalid character encountered in file '/code/simple_history/locale/nb/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/ru_RU/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/ur/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/cs_CZ/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/de/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/zh_Hans/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/fr/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/pt_BR/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/pl/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/ar/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/id/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/3_poll_reverted.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/5_history_list_display.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/1_poll_history.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/4_history_after_poll_reverted.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/10_revert_disabled.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/2_revert.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 94 files indexed
ERROR: Unable to parse file: /code/simple_history/template_utils.py
ERROR: Parse error at line 39 column 44:

   23: (s: Any) -> bool:
   24:     """
   25:     Returns whether ``s`` is a (presumably) pre-escaped string or not.
   26: 
   27:     This relies on the same ``__html__`` convention as Django's ``conditional_escape``
   28:     does.
   29:     """
   30:     return hasattr(s, "__html__")
   31: 
   32: 
   33: class HistoricalRecordContextHelper:
   34:     """
   35:     Class containing various utilities for formatting the template context for
   36:     a historical record.
   37:     """
   38: 
  -->      DEFAULT_MAX_DISPLAYED_DELTA_CHANGE_CHARS: Final = 100
   40: 
   41:     def __init__(
   42:         self,
   43:         model: Type[Model],
   44:         historical_record: HistoricalChanges,
   45:         *,
   46:         max_displayed_delta_change_chars=DEFAULT_MAX_DISPLAYED_DELTA_CHANGE_CHARS,
   47:     ):
   48: 

ERROR: Unable to parse file: /code/simple_history/admin.py
ERROR: Parse error at line 124 column 10:

  109: 
  110: 
  111:     def get_history_queryset(
  112:         self, request, history_manager: HistoryManager, pk_name: str, object_id: Any
  113:     ) -> QuerySet:
  114:         """
  115:         Return a ``QuerySet`` of all historical records that should be listed in the
  116:         ``object_history_list_template`` template.
  117:         This is used by ``history_view()``.
  118: 
  119:         :param request:
  120:         :param history_manager:
  121:         :param pk_name: The name of the original model's primary key field.
  122:         :param object_id: The primary key of the object whose history is listed.
  123:         """
  -->          qs: HistoricalQuerySet = history_manager.filter(**{pk_name: object_id})
  125:         if not isinstance(history_manager.model.history_user, property):
  126: 
  127:             

ERROR: Unable to parse file: /code/simple_history/__init__.py
ERROR: Parse error at line 12 column 20:

    3: metadata.version("django-simple-history")
    4: 
    5: 
    6: def register(
    7:     model,
    8:     app=None,
    9:     manager_name="history",
   10:     records_class=None,
   11:     table_name=None,
  -->      **records_config,
   13: ):
   14:     """
   15:     Create historical model for `model` and attach history manager to `model`.
   16: 
   17:     Keyword arguments:
   18:     app -- App to install historical model into (defaults to model.__module__)
   19:     manager_name -- class attribute name to use for historical manager
   20:     records_class -- class to use for history relation (defaults to
   21:         HistoricalRecords)
   22:     table_name -- Custom name for history table (defaults to
   23:         'APPNAME_historicalMODELNAME')
   24: 
   25:     This method should be used as an alternative to attaching an
   26:     `HistoricalManager` instance directly to `model`.
   27:     """
   28:     from . import models
   29: 
   30:     if records_class is None:
   31:         records_class = models.HistoricalRecords
   32: 
   33:     records = records_class(

ERROR: Unable to parse file: /code/simple_history/models.py
ERROR: Parse error at line 954 column 4:

  948: self,
  949:         old_history: "HistoricalChanges",
  950:         excluded_fields: Iterable[str] = None,
  951:         included_fields: Iterable[str] = None,
  952:         *,
  953:         foreign_keys_are_objs=False,
  -->      ) -> "ModelDelta":
  955:         """
  956:         :param old_history:
  957:         :param excluded_fields: The names of fields to exclude from diffing.
  958:                This takes precedence over ``included_fields``.
  959:         :param included_fields: The names of the only fields to include when diffing.
  960:                If not provided, all history-tracked fields will be included.
  961:         :param foreign_keys_are_objs: If ``False``, the returned diff will only contain
  962:                the raw PKs of any ``ForeignKey`` fields.
  963:                If ``True``, the diff will contain the actual related model objects
  964:                instead of just the PKs; deleted related objects will be instances of
  965:                ``DeletedObject``.
  966:                Note that passing ``True`` will necessarily query the database if the
  967:                related objects have not been prefetched (using e.g.
  968:                ``select_related()``).
  969:         """
  970:         if not isinstance(old_history, type(self)):
  971:             raise TypeError(
  972:                 "unsupported type(s) for diffing:"
  973:                 f" '{type(self)}' and '{type(old_history)}'"
  974:             )
  975: 

INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.590s
INFO: Final Memory: 6M/295M
INFO: ------------------------------------------------------------------------