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

Fix issue with single changeset syncing #53

Closed
wants to merge 1 commit into from

Conversation

mmitche
Copy link

@mmitche mmitche commented Aug 20, 2015

When syncing a single changeset, the plugin would attempt to get history for every change leading up to that changeset

When syncing a single changeset, the plugin would attempt to get history for every change leading up to that changeset
@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@olivierdagenais
Copy link
Member

Can you give an example (or, even better, add a unit test that fails without your changes) that illustrates the problem you're trying to solve?

Thanks!

@mmitche
Copy link
Author

mmitche commented Aug 21, 2015

I'll look into adding a unit test. We have a TFS server with well over a million changesets. If I set the environment variable that causes the plugin to sync to a single changeset, the plugin attempts to get history from change 0 to change N. Obviously that is excessive.

@olivierdagenais
Copy link
Member

If I set the environment variable that causes the plugin to sync to a single changeset

You mean you're setting VERSION_SPEC to use the Checkout by label feature?

the plugin attempts to get history from change 0 to change N. Obviously that is excessive.

I agree it shouldn't do that. :) It looks like the change on line 121 would be sufficient, making the one on line 85 unnecessary. Can you confirm?

@mmitche
Copy link
Author

mmitche commented Aug 21, 2015

When I originally made this fix, I looked for documentation on the API. It's a bit thin, but all the examples I saw pass LatestVersionSpec in there even when querying for a specific version. I'll try to find out more.

@olivierdagenais
Copy link
Member

When I originally made this fix

Hmmm... Is it possible you started the work before I extracted the last parameter and we could fix this by simply providing 1, instead of Integer.MAX_VALUE?

@mmitche
Copy link
Author

mmitche commented Aug 24, 2015

I think that's still wrong, since it would just provide the first history of the first changeset )which was null, and therefor would be the 0th changeset). The key change here is that fromVersion == toVersion. I've been attempting to find out exactly what that other parameter does (I work at MS) but I'm having trouble tracking down the code for this API.

olivierdagenais pushed a commit that referenced this pull request Aug 24, 2015
The test reproduces the issue raised as part of pull request #53.
The fix uses a belt-and-suspenders approach of making the range
explicitly be version-to-version and making sure we only ever receive 1
result.
@olivierdagenais
Copy link
Member

Obsoleted by #55.

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.

3 participants