Refactor Go Merlin #1

Closed
a268wang wants to merge 8 commits from refactor into go
Owner

Changes made

  • wrote some tests
  • split the common package into config, logger, and sync
  • moved the unix socket things from merlin.go into its own package
  • made some adjustments (splitting methods, moving stuff) to make it easier to test

Note: at the moment the drone.io is failing because the of some time zone stuff

Todo

  • write unit tests for the sync package
  • test the program as a whole
#### Changes made - wrote some tests - split the common package into config, logger, and sync - moved the unix socket things from merlin.go into its own package - made some adjustments (splitting methods, moving stuff) to make it easier to test Note: at the moment the drone.io is failing because the of some time zone stuff #### Todo - write unit tests for the sync package - test the program as a whole
a268wang added 8 commits 1 year ago
d278liu requested changes 1 year ago
d278liu left a comment
Collaborator

lgtm except the things in sync.go

lgtm except the things in sync.go
return
}
if repo.PasswordFile != "" {
Collaborator

same here, some sync types already append the password file - and how the password file should be added to args depends on the type of sync, so probably would remove this too

same here, some sync types already append the password file - and how the password file should be added to args depends on the type of sync, so probably would remove this too
Poster
Owner

I agree with this, I'll remove it shortly

I agree with this, I'll remove it shortly
a268wang marked this conversation as resolved
args = append(args, "--password-file", filename)
}
args = append(args, buildRsyncHost(repo), localDir)
Collaborator

don't think you want to be appending rsync host and localDir here too. each sync type already appends it.

also different sync types have different ways of building the host (some needs to be the daemon style host and some needs to be a ssh host)

don't think you want to be appending rsync host and localDir here too. each sync type already appends it. also different sync types have different ways of building the host (some needs to be the daemon style host and some needs to be a ssh host)
Poster
Owner

Huh all this stuff was actually moved over from the startSync function

https://git.csclub.uwaterloo.ca/public/mirror/src/branch/go/merlin/common/sync.go#L256-L270

I'm thinking of keeping a modified version of part to make sure that startSync will immediately exit if merlin cannot mkdir the buildDownloadDir

Huh all this stuff was actually moved over from the startSync function https://git.csclub.uwaterloo.ca/public/mirror/src/branch/go/merlin/common/sync.go#L256-L270 I'm thinking of keeping a modified version of part to make sure that startSync will immediately exit if merlin cannot mkdir the buildDownloadDir
Collaborator

yeah my bad about the original sync.go i think i forgot to remove them

yeah my bad about the original sync.go i think i forgot to remove them
a268wang marked this conversation as resolved
Poster
Owner

Lol merge request broke after pushing a commit to refactor.

"This pull request is broken due to missing fork information."

Lol merge request broke after pushing a commit to refactor. "This pull request is broken due to missing fork information."
a268wang closed this pull request 1 year ago

Reviewers

d278liu requested changes 1 year ago
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone Build is failing
This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: public/mirror#1
Loading…
There is no content yet.