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

Replaces choice field segment status with boolean #166

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jberghoef
Copy link
Contributor

Fixes #149

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename this migration to describe what it is changing?

self.status = (
self.STATUS_ENABLED if self.status == self.STATUS_DISABLED
else self.STATUS_DISABLED)
self.enabled = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be able to shorten this to self.enabled = not self.enabled but not sure if that is good practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit before implicit right?

@jberghoef jberghoef force-pushed the feature/segment-status-boolean branch from 435af54 to 5cd5d4f Compare August 10, 2017 13:49
@codecov
Copy link

codecov bot commented Aug 11, 2017

Codecov Report

Merging #166 into master will decrease coverage by 0.02%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
- Coverage   67.51%   67.48%   -0.03%     
==========================================
  Files          55       56       +1     
  Lines        2358     2362       +4     
==========================================
+ Hits         1592     1594       +2     
- Misses        766      768       +2
Impacted Files Coverage Δ
tests/factories/segment.py 100% <100%> (ø) ⬆️
src/wagtail_personalisation/views.py 50% <100%> (ø) ⬆️
tests/unit/test_factories.py 100% <100%> (ø) ⬆️
...ation/migrations/0013_segment_status_as_boolean.py 100% <100%> (ø)
src/wagtail_personalisation/receivers.py 100% <100%> (ø) ⬆️
tests/unit/test_adapter_session.py 100% <100%> (ø) ⬆️
src/wagtail_personalisation/models.py 84.14% <66.66%> (-0.56%) ⬇️
src/wagtail_personalisation/adapters.py 23.83% <0%> (-0.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d9e4aa...c55e88a. Read the comment docs.

@blurrah blurrah changed the base branch from master to feature/djangoconf-sprint May 26, 2018 13:15
@jberghoef jberghoef force-pushed the feature/segment-status-boolean branch from c55e88a to 2574d29 Compare May 26, 2018 13:55
@codecov-io
Copy link

codecov-io commented May 26, 2018

Codecov Report

Merging #166 into master will decrease coverage by 0.34%.
The diff coverage is 70.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
- Coverage   92.83%   92.49%   -0.35%     
==========================================
  Files          66       67       +1     
  Lines        2010     2024      +14     
==========================================
+ Hits         1866     1872       +6     
- Misses        144      152       +8
Impacted Files Coverage Δ
tests/unit/test_static_dynamic_segments.py 100% <100%> (ø) ⬆️
src/wagtail_personalisation/receivers.py 100% <100%> (ø) ⬆️
tests/unit/test_factories.py 100% <100%> (ø) ⬆️
src/wagtail_personalisation/views.py 63.63% <100%> (ø) ⬆️
tests/unit/test_adapter_session.py 100% <100%> (ø) ⬆️
tests/factories/segment.py 100% <100%> (ø) ⬆️
...ation/migrations/0024_segment_status_as_boolean.py 52.94% <52.94%> (ø)
src/wagtail_personalisation/models.py 94.59% <66.66%> (-0.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a47803e...acd273c. Read the comment docs.

@jberghoef jberghoef force-pushed the feature/segment-status-boolean branch 3 times, most recently from 7b16fd6 to 8d07361 Compare May 31, 2018 08:47
@jberghoef jberghoef changed the base branch from feature/djangoconf-sprint to master May 31, 2018 08:48
('wagtail_personalisation', '0020_rules_delete_relatedqueryname'),
]

operations = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status data will be lost without a multi-step migration which:

  1. create the new field
  2. populate the new field from the old one
  3. delete the old field

@jberghoef jberghoef force-pushed the feature/segment-status-boolean branch from cc89cda to c31415b Compare July 19, 2018 12:17
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.

4 participants