This is needed for running clones in the background.
We could probably name all generated files *_gen.go, then add a rule in gitignore to ignore all *_gen.go files.
The api/graph/api/generated.go file can be renamed to api_gen.go. I believe that's the only one that needs to be renamed.
This may be the better of the two solutions. There might also be a third, however: before we commit the resolver's SQL transaction, can we open a transaction for the worker task which has its isolation level appropriately tuned such that the deleted rows are still visible to it after the resolver commits? Will require some research/testing to see if this is possible.
I considered this, but then I realized that when a repository is deleted, the contents are permanently removed with os.RemoveAll. Therefore, opening a transaction before deleting the repository won't help for the query above, which depends on the contents of the repository in the filesystem.
It seems like executing the queries before deletion might be our only option. Alternatively, we could say that fetching the log of a repository (or any other filesystem-dependent fields) upon deletion is not supported.
E.g. https://godocs.io/context?view=versions links to https://email@example.com, which does not exist. This is because modules in the standard library inherit all of the versions of the standard library.
We might be able to fix this by maintaining a list which specifies the earliest version where a standard library module is present.
Source links are broken for pseudo-versions since the reference and the version are not equal. Unfortunately there doesn't seem to be an easy way to determine the reference from the pseudo-version.
A few possible solutions:
- Open an issue upstream to get proxy.golang.org to return commit references in addition to commit times. This won't solve the issue for modules from modcache, though.
- Get this information from the local modcache somehow (maybe from the vcs directory).
- Disallow pseudo-versions.
- Disable source links when pseudo-versions are used.