jazzband/django-simple-history

View on GitHub
Deferred fields patch (#1393) #273
Jordan Hyatt authored 6c10248d
complete00:00:30
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
docker pull codeclimate/codeclimate-bandit:b866
b866: Pulling from codeclimate/codeclimate-bandit
a0e0ef996968: Pulling fs layer
00c69949e211: Pulling fs layer
124b11ffd9dc: Pulling fs layer
74d262bd6915: Pulling fs layer
963a4e0e1415: Pulling fs layer
ea041886215a: Pulling fs layer
3bbf7ff90c63: Pulling fs layer
963a4e0e1415: Waiting
ea041886215a: Waiting
3bbf7ff90c63: Waiting
74d262bd6915: Waiting
124b11ffd9dc: Verifying Checksum
124b11ffd9dc: Download complete
00c69949e211: Download complete
a0e0ef996968: Download complete
963a4e0e1415: Download complete
a0e0ef996968: Pull complete
ea041886215a: Verifying Checksum
ea041886215a: Download complete
3bbf7ff90c63: Verifying Checksum
3bbf7ff90c63: Download complete
00c69949e211: Pull complete
124b11ffd9dc: Pull complete
74d262bd6915: Verifying Checksum
74d262bd6915: Download complete
74d262bd6915: Pull complete
963a4e0e1415: Pull complete
ea041886215a: Pull complete
3bbf7ff90c63: Pull complete
Digest: sha256:b831294279e697e4402c0bd94153247577b1e1297055bac81a8e2922b4dedba5
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-bandit:b866
docker pull codeclimate/codeclimate-radon:b695
b695: Pulling from codeclimate/codeclimate-radon
e00d546a75ad: Pulling fs layer
21f0a0866768: Pulling fs layer
cd9d3946aa16: Pulling fs layer
2e56add6654f: Pulling fs layer
6c87f215a2be: Pulling fs layer
c2b31566ca3d: Pulling fs layer
2e56add6654f: Waiting
6c87f215a2be: Waiting
c2b31566ca3d: Waiting
21f0a0866768: Verifying Checksum
21f0a0866768: Download complete
e00d546a75ad: Verifying Checksum
e00d546a75ad: Download complete
e00d546a75ad: Pull complete
6c87f215a2be: Download complete
21f0a0866768: Pull complete
cd9d3946aa16: Verifying Checksum
cd9d3946aa16: Download complete
c2b31566ca3d: Verifying Checksum
c2b31566ca3d: Download complete
cd9d3946aa16: Pull complete
2e56add6654f: Verifying Checksum
2e56add6654f: Download complete
2e56add6654f: Pull complete
6c87f215a2be: Pull complete
c2b31566ca3d: Pull complete
Digest: sha256:dfeb7edc634b4e2f851f3c788f7c21bd8bae097d4c66af722c76a6ba51121f98
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-radon:b695
docker pull codeclimate/codeclimate-sonar-python:b10
b10: Pulling from codeclimate/codeclimate-sonar-python
709515475419: Pulling fs layer
d1c225ed7c34: Pulling fs layer
887f300163b6: Pulling fs layer
a3ed95caeb02: Pulling fs layer
9b412187b352: Pulling fs layer
8fe915fa1948: Pulling fs layer
65145a386a45: Pulling fs layer
a64dfb9c0f27: Pulling fs layer
59a464ab5a51: Pulling fs layer
47413513c002: Pulling fs layer
9f30da6d3676: Pulling fs layer
a64dfb9c0f27: Waiting
59a464ab5a51: Waiting
47413513c002: Waiting
9f30da6d3676: Waiting
8fe915fa1948: Waiting
a3ed95caeb02: Waiting
65145a386a45: Waiting
9b412187b352: Waiting
d1c225ed7c34: Verifying Checksum
d1c225ed7c34: Download complete
709515475419: Download complete
a3ed95caeb02: Verifying Checksum
a3ed95caeb02: Download complete
709515475419: Pull complete
9b412187b352: Verifying Checksum
9b412187b352: Download complete
d1c225ed7c34: Pull complete
65145a386a45: Verifying Checksum
65145a386a45: Download complete
887f300163b6: Verifying Checksum
887f300163b6: Download complete
59a464ab5a51: Download complete
8fe915fa1948: Verifying Checksum
8fe915fa1948: Download complete
a64dfb9c0f27: Verifying Checksum
a64dfb9c0f27: Download complete
887f300163b6: Pull complete
a3ed95caeb02: Pull complete
47413513c002: Verifying Checksum
47413513c002: Download complete
9b412187b352: Pull complete
9f30da6d3676: Verifying Checksum
9f30da6d3676: Download complete
8fe915fa1948: Pull complete
65145a386a45: Pull complete
a64dfb9c0f27: Pull complete
59a464ab5a51: Pull complete
47413513c002: Pull complete
9f30da6d3676: Pull complete
Digest: sha256:7904831e83e5474cba8a95726a691787d74d669d74a8721f114057ebb4a8943d
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-sonar-python:b10
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-11-21T08:38:54.019130 #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 156
    def get_default_settings(*, database_name=DEFAULT_DATABASE_NAME):
                              ^
SyntaxError: invalid syntax


I, [2024-11-21T08:38:54.059268 #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-11-21T08:38:54.073225 #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-11-21T08:38:54.075349 #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-11-21T08:38:54.087226 #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 32
    def as_instances(self) -> "HistoricalQuerySet":
                           ^
SyntaxError: invalid syntax


I, [2024-11-21T08:38:54.098766 #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-11-21T08:38:54.100270 #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-11-21T08:38:54.110372 #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-11-21T08:38:54.112051 #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-11-21T08:38:54.121881 #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-11-21T08:38:54.137076 #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 256
    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
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: 92 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 1036 column 4:

 1030: self,
 1031:         old_history: "HistoricalChanges",
 1032:         excluded_fields: Iterable[str] = None,
 1033:         included_fields: Iterable[str] = None,
 1034:         *,
 1035:         foreign_keys_are_objs=False,
  -->      ) -> "ModelDelta":
 1037:         """
 1038:         :param old_history:
 1039:         :param excluded_fields: The names of fields to exclude from diffing.
 1040:                This takes precedence over ``included_fields``.
 1041:         :param included_fields: The names of the only fields to include when diffing.
 1042:                If not provided, all history-tracked fields will be included.
 1043:         :param foreign_keys_are_objs: If ``False``, the returned diff will only contain
 1044:                the raw PKs of any ``ForeignKey`` fields.
 1045:                If ``True``, the diff will contain the actual related model objects
 1046:                instead of just the PKs; deleted related objects will be instances of
 1047:                ``DeletedObject``.
 1048:                Note that passing ``True`` will necessarily query the database if the
 1049:                related objects have not been prefetched (using e.g.
 1050:                ``select_related()``).
 1051:         """
 1052:         if not isinstance(old_history, type(self)):
 1053:             raise TypeError(
 1054:                 "unsupported type(s) for diffing:"
 1055:                 f" '{type(self)}' and '{type(old_history)}'"
 1056:             )
 1057: 

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