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

Total overhaul of the fetch loop for v4 #691

Merged
merged 1 commit into from
Apr 22, 2023

Conversation

thockin
Copy link
Member

@thockin thockin commented Feb 25, 2023

This one is a doozy but can't easily be broken up further. I have a dozen more on top of this, building to a v4 release candidate, I hope.

The previous (v3) sync loop betrays my lack of understanding about git. It tried to codify my archaic mental model (e.g. --branch and --rev being disting things) and was ultimately a patchwork of corner-cases evolved over a few years.

This commit is less of a "diff" and more of a "rewrite".

The new logic is simpler and more efficient. It does not git clone ever. It does not differentiate the first sync from subsequent syncs. It uses git fetch to get the exact SHA and then makes a worktree from that.

The new --ref flag replaces both --rev and --branch, though it will use those if specified. In fact, almost all of the e2e tests passed without change - using --ref and --branch!

I will follow this commit up with more cleanups and e2es.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 25, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 25, 2023
@thockin
Copy link
Member Author

thockin commented Mar 5, 2023

I am so sorry for this one :)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2023
The previous (v3) sync loop betrays my lack of understanding about git.
It tried to codify my archaic mental model (e.g. --branch and --rev
being disting things) and was ultimately a patchwork of corner-cases
evolved over a few years.

This commit is less of a "diff" and more of a "rewrite".

The new logic is simpler and more efficient.  It does not `git clone`
ever.  It does not differentiate the first sync from subsequent syncs.
It uses `git fetch` to get the exact SHA and then makes a worktree from
that.

The new `--ref` flag replaces both `--rev` and `--branch`, though it
will use those if specified.  In fact, almost all of the e2e tests
passed without change - using --ref and --branch!

I will follow this commit up with more cleanups and e2es.
@thockin thockin force-pushed the overhaul_fetch_loop_for_v4 branch from 32cc933 to 35323a2 Compare April 7, 2023 17:18
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2023
@thockin
Copy link
Member Author

thockin commented Apr 7, 2023

I self-merged some of the smaller ones before this, but stopped here for now. I'd love to have extra eyes on it, but if everyone is too busy, I don't mind pushing ahead to shoot for a v4 RC.

@thockin
Copy link
Member Author

thockin commented Apr 22, 2023

self-merge to make progress

@thockin thockin merged commit ee66647 into kubernetes:master Apr 22, 2023
@stp-ip
Copy link
Member

stp-ip commented Apr 24, 2023

Damn thought you self merged all. Will review after the fact once I have some capacity. So don't mind you merging your progress.

@thockin
Copy link
Member Author

thockin commented Apr 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants