hgitaly 18.1.0a0__tar.gz → 18.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. {hgitaly-18.1.0a0/hgitaly.egg-info → hgitaly-18.2.0}/PKG-INFO +3 -2
  2. hgitaly-18.2.0/hgitaly/VERSION +1 -0
  3. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/mono.py +9 -0
  4. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/commit.py +0 -39
  5. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/mercurial_operations.py +3 -1
  6. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/ref.py +4 -1
  7. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/repository.py +16 -39
  8. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/server.py +6 -1
  9. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_commit.py +0 -61
  10. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_mercurial_operations.py +5 -1
  11. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_ref.py +1 -1
  12. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_repository_service.py +14 -41
  13. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_server.py +17 -0
  14. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/servicer.py +8 -0
  15. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/commit_pb2.py +60 -60
  16. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/diff_pb2.py +50 -48
  17. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/diff_pb2_grpc.py +0 -3
  18. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/ref_pb2.py +16 -16
  19. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/repository_pb2.py +44 -42
  20. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/repository_pb2_grpc.py +15 -15
  21. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/__init__.py +8 -0
  22. {hgitaly-18.1.0a0 → hgitaly-18.2.0/hgitaly.egg-info}/PKG-INFO +3 -2
  23. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly.egg-info/SOURCES.txt +0 -6
  24. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly.egg-info/requires.txt +2 -1
  25. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/install-requirements.txt +2 -1
  26. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_commit.py +2 -3
  27. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_ref.py +115 -5
  28. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_repository_service.py +24 -25
  29. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_rhgitaly_server.py +1 -1
  30. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_server.py +16 -0
  31. hgitaly-18.1.0a0/hgitaly/VERSION +0 -1
  32. hgitaly-18.1.0a0/hgitaly/license_detector/__init__.py +0 -137
  33. hgitaly-18.1.0a0/hgitaly/license_detector/spdx-licenses.json +0 -7514
  34. hgitaly-18.1.0a0/hgitaly/linguist/__init__.py +0 -196
  35. hgitaly-18.1.0a0/hgitaly/linguist/languages.json +0 -1
  36. hgitaly-18.1.0a0/hgitaly/tests/test_license_detector.py +0 -42
  37. hgitaly-18.1.0a0/hgitaly/tests/test_linguist.py +0 -45
  38. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/LICENSE +0 -0
  39. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/MANIFEST.in +0 -0
  40. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/README.md +0 -0
  41. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgext3rd/__init__.py +0 -0
  42. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgext3rd/hgitaly/__init__.py +0 -0
  43. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgext3rd/hgitaly/revset.py +0 -0
  44. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgext3rd/hgitaly/tests/__init__.py +0 -0
  45. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgext3rd/hgitaly/tests/test_revset.py +0 -0
  46. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgext3rd/hgitaly/tests/test_serve.py +0 -0
  47. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/__init__.py +0 -0
  48. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/branch.py +0 -0
  49. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/changelog.py +0 -0
  50. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/diff.py +0 -0
  51. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/errors.py +0 -0
  52. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/feature.py +0 -0
  53. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/file_content.py +0 -0
  54. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/file_context.py +0 -0
  55. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/git.py +0 -0
  56. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/gitlab_ref.py +0 -0
  57. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/identification.py +0 -0
  58. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/logging.py +0 -0
  59. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/manifest.py +0 -0
  60. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/message.py +0 -0
  61. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/oid.py +0 -0
  62. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/pagination.py +0 -0
  63. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/path.py +0 -0
  64. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/peer.py +0 -0
  65. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/procutil.py +0 -0
  66. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/repository.py +0 -0
  67. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/revision.py +0 -0
  68. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/revset.py +0 -0
  69. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/scripts.py +0 -0
  70. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/__init__.py +0 -0
  71. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/address.py +0 -0
  72. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/prefork.py +0 -0
  73. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/tests/__init__.py +0 -0
  74. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/tests/test_address.py +0 -0
  75. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/tests/test_mono.py +0 -0
  76. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/tests/test_prefork.py +0 -0
  77. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/tests/test_worker.py +0 -0
  78. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/server/worker.py +0 -0
  79. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/__init__.py +0 -0
  80. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/analysis.py +0 -0
  81. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/blob.py +0 -0
  82. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/diff.py +0 -0
  83. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/interceptors.py +0 -0
  84. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/mercurial_changeset.py +0 -0
  85. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/mercurial_repository.py +0 -0
  86. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/operations.py +0 -0
  87. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/__init__.py +0 -0
  88. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/fixture.py +0 -0
  89. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_analysis.py +0 -0
  90. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_blob.py +0 -0
  91. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_default_branch.py +0 -0
  92. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_diff.py +0 -0
  93. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_mercurial_changeset.py +0 -0
  94. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_mercurial_repository.py +0 -0
  95. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/service/tests/test_operations.py +0 -0
  96. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/ssh.py +0 -0
  97. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stream.py +0 -0
  98. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/__init__.py +0 -0
  99. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/analysis_pb2.py +0 -0
  100. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/analysis_pb2_grpc.py +0 -0
  101. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/blob_pb2.py +0 -0
  102. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/blob_pb2_grpc.py +0 -0
  103. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/commit_pb2_grpc.py +0 -0
  104. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/errors_pb2.py +0 -0
  105. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/errors_pb2_grpc.py +0 -0
  106. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/lint_pb2.py +0 -0
  107. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/lint_pb2_grpc.py +0 -0
  108. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_aux_git_pb2.py +0 -0
  109. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_aux_git_pb2_grpc.py +0 -0
  110. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_changeset_pb2.py +0 -0
  111. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_changeset_pb2_grpc.py +0 -0
  112. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_operations_pb2.py +0 -0
  113. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_operations_pb2_grpc.py +0 -0
  114. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_repository_pb2.py +0 -0
  115. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/mercurial_repository_pb2_grpc.py +0 -0
  116. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/operations_pb2.py +0 -0
  117. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/operations_pb2_grpc.py +0 -0
  118. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/ref_pb2_grpc.py +0 -0
  119. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/remote_pb2.py +0 -0
  120. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/remote_pb2_grpc.py +0 -0
  121. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/server_pb2.py +0 -0
  122. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/server_pb2_grpc.py +0 -0
  123. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/shared_pb2.py +0 -0
  124. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/stub/shared_pb2_grpc.py +0 -0
  125. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tag.py +0 -0
  126. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/bundle.py +0 -0
  127. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/context.py +0 -0
  128. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/grpc.py +0 -0
  129. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/multiprocessing.py +0 -0
  130. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/ssh.py +0 -0
  131. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/sshd.py +0 -0
  132. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/storage.py +0 -0
  133. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/tests/__init__.py +0 -0
  134. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/testing/tests/test_sshd.py +0 -0
  135. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/__init__.py +0 -0
  136. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/common.py +0 -0
  137. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_branch.py +0 -0
  138. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_diff.py +0 -0
  139. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_errors.py +0 -0
  140. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_feature.py +0 -0
  141. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_file_context.py +0 -0
  142. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_gitlab_ref.py +0 -0
  143. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_identification.py +0 -0
  144. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_manifest.py +0 -0
  145. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_messages.py +0 -0
  146. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_oid.py +0 -0
  147. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_peer.py +0 -0
  148. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_repository.py +0 -0
  149. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_revision.py +0 -0
  150. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_revset.py +0 -0
  151. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_servicer.py +0 -0
  152. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_stream.py +0 -0
  153. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_tag.py +0 -0
  154. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/tests/test_workdir.py +0 -0
  155. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/util.py +0 -0
  156. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly/workdir.py +0 -0
  157. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly.egg-info/dependency_links.txt +0 -0
  158. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly.egg-info/entry_points.txt +0 -0
  159. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/hgitaly.egg-info/top_level.txt +0 -0
  160. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/setup.cfg +0 -0
  161. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/setup.py +0 -0
  162. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/__init__.py +0 -0
  163. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/comparison.py +0 -0
  164. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/conftest.py +0 -0
  165. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/gitaly.py +0 -0
  166. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/hgitaly_rhgitaly_comparison.py +0 -0
  167. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/rhgitaly.py +0 -0
  168. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_blob_tree.py +0 -0
  169. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_comparison.py +0 -0
  170. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_diff.py +0 -0
  171. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_gitaly_server.py +0 -0
  172. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_mercurial_aux_git.py +0 -0
  173. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_mercurial_operations.py +0 -0
  174. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_mercurial_repository.py +0 -0
  175. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_operations.py +0 -0
  176. {hgitaly-18.1.0a0 → hgitaly-18.2.0}/tests_with_gitaly/test_remote.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hgitaly
3
- Version: 18.1.0a0
3
+ Version: 18.2.0
4
4
  Summary: Server-side implementation of Gitaly protocol for Mercurial
5
5
  Home-page: https://foss.heptapod.net/heptapod/hgitaly
6
6
  Author: Georges Racinet
@@ -10,11 +10,12 @@ Keywords: hg mercurial heptapod gitlab
10
10
  Requires-Python: >=3.8
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: heptapod>=5.0.0dev0
13
+ Requires-Dist: heptapod>=5.2.0dev0
14
14
  Requires-Dist: protobuf~=5.26.0
15
15
  Requires-Dist: grpcio~=1.63.0
16
16
  Requires-Dist: grpcio-status~=1.63.0
17
17
  Requires-Dist: grpc-interceptor
18
+ Requires-Dist: grpcio-health-checking
18
19
  Requires-Dist: hg-loggingmod>=0.4.1
19
20
  Requires-Dist: psutil
20
21
  Requires-Dist: importlib_resources~=2.0.0
@@ -0,0 +1 @@
1
+ 18.2.0
@@ -23,6 +23,9 @@ import mercurial
23
23
  import signal
24
24
  from urllib.parse import urlparse
25
25
 
26
+ from grpc_health.v1 import health
27
+ from grpc_health.v1 import health_pb2_grpc
28
+
26
29
  from ..service.interceptors import (
27
30
  RequestLoggerInterceptor,
28
31
  )
@@ -112,6 +115,12 @@ def init(listen_urls, storages):
112
115
  RepositoryServicer(storages), server)
113
116
  add_ServerServiceServicer_to_server(ServerServicer(storages), server)
114
117
 
118
+ # see https://github.com/grpc/grpc
119
+ # /blob/master/examples/python/health_checking/greeter_server.py
120
+ # on how to toggle the health status
121
+ health_servicer = health.HealthServicer()
122
+ health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
123
+
115
124
  for url in listen_urls:
116
125
  try:
117
126
  parsed_url = urlparse(url)
@@ -7,7 +7,6 @@
7
7
  # SPDX-License-Identifier: GPL-2.0-or-later
8
8
  import itertools
9
9
  import logging
10
- import os
11
10
 
12
11
  from grpc import StatusCode
13
12
  from google.protobuf.timestamp_pb2 import Timestamp
@@ -38,10 +37,6 @@ from ..git import (
38
37
  GitPathSpec,
39
38
  GitLiteralPathSpec,
40
39
  )
41
- from ..linguist import (
42
- language_color,
43
- language_stats,
44
- )
45
40
  from ..logging import LoggerAdapter
46
41
  from ..oid import (
47
42
  tree_oid,
@@ -92,8 +87,6 @@ from ..stub.commit_pb2 import (
92
87
  FindCommitsError,
93
88
  FindCommitsRequest,
94
89
  FindCommitsResponse,
95
- CommitLanguagesRequest,
96
- CommitLanguagesResponse,
97
90
  RawBlameError,
98
91
  RawBlameRequest,
99
92
  RawBlameResponse,
@@ -126,7 +119,6 @@ from ..util import (
126
119
  chunked,
127
120
  chunked_with_cursor,
128
121
  )
129
- from ..workdir import WorkingDirectoryError
130
122
 
131
123
  base_logger = logging.getLogger(__name__)
132
124
 
@@ -647,37 +639,6 @@ class CommitServicer(CommitServiceServicer, HGitalyServicer):
647
639
  with_short_stats=with_short_stats)
648
640
  for rev in chunk))
649
641
 
650
- def CommitLanguages(self, request: CommitLanguagesRequest,
651
- context) -> CommitLanguagesResponse:
652
- logger = LoggerAdapter(base_logger, context)
653
- repo = self.load_repo(request.repository, context)
654
- changeset = gitlab_revision_changeset(repo, request.revision)
655
- tokei_bin_path = os.fsdecode(
656
- repo.ui.config(b'hgitaly', b'tokei-executable')
657
- )
658
- try:
659
- with self.working_dir(gl_repo=request.repository,
660
- repo=repo,
661
- context=context,
662
- changeset=changeset) as wd:
663
-
664
- stats, total = language_stats(tokei_bin_path, wd.path, context)
665
- Language = CommitLanguagesResponse.Language
666
- resp_langs = []
667
- for lang_name, lang_stats in stats.items():
668
- resp_langs.append(Language(
669
- name=lang_name,
670
- share=100 * lang_stats['total_bytes'] / total,
671
- bytes=lang_stats['total_bytes'],
672
- color=language_color(lang_name),
673
- ))
674
- resp_langs.sort(key=lambda lang: -lang.share)
675
- return CommitLanguagesResponse(languages=resp_langs)
676
- except WorkingDirectoryError as exc:
677
- logger.warning("Failed to acquire a working directory"
678
- "at stage %r" % exc.args[0])
679
- return CommitLanguagesResponse()
680
-
681
642
  def RawBlame(self, request: RawBlameRequest,
682
643
  context) -> RawBlameResponse:
683
644
  repo = self.load_repo(request.repository, context)
@@ -110,7 +110,9 @@ class MercurialOperationsServicer(MercurialOperationsServiceServicer,
110
110
  client_id=request.client_id,
111
111
  incarnation_id=request.incarnation_id,
112
112
  changeset=changeset)
113
- repos_root = os.fsdecode(self.storages[gl_repo.storage_name])
113
+ # TODO wd_rpath should be a method on WorkingDirectory
114
+ repos_root = os.fsdecode(self.storage_root_dir(gl_repo.storage_name,
115
+ context))
114
116
  wd_rpath = str(wd.path.relative_to(repos_root))
115
117
 
116
118
  return GetWorkingDirectoryResponse(working_directory_id=wd.id,
@@ -193,7 +193,10 @@ class RefServicer(RefServiceServicer, HGitalyServicer):
193
193
  context) -> FindAllBranchesResponse:
194
194
  Branch = FindAllBranchesResponse.Branch
195
195
  repo = self.load_repo(request.repository, context)
196
- for chunk in chunked(iter_gitlab_branches(repo)):
196
+ for chunk in chunked(sorted_gitlab_branches_as_refs(
197
+ repo,
198
+ sort_by=BranchSortBy.FULL_REF_NAME
199
+ )):
197
200
  yield FindAllBranchesResponse(
198
201
  branches=(Branch(name=name, target=message.commit(head))
199
202
  for name, head in chunk))
@@ -27,6 +27,7 @@ from mercurial.commands import (
27
27
  )
28
28
 
29
29
  from heptapod.gitlab.branch import gitlab_branch_from_ref
30
+ from heptapod.hgrc import init_project_hgrc_files
30
31
  from hgext3rd.heptapod import (
31
32
  backup_additional,
32
33
  restore_additional,
@@ -53,7 +54,6 @@ from ..gitlab_ref import (
53
54
  ensure_special_refs,
54
55
  gitlab_special_ref_target,
55
56
  )
56
- from ..license_detector import detect_license
57
57
  from ..logging import LoggerAdapter
58
58
  from ..path import (
59
59
  InvalidPath,
@@ -81,7 +81,6 @@ from ..util import (
81
81
  chunked,
82
82
  )
83
83
  from ..workdir import (
84
- WorkingDirectoryError,
85
84
  remove_all_workdirs_bare,
86
85
  )
87
86
  from ..stub.repository_pb2 import (
@@ -97,8 +96,6 @@ from ..stub.repository_pb2 import (
97
96
  CreateRepositoryFromBundleResponse,
98
97
  FetchBundleRequest,
99
98
  FetchBundleResponse,
100
- FindLicenseRequest,
101
- FindLicenseResponse,
102
99
  FindMergeBaseRequest,
103
100
  FindMergeBaseResponse,
104
101
  GetRawChangesRequest,
@@ -383,8 +380,12 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
383
380
  def CreateRepository(self, request: CreateRepositoryRequest,
384
381
  context) -> CreateRepositoryResponse:
385
382
  default_branch = request.default_branch
383
+ grpc_repo = request.repository
386
384
  try:
387
- repo = self.create_and_load_repo(request.repository, context)
385
+ repo = self.create_and_load_repo(grpc_repo, context)
386
+ init_project_hgrc_files(repo,
387
+ grpc_repo.relative_path,
388
+ grpc_repo.gl_project_path)
388
389
  if default_branch:
389
390
  set_default_gitlab_branch(repo, default_branch)
390
391
  finally:
@@ -566,6 +567,8 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
566
567
 
567
568
  def RemoveRepository(self, request: RemoveRepositoryRequest,
568
569
  context) -> RemoveRepositoryResponse:
570
+ grpc_repo = request.repository
571
+
569
572
  # The protocol comment says, as of Gitaly 14.8:
570
573
  # RemoveRepository will move the repository to
571
574
  # `+gitaly/tmp/<relative_path>_removed` and
@@ -575,7 +578,7 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
575
578
  # Gitaly server implementation. The renaming is done for
576
579
  # atomicity purposes.
577
580
  try:
578
- repo_path = self.repo_disk_path(request.repository, context)
581
+ repo_path = self.repo_disk_path(grpc_repo, context)
579
582
  except KeyError as exc:
580
583
  self.handle_key_error(context, exc.args)
581
584
  except ValueError as exc:
@@ -587,7 +590,7 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
587
590
  context.abort(StatusCode.NOT_FOUND, "repository not found")
588
591
 
589
592
  trash_path = os.path.join(
590
- self.temp_dir(request.repository.storage_name, context),
593
+ self.temp_dir(grpc_repo.storage_name, context),
591
594
  os.path.basename(repo_path) + b'+removed-%f' % time.time())
592
595
  # The rename being atomic, it avoids leaving a crippled repo behind
593
596
  # in case of problem in the removal.
@@ -601,9 +604,13 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
601
604
 
602
605
  # at this point, the repo officially does not exist any more, the
603
606
  # roster file does not matter, cleanup workdirs if any.
604
- remove_all_workdirs_bare(self.repo_workdirs_root(request.repository,
605
- context))
607
+ remove_all_workdirs_bare(self.repo_workdirs_root(grpc_repo, context))
606
608
  shutil.rmtree(trash_path)
609
+
610
+ aux_git_path = self.aux_git_repo_disk_path(grpc_repo, context)
611
+ if os.path.exists(aux_git_path):
612
+ shutil.rmtree(aux_git_path)
613
+
607
614
  return RemoveRepositoryResponse()
608
615
 
609
616
  def CreateBundle(self, request: CreateBundleRequest,
@@ -727,36 +734,6 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
727
734
  gc.collect()
728
735
  return CreateRepositoryFromBundleResponse()
729
736
 
730
- def FindLicense(self, request: FindLicenseRequest,
731
- context) -> FindLicenseResponse:
732
- logger = LoggerAdapter(base_logger, context)
733
- repo = self.load_repo(request.repository, context)
734
- # we'll work on the head of the default GitLab branch
735
- changeset = gitlab_revision_changeset(repo, b'HEAD')
736
- detector_bin_path = os.fsdecode(
737
- repo.ui.config(b'hgitaly', b'license-detector-executable')
738
- )
739
- try:
740
- with self.working_dir(gl_repo=request.repository,
741
- repo=repo,
742
- context=context,
743
- changeset=changeset) as wd:
744
- detected = detect_license(detector_bin_path, wd.path, context)
745
- except WorkingDirectoryError as exc:
746
- logger.warning("Failed to acquire a working directory"
747
- "at stage %r" % exc.args[0])
748
- detected = None
749
-
750
- if detected is None:
751
- return FindLicenseResponse()
752
- return FindLicenseResponse(
753
- license_short_name=detected['spdx_id'],
754
- license_name=detected.get('full_name'),
755
- license_path=detected.get('file'),
756
- license_url=detected.get('url'),
757
- license_nickname=detected.get('nickname'),
758
- )
759
-
760
737
 
761
738
  def render_git_grep_matches(buf, ref, path, enum_lines):
762
739
  """Render a slice of lines as git grep does.
@@ -6,6 +6,8 @@
6
6
  # SPDX-License-Identifier: GPL-2.0-or-later
7
7
  import logging
8
8
 
9
+ from mercurial import util as hgutil
10
+
9
11
  from hgitaly import __version__
10
12
  from ..servicer import HGitalyServicer
11
13
  from ..stub.server_pb2 import (
@@ -24,7 +26,10 @@ class ServerServicer(ServerServiceServicer, HGitalyServicer):
24
26
  def ServerInfo(self,
25
27
  request: ServerInfoRequest,
26
28
  context) -> ServerInfoResponse:
27
- return ServerInfoResponse(server_version=__version__)
29
+ hg_version = hgutil.version().decode()
30
+ return ServerInfoResponse(server_version=__version__,
31
+ git_version=hg_version,
32
+ )
28
33
 
29
34
  def ServerSignature(self,
30
35
  request: ServerSignatureRequest,
@@ -13,7 +13,6 @@ from mercurial import (
13
13
  from mercurial.node import nullhex as NULL_HEX
14
14
  from mercurial_testhelpers import (
15
15
  as_bytes,
16
- RepoWrapper,
17
16
  )
18
17
  from google.protobuf.timestamp_pb2 import Timestamp
19
18
  from hgext3rd.heptapod.branch import (
@@ -39,8 +38,6 @@ from hgitaly.tests.common import (
39
38
  from hgitaly.stub.commit_pb2 import (
40
39
  CommitIsAncestorRequest,
41
40
  CommitsByMessageRequest,
42
- CommitLanguagesRequest,
43
- CommitLanguagesResponse,
44
41
  CommitStatsRequest,
45
42
  CountCommitsRequest,
46
43
  CountDivergingCommitsRequest,
@@ -151,10 +148,6 @@ class CommitFixture(ServiceFixture):
151
148
  resp = self.stub.ListCommits(request)
152
149
  return [c.id.encode('ascii') for chunk in resp for c in chunk.commits]
153
150
 
154
- def commit_languages(self, **kw):
155
- request = CommitLanguagesRequest(repository=self.grpc_repo, **kw)
156
- return list(self.stub.CommitLanguages(request).languages)
157
-
158
151
  def last_commit_for_path(self, revision, path, **kw):
159
152
  """Call the method, returning directly commit.id, as bytes"""
160
153
  grpc_repo = kw.pop('grpc_repo', self.grpc_repo)
@@ -1431,57 +1424,3 @@ def test_list_commits(commit_fixture_empty_repo):
1431
1424
  wrapper.command('amend', message=b'amended')
1432
1425
  assert ctx4.obsolete()
1433
1426
  assert list_commits(sha4, limit=2) == [sha4, sha3]
1434
-
1435
-
1436
- def test_commit_languages(commit_fixture_empty_repo):
1437
- fixture = commit_fixture_empty_repo
1438
- wrapper = fixture.repo_wrapper
1439
-
1440
- # a Python file with valid content, including a blank line
1441
- wrapper.commit_file('foo.py',
1442
- content="import sys\n\nprint(sys.version)\n",
1443
- message="Some Python",
1444
- )
1445
- # a Ruby file with valid content, with a comment
1446
- wrapper.commit_file('bar.rb',
1447
- content=("# frozen_string_literal: true\n"
1448
- "\n"
1449
- "module Bar\n"
1450
- "def f(x)\n"
1451
- " x+1\n"
1452
- ),
1453
- message="Some Ruby",
1454
- )
1455
-
1456
- Language = CommitLanguagesResponse.Language
1457
- assert fixture.commit_languages() == [
1458
- Language(name='Ruby',
1459
- bytes=57,
1460
- share=64.7727279663086,
1461
- color="#701516"),
1462
- Language(name='Python',
1463
- bytes=31,
1464
- share=35.227272033691406,
1465
- color="#3572A5"),
1466
- ]
1467
-
1468
- # color defaulting: COBOL does not have a color in github-linguist's
1469
- # `languages.json`
1470
- wrapper.commit_file(
1471
- 'truc.cob',
1472
- content="Not really pretending to be COBOL, "
1473
- "extension should be enough")
1474
- assert fixture.commit_languages()[0] == Language(name='COBOL',
1475
- bytes=61,
1476
- share=40.939598083496094,
1477
- color="#d29900")
1478
-
1479
- # test with a subrepo, see heptapod#1287
1480
- nested_path = wrapper.path / 'nested'
1481
- nested = RepoWrapper.init(nested_path)
1482
- nested.commit_file("bar", content="in nested")
1483
- (wrapper.path / '.hgsub').write_bytes(b"nested = nested\n")
1484
- wrapper.command(b'add', subrepos=True)
1485
- wrapper.command(b'commit', subrepos=True, message=b"invalid")
1486
-
1487
- assert fixture.commit_languages() == []
@@ -628,8 +628,12 @@ def test_censor(operations_fixture, project_mode):
628
628
  assert 'not found' in exc.details().lower()
629
629
 
630
630
 
631
- def test_working_directories(operations_fixture, server_repos_root):
631
+ @parametrize('storage', ('vcs-qualified-storage', 'bare-storage'))
632
+ def test_working_directories(operations_fixture, server_repos_root, storage):
632
633
  fixture = operations_fixture
634
+ if storage == 'vcs-qualified-storage':
635
+ fixture.grpc_repo.storage_name = 'hg:default'
636
+
633
637
  gl_rev = b'branch/default'
634
638
  wrapper = fixture.repo_wrapper
635
639
  cs0 = wrapper.commit_file('foo')
@@ -187,7 +187,7 @@ def test_find_branch(grpc_channel, server_repos_root):
187
187
  FindAllBranchesRequest(repository=grpc_repo))
188
188
  branches = [br for chunk in resp for br in chunk.branches]
189
189
  assert len(branches) == 1
190
- assert branches[0].name == b'branch/default'
190
+ assert branches[0].name == b'refs/heads/branch/default'
191
191
  assert branches[0].target == branch.target_commit
192
192
 
193
193
  resp = list(ref_stub.FindAllRemoteBranches(
@@ -23,18 +23,15 @@ from mercurial_testhelpers import (
23
23
  from hgext3rd.heptapod.branch import (
24
24
  get_default_gitlab_branch,
25
25
  read_gitlab_typed_refs,
26
- set_default_gitlab_branch,
27
26
  )
28
27
  from hgext3rd.heptapod.keep_around import (
29
28
  create_keep_around,
30
29
  iter_keep_arounds,
31
30
  )
32
31
 
33
- from mercurial_testhelpers import RepoWrapper
34
-
35
32
  from hgitaly.identification import CLIENT_ID, INCARNATION_ID
36
- from hgitaly.license_detector import license_content
37
33
  from hgitaly.revision import ZERO_SHA
34
+ from hgitaly.servicer import AUX_GIT_REPOS_RELATIVE_DIR
38
35
  from hgitaly.stream import WRITE_BUFFER_SIZE
39
36
  from hgitaly.testing import TEST_DATA_DIR
40
37
  from hgitaly.testing.bundle import list_bundle_contents
@@ -54,8 +51,6 @@ from hgitaly.stub.repository_pb2 import (
54
51
  CreateRepositoryRequest,
55
52
  CreateBundleFromRefListRequest,
56
53
  FetchBundleRequest,
57
- FindLicenseRequest,
58
- FindLicenseResponse,
59
54
  FindMergeBaseRequest,
60
55
  GetArchiveRequest,
61
56
  GetCustomHooksRequest,
@@ -255,10 +250,6 @@ class RepositoryFixture(ServiceFixture):
255
250
  for chunk in stream.slice_binary_file(bundle_path, nb_chunks)
256
251
  )
257
252
 
258
- def find_license(self):
259
- return self.stub.FindLicense(FindLicenseRequest(
260
- repository=self.grpc_repo))
261
-
262
253
  def create_bundle_from_ref_list(self, bundle_path, ref_patterns,
263
254
  nb_chunks=2,
264
255
  without_repository=False):
@@ -626,6 +617,9 @@ def test_create_repository(fixture_without_repo):
626
617
  fixture.create_repository(rel_path)
627
618
  # instantiating wrapper to check successful repo creation
628
619
  assert fixture.repo_wrapper.repo.path.endswith(b'sample_repo/.hg')
620
+ # hgrc creation
621
+ hgrc = fixture.repo_wrapper.path / '.hg/hgrc'
622
+ assert b'%include hgrc.managed' in hgrc.read_bytes()
629
623
 
630
624
  # As of Gitaly 14.6, attempt to create existing repo is an error.
631
625
  with pytest.raises(grpc.RpcError) as exc_info:
@@ -895,6 +889,13 @@ def test_remove_repository(fixture_with_repo, wds_success):
895
889
  fixture = fixture_with_repo
896
890
  wrapper, grpc_repo = fixture.repo_wrapper, fixture.grpc_repo
897
891
  repo = wrapper.repo
892
+
893
+ aux_git_dir = (fixture.storage_path()
894
+ / AUX_GIT_REPOS_RELATIVE_DIR
895
+ / grpc_repo.relative_path)
896
+ os.makedirs(aux_git_dir, exist_ok=True)
897
+ (aux_git_dir / 'anyfile').write_bytes(b'anything')
898
+
898
899
  tmp_dir = wrapper.path.parent / '+hgitaly/tmp'
899
900
  wds_root = tmp_dir / 'workdirs' / grpc_repo.relative_path
900
901
 
@@ -915,6 +916,9 @@ def test_remove_repository(fixture_with_repo, wds_success):
915
916
  # no other leftovers alongside the removed repo
916
917
  assert os.listdir(fixture.storage_path()) == ['+hgitaly']
917
918
 
919
+ # aux Git repo was removed
920
+ assert not aux_git_dir.exists()
921
+
918
922
  # no leftover in the temporary directory either
919
923
  assert not os.listdir(tmp_dir / 'workdirs')
920
924
 
@@ -1220,37 +1224,6 @@ def test_create_bundle_from_ref_list(fixture_with_repo, tmpdir):
1220
1224
  assert unbundled_repo[sha1].phase() == phases.draft
1221
1225
 
1222
1226
 
1223
- def test_find_license(fixture_with_repo):
1224
- find_license = fixture_with_repo.find_license
1225
- wrapper = fixture_with_repo.repo_wrapper
1226
-
1227
- # empty repo
1228
- assert find_license() == FindLicenseResponse()
1229
-
1230
- wrapper.commit_file('COPYING', message="lic",
1231
- content=license_content('GPL-2'))
1232
- set_default_gitlab_branch(wrapper.repo, b'branch/default')
1233
- resp = find_license()
1234
- # this result is wrong in the absolute but it is really what
1235
- # go-license-detector and hence Gitaly returns (check comparison tests)
1236
- assert resp.license_short_name == 'gpl-2.0+'
1237
- assert resp.license_path == 'COPYING'
1238
-
1239
- wrapper.commit_file('COPYING', content="Some garbage")
1240
- resp = find_license()
1241
- assert resp.license_path == 'COPYING'
1242
- assert resp.license_short_name == 'other'
1243
-
1244
- # test with a subrepo, see heptapod#1287
1245
- nested_path = wrapper.path / 'nested'
1246
- nested = RepoWrapper.init(nested_path)
1247
- nested.commit_file("bar", content="in nested")
1248
- (wrapper.path / '.hgsub').write_bytes(b"nested = nested\n")
1249
- wrapper.command(b'add', subrepos=True)
1250
- wrapper.command(b'commit', subrepos=True, message=b"invalid")
1251
- assert find_license() == FindLicenseResponse()
1252
-
1253
-
1254
1227
  def test_object_format(fixture_with_repo):
1255
1228
  fixture = fixture_with_repo
1256
1229
  assert (fixture.object_format().format
@@ -12,6 +12,11 @@ from hgitaly.stub.server_pb2 import (
12
12
  ServerSignatureRequest,
13
13
  )
14
14
  from hgitaly.stub.server_pb2_grpc import ServerServiceStub
15
+ from grpc_health.v1.health_pb2 import (
16
+ HealthCheckRequest,
17
+ HealthCheckResponse,
18
+ )
19
+ from grpc_health.v1.health_pb2_grpc import HealthStub
15
20
 
16
21
 
17
22
  def test_server_info(grpc_channel):
@@ -22,6 +27,8 @@ def test_server_info(grpc_channel):
22
27
  assert version
23
28
  assert re.match(r'\d+[.]\d+[.]\d+',
24
29
  parse_version(version).base_version) is not None
30
+ hg_version = resp.git_version
31
+ assert re.match(r'\d+[.]\d+', hg_version)
25
32
 
26
33
 
27
34
  def test_server_signature(grpc_channel):
@@ -29,3 +36,13 @@ def test_server_signature(grpc_channel):
29
36
 
30
37
  resp = grpc_stub.ServerSignature(ServerSignatureRequest())
31
38
  assert resp.public_key == b''
39
+
40
+
41
+ def test_health(grpc_channel):
42
+ # does not test much, as the implementation is just registering the
43
+ # provided servicer, which is entirely duplicated
44
+ # in `confest.py`. At least it helps knowing the principle works
45
+ # for us, and Comparison Tests will do something more end-to-end.
46
+ grpc_stub = HealthStub(grpc_channel)
47
+ resp = grpc_stub.Check(HealthCheckRequest())
48
+ assert resp.status == HealthCheckResponse.SERVING
@@ -307,6 +307,14 @@ class HGitalyServicer:
307
307
  repo_path = os.path.join(root_dir, rpath.encode('ascii'))
308
308
  return repo_path
309
309
 
310
+ def aux_git_repo_disk_path(self, repository: Repository, context):
311
+ # GitLab filesystem paths are always ASCII. Not normalizing to `.hg`
312
+ # obviously.
313
+ rpath = repository.relative_path.encode('ascii')
314
+ root_dir = self.storage_root_dir(repository.storage_name, context)
315
+ return os.path.join(
316
+ root_dir, AUX_GIT_REPOS_RELATIVE_DIR.encode('ascii'), rpath)
317
+
310
318
  def temp_dir(self, storage_name, context, ensure=True):
311
319
  """Return the path to temporary directory for the given storage
312
320