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 group foundation #16935

Merged
merged 1 commit into from Oct 8, 2018

Conversation

Projects
None yet
4 participants
@balloob
Member

balloob commented Sep 28, 2018

Don't merge until after beta 0.80 has been cut.

Description:

This adds the bare minimal foundation for groups.
Does not add editing of groups, creation of groups, API to fetch groups.

Because it requires a migration of the auth storage, I am also fixing the data to no longer have to do backwards compat checks during normal load.

Architecture issue: home-assistant/architecture#87

Things to note:

  • We are creating one group called "All Access"
  • All non-system generated users will be added to the "All Access" group
  • A new user that is created will also be added to this group
  • This PR includes a migration for the auth storage. This means that users will be unable to rollback to 79 from 80. No longer includes migration

Related issue (if applicable): For #16890

Pull request in home-assistant.io with documentation (if applicable): TODO dev docs update

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
token_type = models.TOKEN_TYPE_SYSTEM
else:
token_type = models.TOKEN_TYPE_NORMAL
if user.system_generated != (token_type == models.TOKEN_TYPE_SYSTEM):
if user.group.system_generated != (token_type == models.TOKEN_TYPE_SYSTEM):

This comment has been minimized.

@houndci-bot

houndci-bot Sep 28, 2018

line too long (83 > 79 characters)

token_type = models.TOKEN_TYPE_SYSTEM
else:
token_type = models.TOKEN_TYPE_NORMAL
if user.system_generated != (token_type == models.TOKEN_TYPE_SYSTEM):
if user.group.system_generated != (token_type == models.TOKEN_TYPE_SYSTEM):

This comment has been minimized.

@houndci-bot

houndci-bot Sep 28, 2018

line too long (83 > 79 characters)

@balloob balloob closed this Oct 2, 2018

@wafflebot wafflebot bot removed the in progress label Oct 2, 2018

@balloob balloob reopened this Oct 2, 2018

@wafflebot wafflebot bot added the in progress label Oct 2, 2018

@balloob

This comment has been minimized.

Member

balloob commented Oct 2, 2018

This is ready for review.

@pvizeli

pvizeli approved these changes Oct 3, 2018

@balloob balloob changed the title from Add group foundation to WIP: Add group foundation Oct 4, 2018

@balloob

This comment has been minimized.

Member

balloob commented Oct 4, 2018

Update: I realized that in 79 we have coded the auth store in such a way that it can't handle a rollback from having groups added. So I am going to open a PR with changes that will allow for rollbacks once groups arrive.

@balloob

This comment has been minimized.

Member

balloob commented Oct 4, 2018

Fixed in #17127

@balloob balloob changed the title from WIP: Add group foundation to Add group foundation Oct 8, 2018

@balloob balloob merged commit c3b1121 into dev Oct 8, 2018

6 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 93.635%
Details

@wafflebot wafflebot bot removed the in progress label Oct 8, 2018

@balloob balloob deleted the groups branch Oct 8, 2018

@balloob balloob referenced this pull request Oct 26, 2018

Merged

0.81 #17809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment