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

Refactoring depsolving code for clarity #1367

Merged
merged 1 commit into from Jun 6, 2019

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Jun 6, 2019

This code is very difficult to follow. Here are some improvements that
make it more comprehensible.

  • Add docstrings
  • Rename functions to have more descriptive names
  • Turn methods that do not need to be methods into functions
  • Separate the concerns of performing depsolving and loading data from
    the database

This does not fix any depsolving issues, but it will really help with maintaining and debugging this code.

@dralley dralley changed the title Refactoring for code clarity Refactoring depsolving for clarity Jun 6, 2019
@dralley dralley changed the title Refactoring depsolving for clarity Refactoring depsolving code for clarity Jun 6, 2019
@dralley
Copy link
Contributor Author

dralley commented Jun 6, 2019

I filed this purely for tracking purposes https://pulp.plan.io/issues/4923

This code is very difficult to follow. Here are some improvements that
make it more comprehensible.

* Add docstrings
* Rename functions to have more descriptive names
* Turn methods that do not need to be methods into functions
* Separate the concerns of performing depsolving and loading data from
the database

re: #4693
https://pulp.plan.io/issues/4693
closes: #4923
https://pulp.plan.io/issues/4923
@nixocio
Copy link

nixocio commented Jun 6, 2019

hi @dralley, can we run the tests related to RPM against this PR before we merge it?

@dralley
Copy link
Contributor Author

dralley commented Jun 6, 2019

@kersommoura , yes. Jenkins ran the tests against this though, correct? It looks like they all passed.

@nixocio
Copy link

nixocio commented Jun 6, 2019

@dralley, jenkins runs unittests. What I meant is to run those tests locally https://github.com/PulpQE/Pulp-2-Tests/tree/master/pulp_2_tests/tests/rpm. The functional tests just run once the package with this PR is created, then if there is any failure we will need to investigate the root cause.

@dralley
Copy link
Contributor Author

dralley commented Jun 6, 2019

@kersommoura Thanks for the correction. Sure we can wait for passing smash tests. Do you want me to do that or did you mean QE?

Copy link
Member

@goosemania goosemania left a comment

Choose a reason for hiding this comment

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

@dralley , thank you for refactor, it looks good to me.
I'm reviewing now not to block you later. Feel free to merge it if the smash tests locally pass.

@nixocio
Copy link

nixocio commented Jun 6, 2019

@dralley, we currently do not have an easy way to install pulp 2 from a certain branch or PR, if you can run the tests locally that would be great.

@dralley
Copy link
Contributor Author

dralley commented Jun 6, 2019

There were a couple of spurious test failures but none related to copy/association or modules. On previous times when I've run the tests I've also gotten those, so I'm assuming it's just an environment thing because these changes would not affect those parts whatsoever. Merging.

@dralley dralley merged commit 51555be into pulp:2-master Jun 6, 2019
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

3 participants