Skip to content
Back to search

cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/cockroachdb/cockroach with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/cockroachdb/cockroach'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/cockroachdb--cockroach/badge.svg)](/listings/cockroachdb--cockroach)

HTML

<a href="/listings/cockroachdb--cockroach"><img src="/api/listings/cockroachdb--cockroach/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 112 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center">
  2. <img src='docs/media/cockroach_db.png?raw=true' width='70%'>
  3. </p>
  4. ---
  5. CockroachDB is a cloud-native distributed SQL database designed to build,
  6. scale, and manage modern, data-intensive applications.
  7. - [What is CockroachDB?](#what-is-cockroachdb)
  8. - [Docs](#docs)
  9. - [Starting with Cockroach Cloud](#starting-with-cockroachcloud)
  10. - [Starting with CockroachDB](#starting-with-cockroachdb)
  11. - [Client Drivers](#client-drivers)
  12. - [Deployment](#deployment)
  13. - [Need Help?](#need-help)
  14. - [Contributing](#contributing)
  15. - [Design](#design)
  16. - [Comparison with Other Databases](#comparison-with-other-databases)
  17. - [See Also](#see-also)
  18. ## What is CockroachDB?
  19. CockroachDB is a distributed SQL database built on a transactional and
  20. strongly-consistent key-value store. It **scales** horizontally;
  21. **survives** disk, machine, rack, and even datacenter failures with
  22. minimal latency disruption and no manual intervention; supports
  23. **strongly-consistent** ACID transactions; and provides a familiar
  24. **SQL** API for structuring, manipulating, and querying data.
  25. For more details, see our [product overview](https://www.cockroachlabs.com/product/overview/), [FAQ](https://cockroachlabs.com/docs/stable/frequently-asked-questions.html) or [architecture document](
  26. https://www.cockroachlabs.com/docs/stable/architecture/overview.html).
  27. ## Docs
  28. For guidance on installation, development, deployment, and administration, see our [User Documentation](https://cockroachlabs.com/docs/stable/).
  29. ## Starting with CockroachCloud
  30. We can run CockroachDB for you, so you don't have to run your own cluster.
  31. See our online documentation: [Quickstart with CockroachCloud](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart.html)
  32. ## Starting with CockroachDB
  33. 1. Install CockroachDB: [using a pre-built executable](https://www.cockroachlabs.com/docs/stable/install-cockroachdb.html) or [build it from source](https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/181338446/Getting+and+building+CockroachDB+from+source).
  34. 2. [Start a local cluster](https://www.cockroachlabs.com/docs/stable/start-a-local-cluster.html) and connect to it via the [built-in SQL client](https://www.cockroachlabs.com/docs/stable/use-the-built-in-sql-client.html).
  35. 3. [Learn more about CockroachDB SQL](https://www.cockroachlabs.com/docs/stable/learn-cockroachdb-sql.html).
  36. 4. Use a PostgreSQL-compatible driver or ORM to [build an app with CockroachDB](https://www.cockroachlabs.com/docs/stable/hello-world-example-apps.html).
  37. 5. [Explore core features](https://www.cockroachlabs.com/docs/stable/demo-data-replication.html), such as data replication, automatic rebalancing, and fault tolerance and recovery.
  38. ## Client Drivers
  39. CockroachDB supports the PostgreSQL wire protocol, so you can use any available PostgreSQL client drivers to connect from various languages.
  40. - For recommended drivers that we've tested, see [Install Client Drivers](https://www.cockroachlabs.com/docs/stable/install-client-drivers.html).
  41. - For tutorials using these drivers, as well as supported ORMs, see [Example Apps](https://www.cockroachlabs.com/docs/stable/example-apps.html).
  42. ## Deployment
  43. - [CockroachCloud](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart) - Steps to create a [free CockroachCloud cluster](https://cockroachlabs.cloud/signup?referralId=githubquickstart) on your preferred Cloud platform.
  44. - [Manual](https://www.cockroachlabs.com/docs/stable/manual-deployment.html) - Steps to deploy a CockroachDB cluster manually on multiple machines.
  45. - [Cloud](https://www.cockroachlabs.com/docs/stable/cloud-deployment.html) - Guides for deploying CockroachDB on various cloud platforms.
  46. - [Orchestration](https://www.cockroachlabs.com/docs/stable/orchestration.html) - Guides for running CockroachDB with popular open-source orchestration systems.
  47. ## Need Help?
  48. - [CockroachDB Community Slack](https://go.crdb.dev/p/slack) - Join our slack to connect with our engineers and other users running CockroachDB.
  49. - [CockroachDB Forum](https://forum.cockroachlabs.com/) and [Stack Overflow](https://stackoverflow.com/questions/tagged/cockroachdb) - Ask questions, find answers, and help other users.
  50. - [Troubleshooting documentation](https://www.cockroachlabs.com/docs/stable/troubleshooting-overview.html) - Learn how to troubleshoot common errors, cluster setup, and SQL query behavior.
  51. - For filing bugs, suggesting improvements, or requesting new features, help us out by [opening an issue](https://github.com/cockroachdb/cockroach/issues/new).
  52. ## Building from source
  53. See [our wiki](https://wiki.crdb.io/wiki/spaces/CRDB/pages/181338446/Getting+and+building+from+source) for more details.
  54. ## Contributing
  55. We welcome your contributions! If you're looking for issues to work on, try looking at the [good first issue list](https://github.com/cockroachdb/cockroach/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). We do our best to tag issues suitable for new external contributors with that label, so it's a great way to find something you can help with!
  56. See [our wiki](https://wiki.crdb.io/wiki/spaces/CRDB/pages/73204033/Contributing+to+CockroachDB) for more details.
  57. Engineering discussions take place on our public mailing list, [cockroach-db@googlegroups.com](https://groups.google.com/forum/#!forum/cockroach-db). Also please join our [Community Slack](https://go.crdb.dev/p/slack) (there's a dedicated #contributors channel!) to ask questions, discuss your ideas, and connect with other contributors.
  58. ## Design
  59. For an in-depth discussion of the CockroachDB architecture, see our
  60. [Architecture
  61. Guide](https://www.cockroachlabs.com/docs/stable/architecture/overview.html).
  62. For the original design motivation, see our [design
  63. doc](https://github.com/cockroachdb/cockroach/blob/master/docs/design.md).
  64. ## Licensing
  65. All versions released on or after November 18, 2024 (specifically, major version series v24.3 and later, and patch fixes for v23.1.29+, v23.2.16+, v24.1.7+, and v24.2.5+) are published under the [CockroachDB Software License (CSL)](./LICENSE). Source code in a given file is licensed under the CSL and the copyright belongs to The Cockroach Authors unless otherwise noted in the file or in a LICENSE or README file located in the same or a parent directory of the file.
  66. ## Comparison with Other Databases
  67. To see how key features of CockroachDB stack up against other databases,
  68. check out [CockroachDB in Comparison](https://www.cockroachlabs.com/docs/stable/cockroachdb-in-comparison.html).
  69. ## See Also
  70. - [Tech Talks](https://www.cockroachlabs.com/community/tech-talks/) (by CockroachDB founders, engineers, and customers!)
  71. - [CockroachDB User Documentation](https://cockroachlabs.com/docs/stable/)
  72. - [The CockroachDB Blog](https://www.cockroachlabs.com/blog/)
  73. - Key design documents
  74. - [Serializable, Lockless, Distributed: Isolation in CockroachDB](https://www.cockroachlabs.com/blog/serializable-lockless-distributed-isolation-cockroachdb/)
  75. - [Consensus, Made Thrive](https://www.cockroachlabs.com/blog/consensus-made-thrive/)
  76. - [Trust, But Verify: How CockroachDB Checks Replication](https://www.cockroachlabs.com/blog/trust-but-verify-cockroachdb-checks-replication/)
  77. - [Living Without Atomic Clocks](https://www.cockroachlabs.com/blog/living-without-atomic-clocks/)
  78. - [The CockroachDB Architecture Document](https://github.com/cockroachdb/cockroach/blob/master/docs/design.md)
.claude/skills/engflow-artifacts/engflow_artifacts_test.py · Bundled script · 216 lines · 1 finding marked
  1. #!/usr/bin/env python3
  2. # Copyright 2026 The Cockroach Authors.
  3. #
  4. # Use of this software is governed by the CockroachDB Software License
  5. # included in the /LICENSE file.
  6. """Tests for engflow_artifacts.py using checked-in protobuf response payloads.
  7. Run: python3 -m pytest engflow_artifacts_test.py -v
  8. or: python3 engflow_artifacts_test.py
  9. """
  10. import json
  11. import os
  12. import sys
  13. import unittest
  14. sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
  15. from engflow_artifacts import (
  16. parse_labels_response,
  17. parse_target_response,
  18. parse_invocation_url,
  19. _parse_bytestream_uri,
  20. )
  21. TESTDATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testdata")
  22. def _load_fixture(name):
  23. with open(os.path.join(TESTDATA, name), "rb") as f:
  24. return f.read()
  25. def _load_golden(name):
  26. with open(os.path.join(TESTDATA, name)) as f:
  27. return json.load(f)
  28. class TestParseLabelsResponse(unittest.TestCase):
  29. """Tests for GetTargetLabelsByStatus response parsing."""
  30. def test_golden(self):
  31. """Parse labels_response.bin and compare to golden output."""
  32. data = _load_fixture("labels_response.bin")
  33. labels = parse_labels_response(data)
  34. expected = _load_golden("labels_response.golden.json")
  35. self.assertEqual(labels, expected)
  36. def test_labels_are_sorted_target_strings(self):
  37. data = _load_fixture("labels_response.bin")
  38. labels = parse_labels_response(data)
  39. for label in labels:
  40. self.assertTrue(
  41. label.startswith("//"),
  42. f"Expected Bazel target label, got: {label}",
  43. )
  44. def test_empty_response(self):
  45. labels = parse_labels_response(b"")
  46. self.assertEqual(labels, [])
  47. class TestParseTargetResponse(unittest.TestCase):
  48. """Tests for GetTarget response parsing."""
  49. def test_oidcccl_golden(self):
  50. """Parse target_oidcccl.bin (1 shard, 3 runs) against golden."""
  51. data = _load_fixture("target_oidcccl.bin")
  52. actions, (total_shards, total_entries) = parse_target_response(data)
  53. golden = _load_golden("target_oidcccl.golden.json")
  54. self.assertEqual(total_shards, golden["total_shards"])
  55. self.assertEqual(total_entries, golden["total_entries"])
  56. got = {
  57. f"{s},{r}": {k: list(v) for k, v in artifacts.items()}
  58. for (s, r), artifacts in sorted(actions.items())
  59. }
  60. self.assertEqual(got, golden["actions"])
  61. def test_kvserver_golden(self):
  62. """Parse target_kvserver.bin (48 shards, 3 runs) against golden."""
  63. data = _load_fixture("target_kvserver.bin")
  64. actions, (total_shards, total_entries) = parse_target_response(data)
  65. golden = _load_golden("target_kvserver.golden.json")
  66. self.assertEqual(total_shards, golden["total_shards"])
  67. self.assertEqual(total_entries, golden["total_entries"])
  68. got = {
  69. f"{s},{r}": {k: list(v) for k, v in artifacts.items()}
  70. for (s, r), artifacts in sorted(actions.items())
  71. }
  72. self.assertEqual(got, golden["actions"])
  73. def test_kvserver_shard_count(self):
  74. """kvserver_test should have 48 unique shards, 3 runs each."""
  75. data = _load_fixture("target_kvserver.bin")
  76. actions, (total_shards, total_entries) = parse_target_response(data)
  77. shard_nums = sorted({s for s, r in actions})
  78. run_nums = sorted({r for s, r in actions})
  79. self.assertEqual(len(shard_nums), 48)
  80. self.assertEqual(shard_nums, list(range(1, 49)))
  81. self.assertEqual(run_nums, [1, 2, 3])
  82. self.assertEqual(len(actions), 144) # 48 * 3
  83. def test_kvserver_shard_20_has_outputs(self):
  84. """Shard 20 run 1 is the failing shard and should have outputs.zip."""
  85. data = _load_fixture("target_kvserver.bin")
  86. actions, _ = parse_target_response(data)
  87. shard_20 = actions[(20, 1)]
  88. self.assertIn("test.log", shard_20)
  89. self.assertIn("test.xml", shard_20)
  90. self.assertIn("outputs.zip", shard_20)
  91. self.assertIn("manifest", shard_20)
  92. # The test.xml for the failing shard should be notably larger
  93. # than a passing shard's test.xml (contains stack traces).
  94. failing_xml_size = shard_20["test.xml"][1]
  95. passing_xml_size = actions[(1, 1)]["test.xml"][1]
  96. self.assertGreater(failing_xml_size, passing_xml_size * 5)
  97. def test_kvserver_passing_shard_no_outputs(self):
  98. """A passing shard (e.g. shard 1 run 1) should NOT have outputs.zip."""
  99. data = _load_fixture("target_kvserver.bin")
  100. actions, _ = parse_target_response(data)
  101. shard_1 = actions[(1, 1)]
  102. self.assertIn("test.log", shard_1)
  103. self.assertIn("test.xml", shard_1)
  104. self.assertNotIn("outputs.zip", shard_1)
  105. self.assertNotIn("manifest", shard_1)
  106. def test_oidcccl_single_shard_three_runs(self):
  107. """oidcccl_test has 1 shard and 3 runs."""
  108. data = _load_fixture("target_oidcccl.bin")
  109. actions, _ = parse_target_response(data)
  110. shard_nums = {s for s, r in actions}
  111. run_nums = {r for s, r in actions}
  112. self.assertEqual(shard_nums, {1})
  113. self.assertEqual(run_nums, {1, 2, 3})
  114. def test_artifact_hashes_are_valid_sha256(self):
  115. """All artifact hashes should be 64-char hex strings."""
  116. data = _load_fixture("target_oidcccl.bin")
  117. actions, _ = parse_target_response(data)
  118. for (shard, run), artifacts in actions.items():
  119. for name, (blob_hash, size) in artifacts.items():
  120. self.assertEqual(
  121. len(blob_hash), 64,
  122. f"shard {shard} run {run} {name}: "
  123. f"hash length {len(blob_hash)} != 64",
  124. )
  125. int(blob_hash, 16) # Should not raise.
  126. self.assertGreater(size, 0)
  127. class TestParseInvocationUrl(unittest.TestCase):
  128. """Tests for EngFlow invocation URL parsing."""
  129. def test_full_url(self):
  130. url = (
  131. "https://mesolite.cluster.engflow.com/invocations/default/"
  132. "0f3c3923-460d-4399-8718-df764fdcf793"
  133. "?testReportRun=1&testReportShard=20&testReportAttempt=1"
  134. "#targets-Ly9wa2cva3Yva3ZzZXJ2ZXI6a3ZzZXJ2ZXJfdGVzdA=="
    • Dismissed after review: Contains a long base64-looking blob — not necessarily malicious, but worth inspecting what it decodes to
    • Line 171 on GitHub
  135. )
  136. inv_id, target, shard, run, attempt = parse_invocation_url(url)
  137. self.assertEqual(inv_id, "0f3c3923-460d-4399-8718-df764fdcf793")
  138. self.assertEqual(target, "//pkg/kv/kvserver:kvserver_test")
  139. self.assertEqual(shard, 20)
  140. self.assertEqual(run, 1)
  141. self.assertEqual(attempt, 1)
  142. def test_url_without_params(self):
  143. url = (
  144. "https://mesolite.cluster.engflow.com/invocations/default/"
  145. "abc12345-1234-5678-9abc-def012345678"
  146. )
  147. inv_id, target, shard, run, attempt = parse_invocation_url(url)
  148. self.assertEqual(inv_id, "abc12345-1234-5678-9abc-def012345678")
  149. self.assertIsNone(target)
  150. self.assertIsNone(shard)
  151. self.assertIsNone(run)
  152. self.assertIsNone(attempt)
  153. class TestParseBytestreamUri(unittest.TestCase):
  154. """Tests for bytestream:// URI parsing."""
  155. def test_valid_uri(self):
  156. uri = (
  157. "bytestream://mesolite.cluster.engflow.com/blobs/"
  158. "ef3bac04483976e0dc5b77760c14f3d4cf482159d0cc5d6bd58240bc67fe825f"
  159. "/15787"
  160. )
  161. blob_hash, size = _parse_bytestream_uri(uri)
  162. self.assertEqual(
  163. blob_hash,
  164. "ef3bac04483976e0dc5b77760c14f3d4cf482159d0cc5d6bd58240bc67fe825f",
  165. )
  166. self.assertEqual(size, 15787)
  167. def test_invalid_uri(self):
  168. blob_hash, size = _parse_bytestream_uri("not-a-uri")
  169. self.assertIsNone(blob_hash)
  170. self.assertEqual(size, 0)
  171. if __name__ == "__main__":
  172. unittest.main()

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.