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

Add next and previous record diffs #798

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
9c2952d
Add next and previous record diffs
brylie Feb 19, 2021
c3c48ed
Fix typo
brylie Feb 19, 2021
4d71615
Updated test matrix -- Django Dev dropped support for Python3.6 and 3…
smithdc1 Feb 20, 2021
81267fc
Bump tox from 3.21.4 to 3.22.0 in /requirements (#796)
dependabot[bot] Feb 20, 2021
d3bd356
Bump sphinx from 3.4.3 to 3.5.1 in /requirements (#795)
dependabot[bot] Feb 20, 2021
86a2ff1
Bump coverage from 5.4 to 5.5 in /requirements (#801)
dependabot[bot] Mar 1, 2021
0de0649
Bump tox from 3.22.0 to 3.23.0 in /requirements (#802)
dependabot[bot] Mar 5, 2021
0a550c7
Bump sphinx from 3.5.1 to 3.5.2 in /requirements (#805)
dependabot[bot] Mar 9, 2021
9852eea
Rename Django's dev branch to main. (#807)
jezdez Mar 10, 2021
418716e
Bump flake8 from 3.8.4 to 3.9.0 in /requirements (#808)
dependabot[bot] Mar 15, 2021
1196c4b
Bump tox-gh-actions from 2.4.0 to 2.5.0 in /requirements (#814)
dependabot[bot] Apr 9, 2021
e206143
Bump sphinx from 3.5.2 to 3.5.3 in /requirements (#810)
dependabot[bot] Apr 9, 2021
3b2d2c5
Bump isort from 5.7.0 to 5.8.0 in /requirements (#809)
dependabot[bot] Apr 9, 2021
b07bd50
Remove Python 3.5 from doc.
hramezani Apr 15, 2021
b23bad4
Increase black and isort python version to 3.6.
hramezani Apr 15, 2021
d46fe6f
Remove Django 3.0 support.
hramezani Apr 15, 2021
d288869
Add Django 3.2 support.
hramezani Apr 15, 2021
723462c
Improve French translations (#811)
LeMinaw Apr 16, 2021
02d0e9b
Bump sphinx from 3.5.3 to 3.5.4 in /requirements (#815)
dependabot[bot] Apr 16, 2021
c888fcf
Bump flake8 from 3.9.0 to 3.9.1 in /requirements (#818)
dependabot[bot] Apr 16, 2021
67c7c43
Remove changeReason and update CHANGES to prepare for 3.0.0 (#819)
barm Apr 16, 2021
df66df4
fix title underline (#820)
barm Apr 16, 2021
3e3f152
Bump tox from 3.23.0 to 3.23.1 in /requirements (#827)
dependabot[bot] May 23, 2021
9089032
Bump sphinx from 3.5.4 to 4.0.2 in /requirements (#834)
dependabot[bot] May 23, 2021
2f49d25
Bump black from 20.8.b1 to 21.5b1 in /requirements (#831)
dependabot[bot] May 23, 2021
1994277
Bump flake8 from 3.9.1 to 3.9.2 in /requirements (#828)
dependabot[bot] May 24, 2021
b1a031c
Fix documentation display issue (#835)
dracos May 31, 2021
666b6a6
Fix bug where descriptor class missed instance=None case (#822)
hwalinga May 31, 2021
a79b1db
Bump isort from 5.8.0 to 5.9.1 in /requirements (#843)
dependabot[bot] Jun 30, 2021
45fd122
Bump black from 21.5b1 to 21.6b0 in /requirements (#840)
dependabot[bot] Jun 30, 2021
bcc92d0
Bump psycopg2-binary from 2.8.6 to 2.9.1 in /requirements (#841)
dependabot[bot] Jun 30, 2021
af9bad0
Bump sphinx from 4.0.2 to 4.0.3 in /requirements (#844)
dependabot[bot] Jul 7, 2021
f686c62
Bump isort from 5.9.1 to 5.9.2 in /requirements (#845)
dependabot[bot] Jul 15, 2021
7567ead
Bump sphinx from 4.0.3 to 4.1.0 in /requirements (#848)
dependabot[bot] Jul 15, 2021
19ba5f3
Bump tox-gh-actions from 2.5.0 to 2.6.0 in /requirements (#849)
dependabot[bot] Jul 15, 2021
be7b8b6
Bump tox from 3.23.1 to 3.24.1 in /requirements (#857)
dependabot[bot] Aug 2, 2021
d1e5851
Change `make docs` and `make format` to use tox so they succeed.
jeking3 Aug 11, 2021
3e7708b
Update quick_start.rst
christianhpoe Jul 26, 2021
aebb6c8
Bump tox from 3.24.1 to 3.24.3 in /requirements
dependabot[bot] Aug 23, 2021
15d793a
Bump black from 21.6b0 to 21.7b0 in /requirements
dependabot[bot] Jul 16, 2021
4640fb6
Bump sphinx from 4.1.0 to 4.1.2 in /requirements
dependabot[bot] Jul 27, 2021
9dd8607
Bump isort from 5.9.2 to 5.9.3 in /requirements
dependabot[bot] Jul 29, 2021
bc9ee72
Remove previous code of conduct.
tim-schilling Aug 28, 2021
f991809
Merge pull request #874 from tim-schilling/jazzband/code-of-conduct
sarathak Aug 28, 2021
a63eec8
Merge pull request #860 from cloudtruth/issue-859
sarathak Aug 28, 2021
c74332d
Ensure that latest() is idempotent. (#862)
jeking3 Sep 1, 2021
f95225a
Bump black from 21.7b0 to 21.8b0 in /requirements
dependabot[bot] Sep 1, 2021
9195e56
Bump black from 21.8b0 to 21.9b0 in /requirements
dependabot[bot] Sep 14, 2021
3b97e7e
Bump tox-gh-actions from 2.6.0 to 2.7.0 in /requirements
dependabot[bot] Sep 13, 2021
8993c8a
Fix pk error (#806)
ddusi Sep 16, 2021
c5943f4
Bump tox from 3.24.3 to 3.24.4 in /requirements
dependabot[bot] Sep 16, 2021
e3065b9
Optimise next prev record (#791)
RealOrangeOne Sep 16, 2021
92a3715
Initial diff tests
Sep 17, 2021
23a7408
Fix diff perspective for clearer semantics
Sep 17, 2021
2ea9fc9
Bump sphinx from 4.1.2 to 4.2.0 in /requirements
dependabot[bot] Sep 13, 2021
a721cb8
Added: Czech translations
Sep 18, 2021
650213f
Changed: Translation header for cs
rdurica Sep 20, 2021
2ffc483
Simply check the history attributes rather than serializing.
RealOrangeOne Jan 6, 2021
68497f3
Add support for `included_fields` when diffing
RealOrangeOne Jan 6, 2021
677aa51
Add `assertNumQueries` assertions to ensure no queries are run
RealOrangeOne Jan 6, 2021
09b5078
Document new `included_fields` argument to `diff_against`
RealOrangeOne Jan 6, 2021
afd572b
Update changelog with #776 changes
RealOrangeOne Jan 6, 2021
bc210ac
Reuse `model_to_dict`
RealOrangeOne Jan 12, 2021
65c66b6
Fail hard if an unknown field is provided
RealOrangeOne Sep 22, 2021
e7c4cf4
Bump tox-gh-actions from 2.7.0 to 2.8.0 in /requirements
dependabot[bot] Sep 22, 2021
b0b998c
Bump tox-gh-actions from 2.8.0 to 2.8.1 in /requirements
dependabot[bot] Sep 24, 2021
f38a77b
Add index to `history_date` field to improve performance.
nex2hex Aug 11, 2021
2a22590
add missing changelog for gh-885
jeking3 Sep 29, 2021
f5340e5
On off flag (#832)
DanialErfanian Oct 3, 2021
353a4ab
Bump coverage from 5.5 to 6.0 in /requirements
dependabot[bot] Oct 4, 2021
acf47b7
Add excluded_field_kwargs to support custom OneToOneFields. (#871)
tim-schilling Oct 6, 2021
83ee3db
Fix that #871 was not rebased on latest
jeking3 Oct 7, 2021
6dc604d
Jazzband: Created local 'CODE_OF_CONDUCT.md' from remote 'CODE_OF_CON…
jazzband-bot Oct 21, 2021
0c2457f
add pre-commit checks for better CI and fix CI error
jeking3 Oct 13, 2021
25bb5b2
Merge pull request #896 from cloudtruth/jking/fix-pre-commit
tim-schilling Oct 25, 2021
462a7ea
Bump flake8 from 3.9.2 to 4.0.1 in /requirements
dependabot[bot] Oct 25, 2021
d8e5602
Bump coverage from 6.0 to 6.0.2 in /requirements
dependabot[bot] Oct 25, 2021
8215eb9
allow for running tests with break on error
jeking3 Sep 29, 2021
1b9c3a5
Add next and previous record diffs
brylie Feb 19, 2021
744fb6a
Fix typo
brylie Feb 19, 2021
cad8348
Initial diff tests
Sep 17, 2021
89c63fb
Fix diff perspective for clearer semantics
Sep 17, 2021
9f6a878
Merge branch 'next-and-previous-diff' of https://github.com/jazzband/…
Oct 26, 2021
7ed2f86
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 26, 2021
4ca849c
Lint/fix typo
Oct 26, 2021
780581f
Merge branch 'next-and-previous-diff' of https://github.com/jazzband/…
Oct 26, 2021
7598ff5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 26, 2021
127f4e0
Remove duplicate test case
Oct 26, 2021
4db4a2a
Merge branch 'next-and-previous-diff' of https://github.com/jazzband/…
Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: "2" # required to adjust maintainability checks
checks:
argument-count:
Expand Down Expand Up @@ -26,10 +27,10 @@ checks:
threshold: 4
similar-code:
config:
threshold: 50 # language-specific defaults. an override will affect all languages.
threshold: 50 # language-specific defaults. an override will affect all languages.
identical-code:
config:
threshold: # language-specific defaults. an override will affect all languages.
threshold: # language-specific defaults. an override will affect all languages.
plugins:
bandit:
enabled: true
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: "pip"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: Release

on:
push:
tags:
- '*'
- '*'

jobs:
build:
Expand Down
71 changes: 39 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
---
name: Test

on: [push, pull_request]

jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
django-version: ['2.2', '3.0', '3.1', 'dev']
django-version: ['2.2', '3.1', '3.2', 'main']

exclude:
- python-version: '3.6'
django-version: 'main'
- python-version: '3.7'
django-version: 'main'

services:

Expand Down Expand Up @@ -45,39 +52,39 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/tox.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/tox.txt

- name: Tox tests
run: |
tox -v
env:
DJANGO: ${{ matrix.django-version }}
- name: Tox tests
run: |
tox -v
env:
DJANGO: ${{ matrix.django-version }}

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
hooks:
- id: bandit
args:
- "-x *test*.py"

- repo: https://github.com/ambv/black
rev: 21.9b0
hooks:
- id: black
language_version: python3.8

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args:
- "--config=tox.ini"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: requirements-txt-fixer
files: requirements/.*\.txt$
- id: trailing-whitespace
- id: check-added-large-files
- id: fix-byte-order-marker
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
args:
- "--strict"
13 changes: 13 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# allow "on" until yamllint stops checking keys for truthy!
# https://github.com/adrienverge/yamllint/issues/158
---
extends: default

rules:
comments-indentation: disable
braces: disable
line-length:
max: 120
truthy:
level: error
allowed-values: ['true', 'false', 'on']
7 changes: 7 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ Authors
- Hamish Downer
- Hanyin Zhang
- Hernan Esteves (`sevetseh28 <https://github.com/sevetseh28>`_)
- Hielke Walinga (`hwalinga <https://github.com/hwalinga>`_)
- Jack Cushman (`jcushman <https://github.com/jcushman>`_)
- Jake Howard (`RealOrangeOne <https://github.com/realorangeone>`_)
- James Muranga (`jamesmura <https://github.com/jamesmura>`_)
- James Pulec
- Jesse Shapiro
- Jihoon Baek (`jihoon796 <https://github.com/jihoon796>`_)
- Jim Gomez
- Jim King (`jeking3 <https://github.com/jeking3>`_)
- Joao Junior (`joaojunior <https://github.com/joaojunior>`_)
- Joao Pedro Francese
- `jofusa <https://github.com/jofusa>`_
Expand Down Expand Up @@ -92,6 +95,7 @@ Authors
- Rajesh Pappula
- Ray Logel
- Raynald de Lahondes
- Renaud Perrin (`leminaw <https://github.com/leminaw>`_)
- Roberto Aguilar
- Rod Xavier Bondoc
- Ross Lote
Expand All @@ -103,6 +107,7 @@ Authors
- Stefan Borer (`sbor23 <https://github.com/sbor23>`_)
- Steven Buss (`sbuss <https://github.com/sbuss>`_)
- Steven Klass
- Tim Schilling (`tim-schilling <https://github.com/tim-schilling>`_)
- Tommy Beadle (`tbeadle <https://github.com/tbeadle>`_)
- Trey Hunner (`treyhunner <https://github.com/treyhunner>`_)
- Ulysses Vilela
Expand All @@ -112,6 +117,8 @@ Authors
- `Alex Todorov <https://github.com/atodorov>`_
- David Smith (`smithdc1 <https://github.com/smithdc1>`_)
- Shi Han Ng (`shihanng <https://github.com/shihanng>`_)
- `ddusi <https://github.com/ddusi>`_
- `DanialErfanian <https://github.com/DanialErfanian>`_

Background
==========
Expand Down
36 changes: 36 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,49 @@ Changes

Unreleased
----------

Upgrade Implications:

- Run `makemigrations` after upgrading to realize the benefit of indexing changes.

Full list of changes:

- Added index on `history_date` column; opt-out with setting `SIMPLE_HISTORY_DATE_INDEX` (gh-565)
- Added ``excluded_field_kwargs`` to support custom ``OneToOneField`` that have
additional arguments that don't exist on ``ForeignKey``. (gh-870)
- Fixed ``prev_record`` and ``next_record`` performance when using ``excluded_fields`` (gh-791)
- Fixed `update_change_reason` in pk (gh-806)
- Fixed bug where serializer of djangorestframework crashed if used with ``OrderingFilter`` (gh-821)
- Fixed `make format` so it works by using tox (gh-859)
- Fixed bug where latest() is not idempotent for identical ``history_date`` records (gh-861)
- Support ``included_fields`` for ``history.diff_against`` (gh-776)
- Improve performance of ``history.diff_against`` by reducing number of queries to 0 in most cases (gh-776)
- Added Czech translations (gh-885)
- Added pre-commit for better commit quality (gh-896)
- Added ability to break into debugger on unit test failure (gh-890)

3.0.0 (2021-04-16)
------------------

Breaking changes:

- Removed support for Django 3.0
- Removed `changeReason` in favor of `_change_reason` (see 2.10.0)

Full list of changes:

- Removed support for Django versions prior to 2.2 (gh-652)
- Migrate from TravisCI to Github Actions (gh-739)
- Add Python 3.9 support (gh-745)
- Support ``ignore_conflicts`` in ``bulk_create_with_history`` (gh-733)
- Use ``asgiref`` when available instead of thread locals (gh-747)
- Sort imports with isort (gh-751)
- Queryset ``history.as_of`` speed improvements by calculating in the DB (gh-758)
- Increase `black` and `isort` python version to 3.6 (gh-817)
- Remove Django 3.0 support (gh-817)
- Add Django 3.2 support (gh-817)
- Improve French translations (gh-811)
- Remove support for changeReason (gh-819)

2.12.0 (2020-10-14)
-------------------
Expand Down
82 changes: 41 additions & 41 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
# Contributor Covenant Code of Conduct
# Code of Conduct

## Our Pledge
As contributors and maintainers of the Jazzband projects, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
We are committed to making participation in the Jazzband a harassment-free experience
for everyone, regardless of the level of experience, gender, gender identity and
expression, sexual orientation, disability, personal appearance, body size, race,
ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ross@cadre.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses,
without explicit permission
- Other unethical or unprofessional conduct

The Jazzband roadies have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are not
aligned to this Code of Conduct, or to ban temporarily or permanently any contributor
for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, the roadies commit themselves to fairly and
consistently applying these principles to every aspect of managing the jazzband
projects. Roadies who do not follow or enforce the Code of Conduct may be permanently
removed from the Jazzband roadies.

This code of conduct applies both within project spaces and in public spaces when an
individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
contacting the roadies at `roadies@jazzband.co`. All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and appropriate to
the circumstances. Roadies are obligated to maintain confidentiality with regard to the
reporter of an incident.

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version
1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version]

[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/3/0/
Loading