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

Pull non-default branch commits selectively #1879

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

gbanasiak
Copy link
Contributor

@gbanasiak gbanasiak commented Oct 1, 2024

After switching nightlies to non-default branch it was observed commit IDs selected through branch@timestamp notation are not constant, and depend on subsequent merges of default branch (main) into non-default branch.

This PR mitigates this problem by filtering commit IDs of default branch from timestamp-based pulls of non-default branches using main..branch notation of git rev-list command.

@gbanasiak gbanasiak requested a review from a team October 1, 2024 16:21
Copy link
Contributor

@favilo favilo left a comment

Choose a reason for hiding this comment

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

Thanks for doing this.

@gbanasiak
Copy link
Contributor Author

gbanasiak commented Oct 1, 2024

For the record, here's the state of remote branch prepared in git_test.py.

[24-10-01 18:13] grzegorz:pytest-18/rally-unit-test-local-dir0% cd ../rally-unit-test-remote-dir0
[24-10-01 18:13] grzegorz:pytest-18/rally-unit-test-remote-dir0% git-graph
* 0d0f0f1 - (Tue Oct 1 16:13:02 2024 | Tue Oct 1 16:13:02 2024) initial commit - Grzegorz Banasiak (rally-unit-test-remote-only-branch, master)
| * fa85118 - (Tue Oct 1 16:13:02 2024 | Tue Oct 1 16:13:02 2024) initial commit - Grzegorz Banasiak (HEAD -> rally-unit-test-remote-only-branch-non-master)
| * 8ae6d7e - (Tue Oct 1 16:13:02 2024 | Fri Jan 1 01:00:00 2016) initial commit - Grzegorz Banasiak
|/
* dbe1153 - (Tue Oct 1 16:13:02 2024 | Fri Jan 1 00:00:00 2016) initial commit - Grzegorz Banasiak

The unit test verifies whether commit in rally-unit-test-remote-only-branch-non-master branch earlier than 2016-01-01T110000Z is 8ae6d7e. This test could be improved further if we emulated master merge into rally-unit-test-remote-only-branch-non-master with old commit ID.

@gbanasiak gbanasiak changed the title Remove default branch commits from timestamp-based pull of non-default branch Pull non-default branch commits selectively Oct 1, 2024
@gbanasiak gbanasiak merged commit 0e77d12 into elastic:master Oct 2, 2024
17 checks passed
@gbanasiak gbanasiak deleted the fix-git-pull-ts branch October 2, 2024 08:19
@favilo favilo added the bug Something's wrong label Nov 6, 2024
@favilo favilo added this to the 2.11.1 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants