srht-keys: stop writing to sshkeys table
This table is now deprecated and all services should always use meta as
source of truth. In fact, in both git and hg, the table is already only
ever written to, never read. This commit will stop both gitsrht-keys and
hgsrht-keys to stop writing to it, so that it can be removed eventually.
service: stop subscribing to SSH key events
The BaseScmOauthService class is mainly used to maintain a per-service
copy of meta's ssh_key table. This table is now deprecated and all
services should always use meta as source of truth.
In fact, in both git and hg, the table is only ever used by webhook
handlers. Hence, removal of the webhook handlers is the final step
before the tables themselves can be removed.
The plan is to this as a multi-step process:
* In git and hg, via the BaseScmOauthService class, stop subscribing to
webhook events 'ssh-key:*' (this commit)
* Manually remove any existing subscriptions for these events by these
services
* Once unused, remove the webhook handlers (blueprints, logic, etc)
* Eliminate any other writes to the table (gitsrht-keys, hgsrht-keys)
* Drop sshkey tables in git and hg
Reduce setup.py to a stub
All configuration is now in pyproject.toml, all tooling set up to use
it. The stub remains (for now) for backward compatibility.
Allow specifying user for build submission
Preparations for PEP440 support
Currrently, builds for patches are broken because the version numbers
generated for them are not valid according to PEP 440 [1].
This has to be solved in several steps, in coordination with the
packaging code. Just as was done with core.sr.ht, the plan is:
1. Add a pyproject.toml without touching setup.py (this commit)
2. Switch APKBUILD from `python setup.py build` to `python -m build`
3. Reduce setup.py to a stub, encoding all relevant information in
pyproject.toml
With this commit, this module can be build with both `python setup.py
build` and `python -m build`, if, _and only if_ the PKGVER environment
variable is set, which is true for all our tooling.
As the version passed in via the environment is still not
PEP440-compatible, packaging non-tagged versions will remain broken
until step three above is executed.
The .gitattributes and .git_archival files are included for the future
setup. Since packages are built from `git-archive` tarballs, the commit
information has to be transported into the tarballs. The setuptools-scm
package specifies a mechanism for this [3]. Note, that in order to avoid
a hilarious bug [4] the checked in `.git_archival.txt` differs from the
template found in the documentation. The git version on git.sr.ht is new
enough that the `describe-name` will be expanded, and if present it is
the only information that setuptools-scm really requires.
Includes minor cleanups in setup.py itself.
[1] https://peps.python.org/pep-0440
[2] https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/50784
[3]: https://setuptools-scm.readthedocs.io/en/latest/usage/#git-archives
[4]: https://github.com/pypa/setuptools_scm/issues/806
Overwrite fragment of source spec if needed
Currently, `_add_commit_id_fragment()` only tests if the `basename()` of
the sources spec matches the repo name. However, if a manifest contains
e.g. the source `https://git.sr.ht/~foo/repo#main`, the `basename()` is
"repo#main" and will not match the repo name "repo".
This causes problems, as automatically generated Manifests for patch
submissions may end with two source specs referencing the same repo,
causing the clone stage to fail.
A better approach was already taken in `_auto_setup_auto_source()` a few
lines above: properly parsing the URL and calling `basename()` only on
the path. Applying the same approach here fixes the issue.
.builds: drop arch, debian
srht-keys: upgrade dependencies
.builds/alpine.yml: upgrade to 3.17
scmsrht: Remove unused code
This code has been moved into git.sr.ht and hg.sr.ht respectively.
setup.py: drop removed module
scmsrht: Remove routes
These routes will be defined in git.sr.ht/hg.sr.ht, and must be removed
to avoid conflicts.
Also remove some code which is no longer needed by scm.sr.ht, including
the RepoApi and UserWebhook classes.
Include link prefix in readme cache.
Fixes problems wrong links appearing in readme if the same file has
already been rendered for a different repo. Not an ideal solution, since
link prefix can be a None, a single string, or a list of two strings,
but looking at the usage it's always a list of two strings, and it
should be stable.
pygments: drop custom lexer
srht-keys: update go.{mod,sum} for go-redis
srht-keys: update go-redis to support Unix sockets