Skip to content
Permalink
Browse files

Fix up some code style

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
  • Loading branch information...
puiterwijk authored and mergify committed Feb 16, 2019
1 parent 0299eab commit 916bdf332a6291452b97ab2b7706259974f3ad87
Showing with 18 additions and 29 deletions.
  1. +0 −1 HOOKS.md
  2. +0 −8 README.md
  3. +0 −2 SECURITY.md
  4. +3 −3 build.sh
  5. +5 −5 cmd/repohookrunner/main.go
  6. +2 −2 functional_tests/blobs/test.sh
  7. +8 −8 server/service/clustered_storage.go
@@ -9,7 +9,6 @@ There are some differences in hooks running inside repoSpanner as compared
to standard Git hooks, but in general any existing hook should work as-is,
as long as they don't try to write to the repository themselves.


Run environment
---------------

@@ -15,7 +15,6 @@ push failing due to an attempt to push to the failed node.
*Note*: As a consequence of this, it is strongly suggested to deploy
regions with odd numbers of nodes.


Build repoSpanner
-----------------

@@ -27,7 +26,6 @@ Followed by that:

$ ./build.sh


Deployment
----------

@@ -83,7 +81,6 @@ And then run:

Or, again, start the `repospanner.service` unit file.


Repository access
-----------------

@@ -107,7 +104,6 @@ in /etc/repospanner.
This client will automatically revert to plain git if it determines the repo
that is being pushed to is not a repospanner repository.


Development
-----------

@@ -124,16 +120,13 @@ To run the full test suite, run from the main directory:

$ go test ./...


Tests
-----

The project comes with a decent functional test suite. Explore the
`repospanner/functional_tests` to see the variety of tests that you can
run.



Contributions
-------------

@@ -142,7 +135,6 @@ Please make sure to add a `Signed-Off-By` line in your git commit to indicate
you agree to the Developer Certificate of Origin (DCO) as quoted below.
To do this, simple add the "-s" flag to your git commit, like: `git commit -s`.


Developer Certificate of Origin
--------------------------------

@@ -3,7 +3,6 @@ Security

This documents some of the security assumptions/goals that repoSpanner should adhere to, and provides some information on secure deployments.


Listeners
---------

@@ -17,7 +16,6 @@ The user endpoint is used for requests by user clients (be that Git, repobridge,
TLS client certificates are optional, although unauthenticated requests are only able to clone public repositories and get the high-level version information of the system.
This endpoint should be available from clients who need access to the repositories on this system.


Reporting a vulnerability
-------------------------

@@ -10,9 +10,9 @@ then
git diff Gopkg.lock
fi

export VERSION="`cat VERSION`"
export GITDESCRIP="`git describe --long --tags --dirty --always`"
export VENDORDESCRIP="`find vendor -type f | xargs cat | sha1sum | tr -d '\n' | sed -e 's/ -//'`"
export VERSION="$(cat VERSION)"
export GITDESCRIP="$(git describe --long --tags --dirty --always)"
export VENDORDESCRIP="$(find vendor -type f | xargs cat | sha1sum | tr -d '\n' | sed -e 's/ -//')"

(
cd cmd/repospanner/
@@ -178,12 +178,12 @@ func getHookArgs(request datastructures.HookRunRequest, branch string, req [2]st
buf := bytes.NewBuffer(nil)
if request.Hook == "update" {
return []string{branch, req[0], req[1]}, buf
} else {
for branch, req := range request.Requests {
fmt.Fprintf(buf, "%s %s %s\n", req[0], req[1], branch)
}
return []string{}, buf
}

for branch, req := range request.Requests {
fmt.Fprintf(buf, "%s %s %s\n", req[0], req[1], branch)
}
return []string{}, buf
}

func runHook(request datastructures.HookRunRequest, workdir string, branch string, req [2]string) {
@@ -1,8 +1,8 @@
#!/bin/bash
echo "RUNNING HOOK"
echo "PS: $$"
echo "ID: `id`"
echo "Hostname: `hostname`"
echo "ID: $(id)"
echo "Hostname: $(hostname)"
env
echo "Args: $@"
echo "STDIN FOLLOWING"
@@ -313,15 +313,15 @@ func (d *clusterStorageProjectPushDriverInstance) runPeerSyncer(peerid uint64) {
}

return
} else {
// We have no object right now, but more might be inbound.
// Wait until we get notified the queues have changed, and then retry
mylog.Debug("Nothing to sync out, but not done. Wait")
d.objectSyncNewObjects.Wait()
d.objectSyncNewObjects.L.Unlock()
mylog.Debug("We were kicked")
continue
}

// We have no object right now, but more might be inbound.
// Wait until we get notified the queues have changed, and then retry
mylog.Debug("Nothing to sync out, but not done. Wait")
d.objectSyncNewObjects.Wait()
d.objectSyncNewObjects.L.Unlock()
mylog.Debug("We were kicked")
continue
}

mylog := mylog.WithField("objectid", nextentry)

0 comments on commit 916bdf3

Please sign in to comment.
You can’t perform that action at this time.