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

Refactor the rest of the git methods #937

Merged
merged 1 commit into from
Nov 17, 2019
Merged

Refactor the rest of the git methods #937

merged 1 commit into from
Nov 17, 2019

Conversation

saschagrunert
Copy link
Member

  • We now checkout the target branch after clone/open
  • Added cleanup defer for repo as well
  • The working directory will now contain a link to the repo
    to make the go env rewrite work
  • MergeBase is now a method of Repo
  • RevParse and RevParseShort are now methods of Repo
  • The SynchRepo function is now obsolete since auth/clone/open works via Repo

I think as a next step we could refactor the rest of the TODOs in ff.go 😇

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 17, 2019
@k8s-ci-robot k8s-ci-robot added area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels Nov 17, 2019
@saschagrunert
Copy link
Member Author

/cc @hasheddan @justaugustus

- We now checkout the target branch after clone/open
- Added cleanup defer for repo as well
- The working directory will now contain a link to the repo
  to make the go env rewrite work
- `MergeBase` is now a method of `Repo`
- `RevParse` and `RevParseShort` are now methods of `Repo`

Signed-off-by: Sascha Grunert <[email protected]>
Copy link
Member

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

@saschagrunert -- You're quick! Just one comment on whether or not there's a typo in here.

if nomock {
log.Printf("nomock mode (from within ff)\n")
gitRoot := fmt.Sprintf("%s/src/k8s.io", workingDir)
if err := os.MkdirAll(gitRoot, 0o755); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Is this (0o775) a typo?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is new in go 1.13, see https://golang.org/ref/spec#Integer_literals

I assume this is fine since we're only supporting this version, right? 😇

Copy link
Member

Choose a reason for hiding this comment

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

Ohhhh, that's cool! TIL :)
...and yes, onwards to go1.13!

@justaugustus justaugustus added this to the v1.17 milestone Nov 17, 2019
@justaugustus
Copy link
Member

Thanks @saschagrunert!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 17, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justaugustus, saschagrunert

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2019
@k8s-ci-robot k8s-ci-robot merged commit 9ca5cdb into kubernetes:master Nov 17, 2019
@saschagrunert saschagrunert deleted the git-refactoring-2 branch November 17, 2019 00:47
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. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants