kospex 0.4.0__tar.gz → 0.4.2__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 (344) hide show
  1. {kospex-0.4.0/src/kospex.egg-info → kospex-0.4.2}/PKG-INFO +1 -1
  2. {kospex-0.4.0 → kospex-0.4.2}/pyproject.toml +1 -1
  3. kospex-0.4.2/src/kospex/ca_bundles.py +110 -0
  4. kospex-0.4.2/src/kospex/dependencies/__init__.py +6 -0
  5. kospex-0.4.2/src/kospex/dependencies/version_diff.py +94 -0
  6. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/org_sync_manifest.py +15 -0
  7. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/syncs_view.py +54 -3
  8. {kospex-0.4.0 → kospex-0.4.2/src/kospex.egg-info}/PKG-INFO +1 -1
  9. {kospex-0.4.0 → kospex-0.4.2}/src/kospex.egg-info/SOURCES.txt +8 -0
  10. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_cli.py +404 -151
  11. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_dependencies.py +464 -31
  12. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_query.py +28 -1
  13. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_utils.py +130 -0
  14. {kospex-0.4.0 → kospex-0.4.2}/src/krunner.py +32 -0
  15. {kospex-0.4.0 → kospex-0.4.2}/src/kweb2.py +22 -0
  16. {kospex-0.4.0 → kospex-0.4.2}/src/static/css/tailwind.css +1 -1
  17. {kospex-0.4.0 → kospex-0.4.2}/src/templates/syncs.html +1 -1
  18. kospex-0.4.2/src/templates/syncs_run.html +150 -0
  19. kospex-0.4.2/tests/test_behind_fields.py +280 -0
  20. kospex-0.4.2/tests/test_ca_bundle.py +239 -0
  21. kospex-0.4.2/tests/test_connectivity.py +259 -0
  22. kospex-0.4.2/tests/test_first_release.py +931 -0
  23. {kospex-0.4.0 → kospex-0.4.2}/tests/test_sca_output_and_save.py +3 -2
  24. {kospex-0.4.0 → kospex-0.4.2}/tests/test_syncs_page.py +100 -0
  25. {kospex-0.4.0 → kospex-0.4.2}/tests/test_syncs_view.py +73 -0
  26. kospex-0.4.2/tests/test_version_diff.py +264 -0
  27. {kospex-0.4.0 → kospex-0.4.2}/tests/test_versions_behind_prerelease.py +40 -6
  28. kospex-0.4.0/tests/test_first_release.py +0 -246
  29. {kospex-0.4.0 → kospex-0.4.2}/LICENSE +0 -0
  30. {kospex-0.4.0 → kospex-0.4.2}/MANIFEST.in +0 -0
  31. {kospex-0.4.0 → kospex-0.4.2}/README.md +0 -0
  32. {kospex-0.4.0 → kospex-0.4.2}/README.short.md +0 -0
  33. {kospex-0.4.0 → kospex-0.4.2}/setup.cfg +0 -0
  34. {kospex-0.4.0 → kospex-0.4.2}/src/api_routes.py +0 -0
  35. {kospex-0.4.0 → kospex-0.4.2}/src/kgit.py +0 -0
  36. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/__init__.py +0 -0
  37. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/assessment_types.py +0 -0
  38. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/authorship.py +0 -0
  39. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/__init__.py +0 -0
  40. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/health.py +0 -0
  41. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/introspect.py +0 -0
  42. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0003_repos_sync_provenance.sql +0 -0
  43. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0004_repos_last_fetch.sql +0 -0
  44. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0005_dependency_data_resolution.sql +0 -0
  45. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0006_dependency_version_constraint.sql +0 -0
  46. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0007_file_metadata_repo_index.sql +0 -0
  47. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0008_osi_runs.sql +0 -0
  48. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0009_dependency_install_state.sql +0 -0
  49. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0010_osi_runs_finished_at.sql +0 -0
  50. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0011_commits_covering_index.sql +0 -0
  51. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0012_org_sync.sql +0 -0
  52. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0013_org_sync_listings.py +0 -0
  53. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/0013_org_sync_listings.sql +0 -0
  54. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/README.md +0 -0
  55. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrations/__init__.py +0 -0
  56. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/db/migrator.py +0 -0
  57. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/__init__.py +0 -0
  58. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/constraints.py +0 -0
  59. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/errors.py +0 -0
  60. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/gomod.py +0 -0
  61. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/gradle.py +0 -0
  62. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/maven.py +0 -0
  63. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/npmlock.py +0 -0
  64. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/nuget.py +0 -0
  65. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/pnpm.py +0 -0
  66. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/registry.py +0 -0
  67. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/uvlock.py +0 -0
  68. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/workflows.py +0 -0
  69. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/extractors/yarn.py +0 -0
  70. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/git_duckdb.py +0 -0
  71. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/git_ingest.py +0 -0
  72. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/github_dependabot.py +0 -0
  73. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/github_export.py +0 -0
  74. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/github_properties.py +0 -0
  75. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/habitat_config.py +0 -0
  76. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/integrations/__init__.py +0 -0
  77. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/integrations/snyk/__init__.py +0 -0
  78. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/integrations/snyk/cli.py +0 -0
  79. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/integrations/snyk/client.py +0 -0
  80. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/integrations/snyk/queries.py +0 -0
  81. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/npm_range.py +0 -0
  82. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/org_sync.py +0 -0
  83. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/org_sync_command.py +0 -0
  84. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/osi_extract.py +0 -0
  85. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/osi_lock.py +0 -0
  86. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/osi_next.py +0 -0
  87. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/osi_outcomes.py +0 -0
  88. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/osi_queue.py +0 -0
  89. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/osi_run_log.py +0 -0
  90. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/prerelease.py +0 -0
  91. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/private_packages.py +0 -0
  92. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/run_lock.py +0 -0
  93. {kospex-0.4.0 → kospex-0.4.2}/src/kospex/staleness.py +0 -0
  94. {kospex-0.4.0 → kospex-0.4.2}/src/kospex.egg-info/dependency_links.txt +0 -0
  95. {kospex-0.4.0 → kospex-0.4.2}/src/kospex.egg-info/entry_points.txt +0 -0
  96. {kospex-0.4.0 → kospex-0.4.2}/src/kospex.egg-info/requires.txt +0 -0
  97. {kospex-0.4.0 → kospex-0.4.2}/src/kospex.egg-info/top_level.txt +0 -0
  98. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_agent.py +0 -0
  99. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_bitbucket.py +0 -0
  100. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_core.py +0 -0
  101. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_email.py +0 -0
  102. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_git.py +0 -0
  103. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_github.py +0 -0
  104. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_logging.py +0 -0
  105. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_observation.py +0 -0
  106. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_rebuild.py +0 -0
  107. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_request_cache.py +0 -0
  108. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_schema.py +0 -0
  109. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_stats.py +0 -0
  110. {kospex-0.4.0 → kospex-0.4.2}/src/kospex_web.py +0 -0
  111. {kospex-0.4.0 → kospex-0.4.2}/src/kreaper.py +0 -0
  112. {kospex-0.4.0 → kospex-0.4.2}/src/krunner_utils.py +0 -0
  113. {kospex-0.4.0 → kospex-0.4.2}/src/kweb_graph_service.py +0 -0
  114. {kospex-0.4.0 → kospex-0.4.2}/src/kweb_help_service.py +0 -0
  115. {kospex-0.4.0 → kospex-0.4.2}/src/kweb_security.py +0 -0
  116. {kospex-0.4.0 → kospex-0.4.2}/src/static/css/datatables.min.css +0 -0
  117. {kospex-0.4.0 → kospex-0.4.2}/src/static/css/input.css +0 -0
  118. {kospex-0.4.0 → kospex-0.4.2}/src/static/favicon.ico +0 -0
  119. {kospex-0.4.0 → kospex-0.4.2}/src/static/js/chart.min.js +0 -0
  120. {kospex-0.4.0 → kospex-0.4.2}/src/static/js/d3.min.js +0 -0
  121. {kospex-0.4.0 → kospex-0.4.2}/src/static/js/datatables.min.js +0 -0
  122. {kospex-0.4.0 → kospex-0.4.2}/src/static/js/jquery.min.js +0 -0
  123. {kospex-0.4.0 → kospex-0.4.2}/src/templates/404.html +0 -0
  124. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_breadcrumb.html +0 -0
  125. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_datatable_scripts.html +0 -0
  126. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_entity_header.html +0 -0
  127. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_footer_scripts.html +0 -0
  128. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_header.html +0 -0
  129. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_id_header_macro.html +0 -0
  130. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_radar_macro.html +0 -0
  131. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_retired_tag_note.html +0 -0
  132. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_scope_label.html +0 -0
  133. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_single_radar.html +0 -0
  134. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_status_circles_macro.html +0 -0
  135. {kospex-0.4.0 → kospex-0.4.2}/src/templates/_unsupported_files_warning.html +0 -0
  136. {kospex-0.4.0 → kospex-0.4.2}/src/templates/bubble.html +0 -0
  137. {kospex-0.4.0 → kospex-0.4.2}/src/templates/collab.html +0 -0
  138. {kospex-0.4.0 → kospex-0.4.2}/src/templates/collab_graph.html +0 -0
  139. {kospex-0.4.0 → kospex-0.4.2}/src/templates/commit.html +0 -0
  140. {kospex-0.4.0 → kospex-0.4.2}/src/templates/commit_history.html +0 -0
  141. {kospex-0.4.0 → kospex-0.4.2}/src/templates/commits.html +0 -0
  142. {kospex-0.4.0 → kospex-0.4.2}/src/templates/dependencies.html +0 -0
  143. {kospex-0.4.0 → kospex-0.4.2}/src/templates/developer_view.html +0 -0
  144. {kospex-0.4.0 → kospex-0.4.2}/src/templates/developers.html +0 -0
  145. {kospex-0.4.0 → kospex-0.4.2}/src/templates/file_collaboration.html +0 -0
  146. {kospex-0.4.0 → kospex-0.4.2}/src/templates/files.html +0 -0
  147. {kospex-0.4.0 → kospex-0.4.2}/src/templates/graph.html +0 -0
  148. {kospex-0.4.0 → kospex-0.4.2}/src/templates/header.html +0 -0
  149. {kospex-0.4.0 → kospex-0.4.2}/src/templates/help/index.html +0 -0
  150. {kospex-0.4.0 → kospex-0.4.2}/src/templates/hotspots.html +0 -0
  151. {kospex-0.4.0 → kospex-0.4.2}/src/templates/key_person.html +0 -0
  152. {kospex-0.4.0 → kospex-0.4.2}/src/templates/landscape.html +0 -0
  153. {kospex-0.4.0 → kospex-0.4.2}/src/templates/meta-author-domains.html +0 -0
  154. {kospex-0.4.0 → kospex-0.4.2}/src/templates/metadata.html +0 -0
  155. {kospex-0.4.0 → kospex-0.4.2}/src/templates/metadata_repos.html +0 -0
  156. {kospex-0.4.0 → kospex-0.4.2}/src/templates/observation.html +0 -0
  157. {kospex-0.4.0 → kospex-0.4.2}/src/templates/observations.html +0 -0
  158. {kospex-0.4.0 → kospex-0.4.2}/src/templates/observations_repo.html +0 -0
  159. {kospex-0.4.0 → kospex-0.4.2}/src/templates/observations_repo_key.html +0 -0
  160. {kospex-0.4.0 → kospex-0.4.2}/src/templates/org_view.html +0 -0
  161. {kospex-0.4.0 → kospex-0.4.2}/src/templates/orgs.html +0 -0
  162. {kospex-0.4.0 → kospex-0.4.2}/src/templates/orphans.html +0 -0
  163. {kospex-0.4.0 → kospex-0.4.2}/src/templates/osi.html +0 -0
  164. {kospex-0.4.0 → kospex-0.4.2}/src/templates/package_check.html +0 -0
  165. {kospex-0.4.0 → kospex-0.4.2}/src/templates/repo_files.html +0 -0
  166. {kospex-0.4.0 → kospex-0.4.2}/src/templates/repo_view.html +0 -0
  167. {kospex-0.4.0 → kospex-0.4.2}/src/templates/repos-tech.html +0 -0
  168. {kospex-0.4.0 → kospex-0.4.2}/src/templates/repos.html +0 -0
  169. {kospex-0.4.0 → kospex-0.4.2}/src/templates/servers.html +0 -0
  170. {kospex-0.4.0 → kospex-0.4.2}/src/templates/summary.html +0 -0
  171. {kospex-0.4.0 → kospex-0.4.2}/src/templates/summary2.html +0 -0
  172. {kospex-0.4.0 → kospex-0.4.2}/src/templates/supply_chain.html +0 -0
  173. {kospex-0.4.0 → kospex-0.4.2}/src/templates/supply_chain_search.html +0 -0
  174. {kospex-0.4.0 → kospex-0.4.2}/src/templates/tags.html +0 -0
  175. {kospex-0.4.0 → kospex-0.4.2}/src/templates/tech-change.html +0 -0
  176. {kospex-0.4.0 → kospex-0.4.2}/src/templates/tenure.html +0 -0
  177. {kospex-0.4.0 → kospex-0.4.2}/src/templates/treemap.html +0 -0
  178. {kospex-0.4.0 → kospex-0.4.2}/tests/test_advisory_history_stub.py +0 -0
  179. {kospex-0.4.0 → kospex-0.4.2}/tests/test_assess_registry_dispatch.py +0 -0
  180. {kospex-0.4.0 → kospex-0.4.2}/tests/test_assessment_types.py +0 -0
  181. {kospex-0.4.0 → kospex-0.4.2}/tests/test_build_file_metadata_rows.py +0 -0
  182. {kospex-0.4.0 → kospex-0.4.2}/tests/test_clone_repo.py +0 -0
  183. {kospex-0.4.0 → kospex-0.4.2}/tests/test_clone_repo_integration.py +0 -0
  184. {kospex-0.4.0 → kospex-0.4.2}/tests/test_clone_repo_resolution.py +0 -0
  185. {kospex-0.4.0 → kospex-0.4.2}/tests/test_commit_history_gaps.py +0 -0
  186. {kospex-0.4.0 → kospex-0.4.2}/tests/test_commit_log_parsing.py +0 -0
  187. {kospex-0.4.0 → kospex-0.4.2}/tests/test_commits_covering_index.py +0 -0
  188. {kospex-0.4.0 → kospex-0.4.2}/tests/test_conftest_shell_kospex_db.py +0 -0
  189. {kospex-0.4.0 → kospex-0.4.2}/tests/test_constraint_classifier.py +0 -0
  190. {kospex-0.4.0 → kospex-0.4.2}/tests/test_date_ordering.py +0 -0
  191. {kospex-0.4.0 → kospex-0.4.2}/tests/test_db_health.py +0 -0
  192. {kospex-0.4.0 → kospex-0.4.2}/tests/test_db_introspect.py +0 -0
  193. {kospex-0.4.0 → kospex-0.4.2}/tests/test_db_migrator.py +0 -0
  194. {kospex-0.4.0 → kospex-0.4.2}/tests/test_declared_scope_manifests.py +0 -0
  195. {kospex-0.4.0 → kospex-0.4.2}/tests/test_dependencies_empty_state.py +0 -0
  196. {kospex-0.4.0 → kospex-0.4.2}/tests/test_dependencies_save.py +0 -0
  197. {kospex-0.4.0 → kospex-0.4.2}/tests/test_dependencies_template.py +0 -0
  198. {kospex-0.4.0 → kospex-0.4.2}/tests/test_dependency_data_unknown_integers.py +0 -0
  199. {kospex-0.4.0 → kospex-0.4.2}/tests/test_dependency_freshness.py +0 -0
  200. {kospex-0.4.0 → kospex-0.4.2}/tests/test_deps_command.py +0 -0
  201. {kospex-0.4.0 → kospex-0.4.2}/tests/test_deps_enrich_setting.py +0 -0
  202. {kospex-0.4.0 → kospex-0.4.2}/tests/test_deps_private.py +0 -0
  203. {kospex-0.4.0 → kospex-0.4.2}/tests/test_developer_stats_committer_time.py +0 -0
  204. {kospex-0.4.0 → kospex-0.4.2}/tests/test_developer_stats_sync.py +0 -0
  205. {kospex-0.4.0 → kospex-0.4.2}/tests/test_email_type.py +0 -0
  206. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extracted_file_keys.py +0 -0
  207. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractor_registry.py +0 -0
  208. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractor_unreadable_manifests.py +0 -0
  209. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_gomod.py +0 -0
  210. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_gradle.py +0 -0
  211. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_gradle_build.py +0 -0
  212. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_maven.py +0 -0
  213. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_npmlock.py +0 -0
  214. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_nuget.py +0 -0
  215. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_pnpm.py +0 -0
  216. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_uvlock.py +0 -0
  217. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_workflows.py +0 -0
  218. {kospex-0.4.0 → kospex-0.4.2}/tests/test_extractors_yarn.py +0 -0
  219. {kospex-0.4.0 → kospex-0.4.2}/tests/test_ff_only_pulls.py +0 -0
  220. {kospex-0.4.0 → kospex-0.4.2}/tests/test_file_metadata_repo_index.py +0 -0
  221. {kospex-0.4.0 → kospex-0.4.2}/tests/test_file_metadata_sync.py +0 -0
  222. {kospex-0.4.0 → kospex-0.4.2}/tests/test_files_page_links.py +0 -0
  223. {kospex-0.4.0 → kospex-0.4.2}/tests/test_generate_repo_id_endpoint.py +0 -0
  224. {kospex-0.4.0 → kospex-0.4.2}/tests/test_get_dependencies_latest.py +0 -0
  225. {kospex-0.4.0 → kospex-0.4.2}/tests/test_get_id_params.py +0 -0
  226. {kospex-0.4.0 → kospex-0.4.2}/tests/test_get_repo_authors_repo_id.py +0 -0
  227. {kospex-0.4.0 → kospex-0.4.2}/tests/test_github_auth_identity.py +0 -0
  228. {kospex-0.4.0 → kospex-0.4.2}/tests/test_github_dependabot.py +0 -0
  229. {kospex-0.4.0 → kospex-0.4.2}/tests/test_github_export.py +0 -0
  230. {kospex-0.4.0 → kospex-0.4.2}/tests/test_github_properties.py +0 -0
  231. {kospex-0.4.0 → kospex-0.4.2}/tests/test_github_token_matrix_runner.py +0 -0
  232. {kospex-0.4.0 → kospex-0.4.2}/tests/test_go_version_lookup.py +0 -0
  233. {kospex-0.4.0 → kospex-0.4.2}/tests/test_gomod_parsing.py +0 -0
  234. {kospex-0.4.0 → kospex-0.4.2}/tests/test_habitat_config.py +0 -0
  235. {kospex-0.4.0 → kospex-0.4.2}/tests/test_install_state_flags.py +0 -0
  236. {kospex-0.4.0 → kospex-0.4.2}/tests/test_interval_range_floor.py +0 -0
  237. {kospex-0.4.0 → kospex-0.4.2}/tests/test_key_person_cli.py +0 -0
  238. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit.py +0 -0
  239. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_clone_cli.py +0 -0
  240. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_clone_path_conflict.py +0 -0
  241. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_github_listing.py +0 -0
  242. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_pull.py +0 -0
  243. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_pull_stale.py +0 -0
  244. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_pull_sync.py +0 -0
  245. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_status.py +0 -0
  246. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kgit_sync_org_cli.py +0 -0
  247. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex.py +0 -0
  248. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_bitbucket.py +0 -0
  249. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_cli_upgrade_db.py +0 -0
  250. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_github_paginate.py +0 -0
  251. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_github_rate_limit.py +0 -0
  252. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_github_token_env.py +0 -0
  253. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_schema.py +0 -0
  254. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kospex_utils.py +0 -0
  255. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kreaper_dry_run.py +0 -0
  256. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_branches_missing_repo.py +0 -0
  257. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_filename.py +0 -0
  258. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_key_person_bus_factor.py +0 -0
  259. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_repo_size_summary.py +0 -0
  260. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_run_errors.py +0 -0
  261. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_scanner_security.py +0 -0
  262. {kospex-0.4.0 → kospex-0.4.2}/tests/test_krunner_todo.py +0 -0
  263. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kweb_help.py +0 -0
  264. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kweb_startup_db.py +0 -0
  265. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kweb_threadpool.py +0 -0
  266. {kospex-0.4.0 → kospex-0.4.2}/tests/test_kweb_trusted_host.py +0 -0
  267. {kospex-0.4.0 → kospex-0.4.2}/tests/test_last_commit_by_path.py +0 -0
  268. {kospex-0.4.0 → kospex-0.4.2}/tests/test_latest_commit_file_map.py +0 -0
  269. {kospex-0.4.0 → kospex-0.4.2}/tests/test_logging_sample_config.py +0 -0
  270. {kospex-0.4.0 → kospex-0.4.2}/tests/test_manifest_bom_handling.py +0 -0
  271. {kospex-0.4.0 → kospex-0.4.2}/tests/test_maven_bom_versions.py +0 -0
  272. {kospex-0.4.0 → kospex-0.4.2}/tests/test_merge_authorship.py +0 -0
  273. {kospex-0.4.0 → kospex-0.4.2}/tests/test_merge_file_rows.py +0 -0
  274. {kospex-0.4.0 → kospex-0.4.2}/tests/test_metadata_rebuild_guard.py +0 -0
  275. {kospex-0.4.0 → kospex-0.4.2}/tests/test_migration_banner_cli.py +0 -0
  276. {kospex-0.4.0 → kospex-0.4.2}/tests/test_npm_alias_lookup.py +0 -0
  277. {kospex-0.4.0 → kospex-0.4.2}/tests/test_npm_range.py +0 -0
  278. {kospex-0.4.0 → kospex-0.4.2}/tests/test_npm_range_floor.py +0 -0
  279. {kospex-0.4.0 → kospex-0.4.2}/tests/test_org_key_call_sites.py +0 -0
  280. {kospex-0.4.0 → kospex-0.4.2}/tests/test_org_key_encoding.py +0 -0
  281. {kospex-0.4.0 → kospex-0.4.2}/tests/test_org_sync.py +0 -0
  282. {kospex-0.4.0 → kospex-0.4.2}/tests/test_org_sync_command.py +0 -0
  283. {kospex-0.4.0 → kospex-0.4.2}/tests/test_org_sync_manifest.py +0 -0
  284. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_all_shares_extraction.py +0 -0
  285. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_dispatch.py +0 -0
  286. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_enrich_progress.py +0 -0
  287. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_extract_repo.py +0 -0
  288. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_extraction_view.py +0 -0
  289. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_lock.py +0 -0
  290. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_next_batch.py +0 -0
  291. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_next_cli.py +0 -0
  292. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_outcomes.py +0 -0
  293. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_queue.py +0 -0
  294. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_reads_disk_db.py +0 -0
  295. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_run_log.py +0 -0
  296. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_run_log_durability.py +0 -0
  297. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_runs_started_at.py +0 -0
  298. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_template.py +0 -0
  299. {kospex-0.4.0 → kospex-0.4.2}/tests/test_osi_time_budget.py +0 -0
  300. {kospex-0.4.0 → kospex-0.4.2}/tests/test_package_check_upload.py +0 -0
  301. {kospex-0.4.0 → kospex-0.4.2}/tests/test_panopticas_tag_contract.py +0 -0
  302. {kospex-0.4.0 → kospex-0.4.2}/tests/test_parse_datetime.py +0 -0
  303. {kospex-0.4.0 → kospex-0.4.2}/tests/test_prerelease.py +0 -0
  304. {kospex-0.4.0 → kospex-0.4.2}/tests/test_pull_org_resolve.py +0 -0
  305. {kospex-0.4.0 → kospex-0.4.2}/tests/test_py_modules_listed.py +0 -0
  306. {kospex-0.4.0 → kospex-0.4.2}/tests/test_pypi_assess_multi_specifier.py +0 -0
  307. {kospex-0.4.0 → kospex-0.4.2}/tests/test_pypi_declaration_parsing.py +0 -0
  308. {kospex-0.4.0 → kospex-0.4.2}/tests/test_pypi_range_floor.py +0 -0
  309. {kospex-0.4.0 → kospex-0.4.2}/tests/test_rebuild.py +0 -0
  310. {kospex-0.4.0 → kospex-0.4.2}/tests/test_remote_url_warning_stderr.py +0 -0
  311. {kospex-0.4.0 → kospex-0.4.2}/tests/test_repo_not_in_db.py +0 -0
  312. {kospex-0.4.0 → kospex-0.4.2}/tests/test_repo_org_header.py +0 -0
  313. {kospex-0.4.0 → kospex-0.4.2}/tests/test_repo_path_conflict.py +0 -0
  314. {kospex-0.4.0 → kospex-0.4.2}/tests/test_repos_by_tag.py +0 -0
  315. {kospex-0.4.0 → kospex-0.4.2}/tests/test_request_cache.py +0 -0
  316. {kospex-0.4.0 → kospex-0.4.2}/tests/test_requirements_encoding.py +0 -0
  317. {kospex-0.4.0 → kospex-0.4.2}/tests/test_requirements_type_mapping.py +0 -0
  318. {kospex-0.4.0 → kospex-0.4.2}/tests/test_resolution_status.py +0 -0
  319. {kospex-0.4.0 → kospex-0.4.2}/tests/test_rich_markup_neutralised.py +0 -0
  320. {kospex-0.4.0 → kospex-0.4.2}/tests/test_run_lock.py +0 -0
  321. {kospex-0.4.0 → kospex-0.4.2}/tests/test_sca_enriches_transitives.py +0 -0
  322. {kospex-0.4.0 → kospex-0.4.2}/tests/test_scope_resolution.py +0 -0
  323. {kospex-0.4.0 → kospex-0.4.2}/tests/test_set_params_by_id_scope.py +0 -0
  324. {kospex-0.4.0 → kospex-0.4.2}/tests/test_snyk_cli.py +0 -0
  325. {kospex-0.4.0 → kospex-0.4.2}/tests/test_snyk_client.py +0 -0
  326. {kospex-0.4.0 → kospex-0.4.2}/tests/test_snyk_queries.py +0 -0
  327. {kospex-0.4.0 → kospex-0.4.2}/tests/test_sqlite_floor.py +0 -0
  328. {kospex-0.4.0 → kospex-0.4.2}/tests/test_staleness.py +0 -0
  329. {kospex-0.4.0 → kospex-0.4.2}/tests/test_summary_circles.py +0 -0
  330. {kospex-0.4.0 → kospex-0.4.2}/tests/test_summary_statuses.py +0 -0
  331. {kospex-0.4.0 → kospex-0.4.2}/tests/test_supply_chain_unresolved.py +0 -0
  332. {kospex-0.4.0 → kospex-0.4.2}/tests/test_sync_directory_conflict.py +0 -0
  333. {kospex-0.4.0 → kospex-0.4.2}/tests/test_sync_repo_path_conflict.py +0 -0
  334. {kospex-0.4.0 → kospex-0.4.2}/tests/test_tags_index.py +0 -0
  335. {kospex-0.4.0 → kospex-0.4.2}/tests/test_tenure_empty_scope.py +0 -0
  336. {kospex-0.4.0 → kospex-0.4.2}/tests/test_unknown_id_404.py +0 -0
  337. {kospex-0.4.0 → kospex-0.4.2}/tests/test_url_cache_ttl.py +0 -0
  338. {kospex-0.4.0 → kospex-0.4.2}/tests/test_url_parsing_characterisation.py +0 -0
  339. {kospex-0.4.0 → kospex-0.4.2}/tests/test_version_constraint_columns.py +0 -0
  340. {kospex-0.4.0 → kospex-0.4.2}/tests/test_versions_behind_canonical.py +0 -0
  341. {kospex-0.4.0 → kospex-0.4.2}/tests/test_versions_behind_flavour.py +0 -0
  342. {kospex-0.4.0 → kospex-0.4.2}/tests/test_versions_behind_no_data.py +0 -0
  343. {kospex-0.4.0 → kospex-0.4.2}/tests/test_web_endpoints.py +0 -0
  344. {kospex-0.4.0 → kospex-0.4.2}/tests/test_where_tag_binding.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kospex
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: kospex - Code, Developer, Knowledge and Opensource Analytics.
5
5
  Author-email: Peter Freiberg <peter@kospex.io>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kospex"
7
- version = "0.4.0"
7
+ version = "0.4.2"
8
8
  description = "kospex - Code, Developer, Knowledge and Opensource Analytics."
9
9
  authors = [{ name = "Peter Freiberg", email = "peter@kospex.io" }]
10
10
  license = "MIT"
@@ -0,0 +1,110 @@
1
+ """Finding a CA bundle that lets requests verify an HTTPS host (#453).
2
+
3
+ requests verifies against certifi's bundle, or REQUESTS_CA_BUNDLE /
4
+ CURL_CA_BUNDLE when set; it never reads the operating system's store or
5
+ SSL_CERT_FILE. Behind a TLS-intercepting proxy the organisation's CA is
6
+ usually installed in the system store (that is what makes apt, dnf, curl and
7
+ git work), so the fix is to point REQUESTS_CA_BUNDLE at the system bundle.
8
+
9
+ `kospex connectivity` uses this module to find which system bundle verifies
10
+ deps.dev and, with -save, to write it to kospex.env. It replaced saving the
11
+ server's own certificate, which can never work as a bundle: verification needs
12
+ the CA that issued it, and REQUESTS_CA_BUNDLE replaces certifi rather than
13
+ adding to it, so a file of proxy certificates alone also breaks every host
14
+ that bypasses the proxy.
15
+ """
16
+ import os
17
+ import ssl
18
+ from dataclasses import dataclass
19
+ from typing import Optional
20
+
21
+ import requests
22
+
23
+ # Where distributions keep the system bundle, as one PEM file. Python's own
24
+ # default (ssl.get_default_verify_paths) is tried first; these cover the
25
+ # common Linux layouts when Python was built against another OpenSSL.
26
+ KNOWN_BUNDLE_PATHS = (
27
+ "/etc/ssl/certs/ca-certificates.crt", # Debian, Ubuntu, Alpine, Arch
28
+ "/etc/pki/tls/certs/ca-bundle.crt", # RHEL, Fedora, CentOS
29
+ "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", # RHEL, Fedora
30
+ "/etc/ssl/ca-bundle.pem", # SUSE
31
+ "/etc/ssl/cert.pem", # macOS, Alpine, BSD
32
+ )
33
+
34
+ BUNDLE_VARS = ("REQUESTS_CA_BUNDLE", "CURL_CA_BUNDLE")
35
+
36
+
37
+ def bundle_in_use() -> tuple[Optional[str], str]:
38
+ """(variable name or None, path) for the bundle requests will verify with.
39
+
40
+ requests reads the first non-empty of REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE,
41
+ and otherwise uses certifi.
42
+ """
43
+ for var in BUNDLE_VARS:
44
+ if os.environ.get(var):
45
+ return var, os.environ[var]
46
+ import certifi
47
+ return None, certifi.where()
48
+
49
+
50
+ def system_bundles() -> list[str]:
51
+ """Existing system CA bundle files, Python's default first, without duplicates.
52
+
53
+ Two names for one file (a symlink) are listed once, under the first name.
54
+ """
55
+ defaults = ssl.get_default_verify_paths()
56
+ seen, bundles = set(), []
57
+ for path in (defaults.cafile, defaults.openssl_cafile, *KNOWN_BUNDLE_PATHS):
58
+ if not path or not os.path.isfile(path):
59
+ continue
60
+ real = os.path.realpath(path)
61
+ if real in seen:
62
+ continue
63
+ seen.add(real)
64
+ bundles.append(path)
65
+ return bundles
66
+
67
+
68
+ @dataclass
69
+ class BundleCheck:
70
+ """The result of connecting to a URL with one CA bundle."""
71
+ path: str
72
+ verified: bool
73
+ error: Optional[str] = None # None when verified
74
+ ssl_error: bool = False # the failure was certificate verification
75
+
76
+
77
+ def check_bundle(path: str, url: str, timeout: int = 10) -> BundleCheck:
78
+ """Connect to `url` verifying with `path`. Any HTTP response is verified:
79
+ the TLS handshake succeeded, which is all that is being tested."""
80
+ try:
81
+ requests.get(url, timeout=timeout, verify=path)
82
+ return BundleCheck(path, True)
83
+ except requests.exceptions.SSLError as e:
84
+ return BundleCheck(path, False, str(e), ssl_error=True)
85
+ except (requests.RequestException, OSError) as e:
86
+ # OSError: requests' "Could not find a suitable TLS CA certificate bundle".
87
+ return BundleCheck(path, False, f"{type(e).__name__}: {e}")
88
+
89
+
90
+ def find_working_bundles(url: str, exclude=(), timeout: int = 10) -> list[BundleCheck]:
91
+ """check_bundle() for every system bundle not in `exclude`, in order."""
92
+ skip = {os.path.realpath(p) for p in exclude if p}
93
+ return [check_bundle(path, url, timeout) for path in system_bundles()
94
+ if os.path.realpath(path) not in skip]
95
+
96
+
97
+ def save_to_kospex_env(env_file: str, path: str) -> Optional[str]:
98
+ """Set REQUESTS_CA_BUNDLE=`path` in `env_file`, creating it if needed.
99
+
100
+ Other lines, comments included, are kept; an existing REQUESTS_CA_BUNDLE
101
+ line (with or without `export`) is replaced. Returns the value it
102
+ replaced, or None.
103
+ """
104
+ from dotenv import dotenv_values, set_key
105
+
106
+ previous = dotenv_values(env_file).get("REQUESTS_CA_BUNDLE") \
107
+ if os.path.exists(env_file) else None
108
+ os.makedirs(os.path.dirname(env_file) or ".", exist_ok=True)
109
+ set_key(env_file, "REQUESTS_CA_BUNDLE", path, quote_mode="never")
110
+ return previous
@@ -0,0 +1,6 @@
1
+ """Dependency analysis helpers for kospex.
2
+
3
+ Keep this file import-free: eager imports in package __init__ files have caused
4
+ circular imports with the flat kospex_* modules. Import submodules directly,
5
+ e.g. `from kospex.dependencies.version_diff import version_diff`.
6
+ """
@@ -0,0 +1,94 @@
1
+ """How far apart are two versions, by major / minor / patch? Pure: no I/O.
2
+
3
+ A rough, offline answer from the version numbers alone. It cannot say how many
4
+ releases sit between two versions -- for that, see
5
+ KospexDependencies.releases_between(), which reads deps.dev's version list.
6
+
7
+ Only the release numbers are compared. Pre-release and build tags
8
+ (`-rc.1`, `+build`, `.Final`, `-jre`) are ignored, so `1.2.3-rc.1` -> `1.2.3`
9
+ is "none". Missing components are 0, so `1.2` == `1.2.0`.
10
+
11
+ No semver meaning is applied: in semver a 0.x minor bump is breaking, and many
12
+ ecosystems (CalVer, Maven) do not follow semver at all. The level is the first
13
+ component that moved, nothing more.
14
+ """
15
+ import re
16
+
17
+ from packaging.version import InvalidVersion, Version
18
+
19
+ # Each repetition starts with a separator, so a digit run can match only one
20
+ # way and a failed match is linear (CWE-1333; versions come from deps.dev,
21
+ # where anyone can publish one).
22
+ _LEADING_NUMBERS = re.compile(r"[vV]?(\d+(?:\.\d+)*)")
23
+
24
+ LEVELS = ("major", "minor", "patch")
25
+
26
+
27
+ def parse_release(version, system=None):
28
+ """The release numbers of `version` as a tuple of ints, at least 3 long.
29
+
30
+ PyPI versions go through PEP 440 (`packaging`), which handles epochs
31
+ (`1!2.0`), `.postN` and `rcN` without separators. Everything else, and a
32
+ PyPI version `packaging` refuses, uses the leading dotted numbers after an
33
+ optional `v`. None when there is no leading number (`latest`, a range like
34
+ `^1.2.3` -- resolve a range to a version first).
35
+ """
36
+ if not isinstance(version, str):
37
+ return None
38
+ version = version.strip()
39
+ numbers = None
40
+ # ValueError as well as InvalidVersion: int() refuses a digit run longer
41
+ # than sys.get_int_max_str_digits() (4300), and anyone can publish a
42
+ # version. Unparseable, not an exception that ends a whole scan.
43
+ if (system or "").lower() == "pypi":
44
+ try:
45
+ numbers = Version(version).release
46
+ except (InvalidVersion, ValueError):
47
+ numbers = None
48
+ if numbers is None:
49
+ match = _LEADING_NUMBERS.match(version)
50
+ if not match:
51
+ return None
52
+ try:
53
+ numbers = tuple(int(n) for n in match.group(1).split("."))
54
+ except ValueError:
55
+ return None
56
+ return tuple(numbers) + (0,) * (3 - len(numbers))
57
+
58
+
59
+ def version_diff(from_version, to_version, system=None):
60
+ """Raw `to - from` per component: {"major", "minor", "patch"}, or None.
61
+
62
+ Raw means each component is subtracted on its own: 1.9.9 -> 3.0.0 is
63
+ {"major": 2, "minor": -9, "patch": -9}. A negative minor or patch under a
64
+ positive major is normal; use change_level() for the direction and level.
65
+ """
66
+ a = parse_release(from_version, system)
67
+ b = parse_release(to_version, system)
68
+ if a is None or b is None:
69
+ return None
70
+ return {level: b[i] - a[i] for i, level in enumerate(LEVELS)}
71
+
72
+
73
+ def level_between(a, b):
74
+ """change_level() over tuples parse_release() returned (first three components)."""
75
+ a3, b3 = a[:3], b[:3]
76
+ if b3 < a3:
77
+ return "downgrade"
78
+ for i, level in enumerate(LEVELS):
79
+ if a3[i] != b3[i]:
80
+ return level
81
+ return "none"
82
+
83
+
84
+ def change_level(from_version, to_version, system=None):
85
+ """"major", "minor", "patch", "none", "downgrade", or None if unparseable.
86
+
87
+ The first of major / minor / patch that differs. A fourth component (NuGet
88
+ `1.2.3.4`) is not a level of its own; a change only there reads "none".
89
+ """
90
+ a = parse_release(from_version, system)
91
+ b = parse_release(to_version, system)
92
+ if a is None or b is None:
93
+ return None
94
+ return level_between(a, b)
@@ -633,6 +633,21 @@ def refresh_listing(db, run_id, items):
633
633
  return counts
634
634
 
635
635
 
636
+ def items(db, run_id):
637
+ """A run's items, by repo id, each with `in_kospex` (1 when `repos` has it).
638
+
639
+ The per-row form of the join `inventory()` totals. Includes `gone` items:
640
+ callers that only want the current listing filter on status.
641
+ """
642
+ return list(db.query(f"""
643
+ SELECT i.*, (r._repo_id IS NOT NULL) AS in_kospex
644
+ FROM {TBL_ORG_SYNC_ITEMS} i
645
+ LEFT JOIN {TBL_REPOS} r ON r._repo_id = i._repo_id
646
+ WHERE i.run_id = ?
647
+ ORDER BY i._repo_id
648
+ """, [run_id]))
649
+
650
+
636
651
  def inventory(db, run_id):
637
652
  """What a run's listing holds, compared with what kospex already has.
638
653
 
@@ -187,15 +187,20 @@ def _continue_command(run, commands):
187
187
  return OrgSyncCommand.command(flag, parsed["org"], OrgSyncCommand.continuing(opts))
188
188
 
189
189
 
190
+ def _available(db):
191
+ """False on a DB from before migration 0013 (kweb never applies it)."""
192
+ tables = (OrgSyncManifest.TBL_ORG_SYNC_RUNS, OrgSyncManifest.TBL_ORG_SYNC_ITEMS,
193
+ OrgSyncManifest.TBL_ORG_SYNC_LISTINGS, OrgSyncManifest.TBL_ORG_SYNC_COMMANDS)
194
+ return all(db[name].exists() for name in tables)
195
+
196
+
190
197
  def org_runs(db, *, org, server, now):
191
198
  """The Org syncs tab: runs latest first, with their commands and listings.
192
199
 
193
200
  `available` is False on a DB from before migration 0013, which kweb never
194
201
  applies itself: the page says to run `kospex upgrade-db` instead.
195
202
  """
196
- tables = (OrgSyncManifest.TBL_ORG_SYNC_RUNS, OrgSyncManifest.TBL_ORG_SYNC_ITEMS,
197
- OrgSyncManifest.TBL_ORG_SYNC_LISTINGS, OrgSyncManifest.TBL_ORG_SYNC_COMMANDS)
198
- if not all(db[name].exists() for name in tables):
203
+ if not _available(db):
199
204
  return {"available": False, "runs": []}
200
205
  sql = f"SELECT * FROM {OrgSyncManifest.TBL_ORG_SYNC_RUNS}"
201
206
  params = []
@@ -227,3 +232,49 @@ def org_runs(db, *, org, server, now):
227
232
  if row["run_id"] == run_id],
228
233
  "continue_command": _continue_command(run, commands)})
229
234
  return {"available": True, "runs": runs}
235
+
236
+
237
+ # --- one run: /syncs/run/{run_id} --------------------------------------------
238
+ # Design: changes/202611-kweb-sync-run.md
239
+
240
+ # The order statuses appear in the page's filter.
241
+ FILTER_STATUSES = (OrgSyncManifest.FAILED, OrgSyncManifest.SKIPPED,
242
+ OrgSyncManifest.PENDING, OrgSyncManifest.IN_PROGRESS,
243
+ OrgSyncManifest.SYNCED, OrgSyncManifest.GONE)
244
+
245
+
246
+ def run_view(db, run_id):
247
+ """One run: its header, counts, items and drift.
248
+
249
+ Returns `{"available": False}` on a DB from before migration 0013. Raises
250
+ KeyError for an unknown run. Drift and the private count come from
251
+ `inventory()`, as `kgit sync -inventory` reports them, so they count only
252
+ the current listing, not `gone` items.
253
+ """
254
+ if not _available(db):
255
+ return {"available": False}
256
+ run = next(iter(db.query(
257
+ f"SELECT * FROM {OrgSyncManifest.TBL_ORG_SYNC_RUNS} WHERE run_id = ?", [run_id])),
258
+ None)
259
+ if run is None:
260
+ raise KeyError(f"No run {run_id}")
261
+ inventory = OrgSyncManifest.inventory(db, run_id)
262
+ counts = OrgSyncManifest.run_counts(db, run_id)
263
+ rows = OrgSyncManifest.items(db, run_id)
264
+ for row in rows:
265
+ row["gone"] = row["status"] == OrgSyncManifest.GONE
266
+ row["pushed_date"] = (row.get("pushed_at") or "")[:10]
267
+ source = row.get("fork_source")
268
+ row["fork_source_shown"] = (source if source and source != row.get("fork_parent")
269
+ else None)
270
+ parsed = KospexUtils.parse_org_key(run["org_key"])
271
+ return {"available": True, "run": run,
272
+ "owner": parsed["org"] if parsed else run["org_key"],
273
+ "listed_at": OrgSyncManifest.listed_at(db, run_id),
274
+ "counts": counts,
275
+ "filters": [(s, counts[s]) for s in FILTER_STATUSES if counts[s]],
276
+ "rows": rows, # not "items": Jinja would read page.items as dict.items
277
+ "drift": inventory["gone"],
278
+ "private": inventory["private"], "listed": inventory["listed"],
279
+ "continue_command": _continue_command(
280
+ run, OrgSyncManifest.commands(db, run_id))}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kospex
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: kospex - Code, Developer, Knowledge and Opensource Analytics.
5
5
  Author-email: Peter Freiberg <peter@kospex.io>
6
6
  License-Expression: MIT
@@ -32,6 +32,7 @@ src/kweb_security.py
32
32
  src/kospex/__init__.py
33
33
  src/kospex/assessment_types.py
34
34
  src/kospex/authorship.py
35
+ src/kospex/ca_bundles.py
35
36
  src/kospex/git_duckdb.py
36
37
  src/kospex/git_ingest.py
37
38
  src/kospex/github_dependabot.py
@@ -77,6 +78,8 @@ src/kospex/db/migrations/0013_org_sync_listings.py
77
78
  src/kospex/db/migrations/0013_org_sync_listings.sql
78
79
  src/kospex/db/migrations/README.md
79
80
  src/kospex/db/migrations/__init__.py
81
+ src/kospex/dependencies/__init__.py
82
+ src/kospex/dependencies/version_diff.py
80
83
  src/kospex/extractors/__init__.py
81
84
  src/kospex/extractors/constraints.py
82
85
  src/kospex/extractors/errors.py
@@ -154,6 +157,7 @@ src/templates/summary2.html
154
157
  src/templates/supply_chain.html
155
158
  src/templates/supply_chain_search.html
156
159
  src/templates/syncs.html
160
+ src/templates/syncs_run.html
157
161
  src/templates/tags.html
158
162
  src/templates/tech-change.html
159
163
  src/templates/tenure.html
@@ -162,7 +166,9 @@ src/templates/help/index.html
162
166
  tests/test_advisory_history_stub.py
163
167
  tests/test_assess_registry_dispatch.py
164
168
  tests/test_assessment_types.py
169
+ tests/test_behind_fields.py
165
170
  tests/test_build_file_metadata_rows.py
171
+ tests/test_ca_bundle.py
166
172
  tests/test_clone_repo.py
167
173
  tests/test_clone_repo_integration.py
168
174
  tests/test_clone_repo_resolution.py
@@ -170,6 +176,7 @@ tests/test_commit_history_gaps.py
170
176
  tests/test_commit_log_parsing.py
171
177
  tests/test_commits_covering_index.py
172
178
  tests/test_conftest_shell_kospex_db.py
179
+ tests/test_connectivity.py
173
180
  tests/test_constraint_classifier.py
174
181
  tests/test_date_ordering.py
175
182
  tests/test_db_health.py
@@ -325,6 +332,7 @@ tests/test_unknown_id_404.py
325
332
  tests/test_url_cache_ttl.py
326
333
  tests/test_url_parsing_characterisation.py
327
334
  tests/test_version_constraint_columns.py
335
+ tests/test_version_diff.py
328
336
  tests/test_versions_behind_canonical.py
329
337
  tests/test_versions_behind_flavour.py
330
338
  tests/test_versions_behind_no_data.py