Cheatlist for fedeproxy development

In addition to the documentation and the README found in the integrations directory.

In the following the remotes are setup as follows:

$ git remote -v
gitea https://github.com/go-gitea/gitea (fetch)
gitea https://github.com/go-gitea/gitea (push)
loic ssh://git@lab.fedeproxy.eu:2222/dachary/fedeproxy-gitea.git (fetch)
loic ssh://git@lab.fedeproxy.eu:2222/dachary/fedeproxy-gitea.git (push)
origin https://lab.fedeproxy.eu/fedeproxy/server.git (fetch)
origin https://lab.fedeproxy.eu/fedeproxy/server.git (push)

Show fedeproxy commits only (ignore commits originating from Gitea)

  • git log --no-decorate --oneline --no-merges gitea/main..origin/main

Every week sync with gitea

  • git fetch gitea
  • git checkout -b wip-gitea-merge origin/main
  • git merge gitea/main
  • git push loic/wip-gitea-merge
  • create merge request with subject “Merge remote-tracking branch ‘gitea/main’ into main”
  • merge when tests pass

Running tests

  • All tests
    time drone exec --pipeline testing-amd64 .gitlab-ci-drone.yml
    firefox coverage.html
  • A specific test only
    docker run --rm -ti -e GOCACHE=/drone/src/go-build -e TAGS="bindata sqlite sqlite_unlock_notify" -e GOPROXY=off --user gitea -v $(pwd):/drone/src --workdir=/drone/src gitea/test_env:linux-amd64 make GO_PACKAGES=code.gitea.io/gitea/modules/secret unit-test-coverage
  • A specific test in verbose mode to see log.Error, fmt.Printnl…
    docker run --rm -ti -e GOCACHE=/drone/src/go-build --volume $(pwd):/drone/src --workdir /drone/src --user gitea gitea/test_env:linux-amd64 bash -c 'make integrations.sqlite.test generate-ini-sqlite && GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.v -test.run TestActivityPubPerson'
  • A specific unit test without caching (note the -count=1, that’s what disables caching)
    docker run -ti --rm -e GOCACHE=/drone/src/go-build --volume $(pwd):/drone/src --workdir /drone/src --user gitea gitea/test_env:linux-amd64 env GOTESTFLAGS=-count=1 GITEA_UNIT_TESTS_VERBOSE=true GO_PACKAGES=code.gitea.io/gitea/models make 'test#TestRepository_HasWiki'

Getting code from a given PR

Creating a branch

PR=16834 ; git fetch gitea pull/$PR/head:pr-$PR

Creating a diff with the content of the PR

PR=16834 ; git diff gitea/main…pr-$PR > /tmp/$PR.patch

1 Like

As of today:

$ git log --no-decorate --oneline --no-merges gitea/main..origin/main
314ab214d activitypub: signing http client
e72d8d58c activitypub: go-fed conformant Clock instance
4d09135ae go.mod: add go-fed/httpsig dependency (#14186)
6bf561516 https://github.com/go-gitea/gitea/pull/16834 (part 2)
e1254e06f activitypub: add the public key to Person (#14186)
1cdc1596d go.mod: add go-fed/activty/pub dependency (#14186)
eb28575bb https://github.com/go-gitea/gitea/pull/16834
41574c3dd activitypub: implement /api/v1/activitypub/user/{username} (#14186)
eabe93a50 go.mod: add go-fed dependency (#14186)
8e43d2e66 gitignore: emacs backups
de98d1860 ci: setup GitLab CI