Adding repository via API/CLI

Hi!

I have a Sentry onpremise installation behind corporate network, and a GitHub repo I would like to add for which I don’t have admin rights, but only read/write.

Would it be possible to just register the GitHub repo via CLI/API in a low-level way (e.g. writing directly into Sentry DB), so that the process doesn’t fail due to Sentry not able to install the webhook? (Which wouldn’t be anyway useful, since Sentry is not reachable by GitHub).

Thanks a lot!
Samuele

Why don’t you just mirror it to in-house?

What exactly do you mean? Would I just be able to clone it locally to Sentry in a particular Filesystem structure and Sentry would find it?

Because I tried for testing to add a repository I was admin of, I haven’t seen any change on the local Sentry directories.

Hi @jhermann, I have sort of worked around the limitation by adding a fake entry in the DB to represent my GitHub repo.

So currently Sentry is aware of it, and I am hence able to push via CLI commit information.
In my installation releases are populated automatically (events are sporting the release tag) and they match the SHA of the repo. Now I am trying to push commits using the sentry-cli approach as in:

$ git checkout ddd5c3e
$ sentry-cli --url https://sentry.example.org releases set-commits  --auto ddd5c3e

However I have two issues:

How can I make Sentry aware of the full repo? Can I clone it locally? How?

Thanks a lot for any hint.

Run a local GitLab-CE instance (which is easy and free), and then mirror the real repository. Not sure that works with Sentry as you need it, but it’d beat other workarounds without a full git server.

Thanks. I do indeed have a local GitLab (for other reasons), but Sentry doesn’t support GitLab repositories, as far as I can see (only GitHub, BitBucket and VisualStudio), so that wouldn’t help.

But indeed, I tricked Sentry in being aware of the repo, and in principle Sentry is able to pull from it (even if GitHub is not seeing my on-premise instance). So the only issues are the above two points.