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

Bazaar: Export directly from the remote branch. #6139

Merged
merged 3 commits into from
Mar 1, 2019

Conversation

jelmer
Copy link
Contributor

@jelmer jelmer commented Jan 15, 2019

Bazaar: Export directly from the remote branch.

This significantly improves performance, since it allows the remote
server to directly stream a tarball that just contains the requested
revision rather than the full repository contents.

@jelmer
Copy link
Contributor Author

jelmer commented Jan 15, 2019

@cjerdonek This is the "bzr export" performance improvement split out from #5445 as discussed in that pull request.

@cjerdonek cjerdonek added type: enhancement Improvements to functionality C: vcs pip's interaction with version control systems like git, svn and bzr labels Jan 16, 2019
@jelmer
Copy link
Contributor Author

jelmer commented Jan 16, 2019

The failures on the other platforms are because "bzr" is not available there.

@pradyunsg
Copy link
Member

The failures on the other platforms are because "bzr" is not available there.

You should decorate the method with need_bzr from test.lib

@cjerdonek
Copy link
Member

The failures on the other platforms are because "bzr" is not available there.

@jelmer Can you confirm if the test you added is running and passing anywhere in CI? When the test was failing, I saw it failing on Windows, macOS, and Linux, which is all of the platforms. It is probably worth exploring how easy it would be to install bzr in at least, say, the Linux testing environment.

@pradyunsg
Copy link
Member

Can you confirm if the test you added is running and passing anywhere in CI?

IIRC, None of our CI have bzr. 🔥

This significantly improves performance, since it allows the remote
server to directly stream a tarball that just contains the requested
revision rather than the full repository contents.
@jelmer
Copy link
Contributor Author

jelmer commented Jan 20, 2019 via email

@cjerdonek
Copy link
Member

cjerdonek commented Jan 20, 2019

@pradyunsg Is there or do we have a standard way (e.g. environment variable) to tell whether the tests are being run under Travis?

I think there should be a test of the form "if Travis is running, than is_bzr_installed() is true" (where is_bzr_installed() is computed using the same logic / code path as need_bzr()). This will ensure that the Bazaar tests are being run in at least one setting.

@pradyunsg
Copy link
Member

https://docs.travis-ci.com/user/environment-variables/#default-environment-variables

Yes. See also #6059 which had to detect being run on Travis CI to skip hg tests (since hg was broken on Travis).


I suggest having a separate PR for installing (and a test for ensuring) bzr is installed on Travis.

@jelmer
Copy link
Contributor Author

jelmer commented Jan 21, 2019

Could that be deferred to later? There have been several changes to the bazaar.py file over the last year (when I first proposed this change). This change is at least adding a first test for the Bazaar export support that runs on travis.

@cjerdonek
Copy link
Member

cjerdonek commented Jan 21, 2019

I think it's important for the tests being added to actually run in CI (and for us to be able to know they're being run) before the code is changed in a substantive way. The changes before were refactors that preserved the logic and didn't e.g. change any command invocations. The new test I'm talking about to check that it's running would just be a few lines using existing code. I would be okay with it being in the same or a separate PR given how small it is.

@jelmer
Copy link
Contributor Author

jelmer commented Jan 21, 2019

Trivial change added to verify that bzr is available when running under travis. Please let me know if this is the best place (tests/lib/init.py houses need_bzr, so test_lib.py seemed like the best choice).

@jelmer jelmer force-pushed the bazaar-export-perf branch 2 times, most recently from bc95c7a to 73d355f Compare January 22, 2019 00:38
@cjerdonek
Copy link
Member

cjerdonek commented Jan 22, 2019

Here is what I would recommend doing:

  1. Add is_bzr_installed() just before need_bzr() since the code is almost identical. (These two functions should really be calling the same underlying function, or need_bzr() should be calling is_bzr_installed(). But you don't have to DRY this up now.)

  2. At the beginning of test_vcs_bazaar.py, add test_ensure_bzr_available() and decorate it with @pytest.mark.skipif(<travis not running>). The reason not to call this test test_is_bzr_installed() is that it's not testing that is_bzr_installed() was written correctly but rather testing that Bazaar is in fact installed.

@jelmer
Copy link
Contributor Author

jelmer commented Jan 23, 2019 via email

@cjerdonek
Copy link
Member

Thanks, @jelmer. But read (2) a little more closely. I was saying to add the Travis test to the beginning of test_vcs_bazaar.py, and to give that test a different name.

@jelmer jelmer force-pushed the bazaar-export-perf branch 3 times, most recently from 4d20f9f to b91b08e Compare January 23, 2019 02:32
@jelmer
Copy link
Contributor Author

jelmer commented Jan 23, 2019

Done.

Copy link
Member

@cjerdonek cjerdonek left a comment

Choose a reason for hiding this comment

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

Looking a lot better -- thanks! Some tiny comments, and a bigger comment.

tests/functional/test_vcs_bazaar.py Outdated Show resolved Hide resolved
tests/functional/test_vcs_bazaar.py Outdated Show resolved Hide resolved
tests/functional/test_vcs_bazaar.py Outdated Show resolved Hide resolved
tests/lib/__init__.py Outdated Show resolved Hide resolved
tests/functional/test_vcs_bazaar.py Show resolved Hide resolved
@jelmer jelmer force-pushed the bazaar-export-perf branch 2 times, most recently from abb2e81 to 03d5626 Compare January 28, 2019 01:31
@jelmer
Copy link
Contributor Author

jelmer commented Feb 8, 2019

@cjerdonek all done

@cjerdonek
Copy link
Member

Okay, thanks. I'll take another look after the release issues settle down.

@cjerdonek cjerdonek merged commit 1fdd7e2 into pypa:master Mar 1, 2019
@cjerdonek
Copy link
Member

cjerdonek commented Mar 1, 2019

Thanks, @jelmer, for your work on this and for your patience!

@jelmer
Copy link
Contributor Author

jelmer commented Mar 2, 2019

Thanks for the reviews and merging, @cjerdonek !

@lock
Copy link

lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: vcs pip's interaction with version control systems like git, svn and bzr type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants