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

Checkout and history now go by the changeset number #44

Merged
merged 12 commits into from
Aug 6, 2015

Conversation

olivierdagenais
Copy link
Member

Previously, checking out (and subsequent history querying) was done using timestamps, which could lead to an inconsistency where the plugin, under certain circumstances (i.e. if the build was started on the same second as a check-in) could report the changeset associated with the build as x but the files actually fetched would be from changeset x - 1.

This pull request leverages the changeset number (already being recorded!) to perform the checkout and history querying with more precision and consistency.

Verification is mostly encoded in the newJob() test, although some validation also took place by manual inspection of build artifacts, such as logs.

Oli Dagenais added 12 commits August 5, 2015 14:55
This slightly affected two tests that are tightly coupled to the mocks.
We were already determining the changeset and recording it as part of
the build, this now makes sure we use that same changeset number when
retrieving the files and computing the list of changes since the last
build.

Without these changes, it was possible for the plugin to claim we were
checking out, say, changeset 507, but actually fetch changeset 506,
depending on the exact timing of the changeset and the build's start
time.
This addition to the newJob() functional test exposed the case where a
build was manually triggered after an SCM trigger and the plugin would
end up asking for history between changesets X+1 and X, which would
throw an exception.  This verifies there should be no changes recorded.
olivierdagenais added a commit that referenced this pull request Aug 6, 2015
Checkout and history now go by the changeset number.
@olivierdagenais olivierdagenais merged commit 3b6675c into master Aug 6, 2015
@olivierdagenais olivierdagenais deleted the checkout_and_history_by_changeset branch August 6, 2015 14: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.

1 participant