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

git: refactor tests to use managed transports and fix switchToBranch #373

Merged
merged 4 commits into from
Jun 2, 2022

Conversation

aryan9600
Copy link
Member

@aryan9600 aryan9600 commented Jun 2, 2022

This PR is a follow up to #369.
It refactors the tests to use managed transports, since that's the default now.
It also fixes a regression introduced in #330, which would result in the controller failing to push commits, if the remote is ahead of the local branch. This was partially addressed in #369, by fetching the commits, but it failed to update the local branch target to be at the latest commit.

Fixes most of #370

@aryan9600 aryan9600 requested review from darkowlzz and hiddeco June 2, 2022 08:58
@aryan9600 aryan9600 force-pushed the managed-transport-default branch from 8d6ecfb to 668f72a Compare June 2, 2022 10:19
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
@aryan9600 aryan9600 force-pushed the managed-transport-default branch from 668f72a to 0423fa8 Compare June 2, 2022 10:25
@aryan9600 aryan9600 force-pushed the managed-transport-default branch from 0423fa8 to 79f988f Compare June 2, 2022 10:27
@hiddeco hiddeco changed the title git: refactor tests to use managed transports; fix switchToBranch git: refactor tests to use managed transports and fix switchToBranch Jun 2, 2022
controllers/git_test.go Outdated Show resolved Hide resolved
controllers/git_test.go Outdated Show resolved Hide resolved
Sanskar Jaiswal added 3 commits June 2, 2022 19:09
Fixes regression in which we fail to push to a branch after switching to
a branch, if origin is ahead of local. Fixed by setting the upstream
commit as the local branch target.

Regression introduced in fluxcd#330, and partially addressed in fluxcd#369.

Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
@aryan9600 aryan9600 force-pushed the managed-transport-default branch from 79f988f to 175f91e Compare June 2, 2022 13:54
Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks a lot for the test improvements.

@aryan9600 aryan9600 requested a review from hiddeco June 2, 2022 15:11
@hiddeco hiddeco merged commit c0962f7 into fluxcd:main Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants