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

deployment.py: handle checking DiffStateEngineResourceState #980

Closed
wants to merge 1 commit into from

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Jul 19, 2018

Doing some ... weird ... stuff .. I found:

_subclasses returns:

[<class 'nixops.resources.DiffEngineResourceState'>,
<class 'nixops.backends.none.NoneState'>,
<class 'nixops.resources.ssh_keypair.SSHKeyPairState'>]

which can cause the comparisons to happen in the wrong order, resulting in

File /nix/store/iym5qcmlwbxi7f66mh7bsv4jfnybhgrs-python2.7-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/resources/init.py, line 40, in get_type
raise NotImplementedError(get_type)
NotImplementedError: get_type

...oops

This handles that and allows continued comparisons.

subclasses returns:

[<class 'nixops.resources.DiffEngineResourceState'>,
 <class 'nixops.backends.none.NoneState'>,
 <class 'nixops.resources.ssh_keypair.SSHKeyPairState'>]

which can cause the comparisons to happen in the wrong order, resulting in

  File /nix/store/iym5qcmlwbxi7f66mh7bsv4jfnybhgrs-python2.7-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/resources/__init__.py, line 40, in get_type
    raise NotImplementedError(get_type)
NotImplementedError: get_type

oops
@AmineChikhaoui
Copy link
Member

@grahamc do you have anything that reproduces the issue you saw ?

@grahamc
Copy link
Member Author

grahamc commented Jul 19, 2018

Yeah, but it is a bit weird (hence "stuff" ;) If you check out my commit here in a network where your only resource type are machines with the targetEnv of none and try to run nixops check or nixops ssh, this error will come up. commit: https://github.com/grahamc/nixops/tree/fe9e7f39180bf6cc8d0d2a875cfa7873520459a5

@grahamc
Copy link
Member Author

grahamc commented Mar 26, 2020

Hello!

Thank you for this PR.

In the past several months, some major changes have taken place in
NixOps:

  1. Backends have been removed, preferring a plugin-based architecture.
    Here are some of them:

  2. NixOps Core has been updated to be Python 3 only, and at the
    same time, MyPy type hints have been added and are now strictly
    required during CI.

This is all accumulating in to what I hope will be a NixOps 2.0
release
. There is a tracking issue for that:
#1242 . It is possible that
more core changes will be made to NixOps for this release, with a
focus on simplifying NixOps core and making it easier to use and work
on.

My hope is that by adding types and more thorough automated testing,
it will be easier for contributors to make improvements, and for
contributions like this one to merge in the future.

However, because of the major changes, it has become likely that this
PR cannot merge right now as it is. The backlog of now-unmergable PRs
makes it hard to see which ones are being kept up to date.

If you would like to see this merge, please bring it up to date with
master and reopen it
. If the or mypy type checking fails, please
correct any issues and then reopen it. I will be looking primarily at
open PRs whose tests are all green.

Thank you again for the work you've done here, I am sorry to be
closing it now.

Graham

@grahamc grahamc closed this Mar 26, 2020
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.

None yet

2 participants