sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.28k forks source link

Perforce depots are removed when a new license key is configured after the license expires #56842

Closed mike-r-mclaughlin closed 9 months ago

mike-r-mclaughlin commented 1 year ago

Overview

When a license expires, any configured Perforce depots are hidden from users. The converted (p4-fusion) Git repos still exist on disk. However, once the server is updated with a new license key, the git repos are deleted from disk and the admin UI continues shows an error The private repositories feature is not activated for this license. Please upgrade your license to use this feature. until you manually save the code host configuration and manually trigger a code host sync.

Steps to reproduce:

  1. Create a short-lived license key
  2. Install Sourcegraph and configure the above license key
  3. Add several Perforce depot paths and wait for them to be cloned
  4. Wait for license to expire and the repos to no longer be visible in the Sourcegraph UI
  5. Check the gitserver /data/repos path to verify the repositories are still on disk
  6. Create a new license key and set it on the Sourcegraph server
  7. Check the gitserver /data/repos path; the repositories have been removed from disk

Expected behavior:

After the new license key is set in the UI, the Perforce depots are visible in the UI to the users and they begin syncing again.

Actual behavior:

After updating the license key, the perforce depots are no longer visible in the UI, admins see an error on the code host configuration, and the git repos have been deleted from disk.

If you would like immediate help on this, please email support@sourcegraph.com (you can still create the issue, but there are no SLAs on issues like there are for support requests).

/cc @sourcegraph/source

eseliger commented 9 months ago

@pjlast with the changes to licensing in 5.3, I wonder if this is fixed?

pjlast commented 9 months ago

@eseliger yep should be fixed! No repo removal should happen any more

pjlast commented 9 months ago

From 5.3 onwards Sourcegraph should continue to function as normal when a license expires with only admins being able to sign in. This means Sourcegraph will no longer revert to the free license state that caused the repos to be deleted in the first place.