Cheatlist for forgefriends 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 (fetch)
gitea (push)
loic ssh:// (fetch)
loic ssh:// (push)
origin (fetch)
origin (push)

Show forgefriends 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 unit-test-coverage
  • A specific unit test in verbose mode
    docker run -ti --rm -e GOTESTFLAGS=-v -e -e GOCACHE=/drone/src/go-build --volume $(pwd):/drone/src --workdir /drone/src --user gitea gitea/test_env:linux-amd64 make 'test#Test'
  • A specific integration 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 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 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


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 (part 2)
e1254e06f activitypub: add the public key to Person (#14186)
1cdc1596d go.mod: add go-fed/activty/pub dependency (#14186)
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

Notes on this week merge with gitea.

  • User settings were merged and the forgefriends backport is not longer needed, it was reverted. The samantic is slightly different and the forgefriends code was adapted.
  • Conflicts had to be resolved as a result of three refactors impacting the forgefriends code (1, 2, 3)