{"id":13450937,"url":"https://github.com/salesforce/bazel-mystery","last_synced_at":"2026-03-06T23:32:25.150Z","repository":{"id":66001644,"uuid":"510785784","full_name":"salesforce/bazel-mystery","owner":"salesforce","description":"An interactive way to learn bazel.","archived":false,"fork":false,"pushed_at":"2024-01-13T20:31:28.000Z","size":21,"stargazers_count":66,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-22T23:04:32.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salesforce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-05T15:06:30.000Z","updated_at":"2025-05-19T13:34:50.000Z","dependencies_parsed_at":"2023-09-24T16:41:24.307Z","dependency_job_id":"f53d2388-d370-4422-b1ad-2d150accc47d","html_url":"https://github.com/salesforce/bazel-mystery","commit_stats":{"total_commits":6,"total_committers":3,"mean_commits":2.0,"dds":"0.33333333333333337","last_synced_commit":"322423d3bdb30b7b54454f59c30380a726a3ab34"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/salesforce/bazel-mystery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fbazel-mystery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fbazel-mystery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fbazel-mystery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fbazel-mystery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salesforce","download_url":"https://codeload.github.com/salesforce/bazel-mystery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fbazel-mystery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30203347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:00:40.560Z","updated_at":"2026-03-06T23:32:25.132Z","avatar_url":"https://github.com/salesforce.png","language":"Starlark","funding_links":[],"categories":["Starlark","Resources"],"sub_categories":["Tutorials"],"readme":"# Bazel Mystery\n\nCan you solve the mystery of the missing Basil? 🌱\n\nThis project aims to help with learning how to use the [Bazel](https://bazel.build/) build tool.\n\n## Prerequisites\n\n- [Bazelisk](https://github.com/bazelbuild/bazelisk) installed. Bazelisk will dynamically use the required version of bazel defined in the `.bazelversion` file.\n\n## The Case of the Missing Basil 🌱\n\n### Overview\n\nJohn is a basil farmer. Some of his basil mysteriously went missing. Relevant authorities were informed and a crime scene report was written.\n\n### Rules\n\n- Try not to look into the `BUILD` files at all.\n- Try to solve the case by only using bazel queries and this `README` file.\n\n### Crime Scene Report\n\nThe crime scene report for this case is kept in a secret location. You can uncover it once. However, after that first time of seeing it, you'll need to use some workarounds to see it again. *This is because bazel is very good at caching artifacts that have already been built, so they only need to be built once (until they change or the cache is invalidated)*.\n\nTo see the crime scene report for this case, build the following target:\n\n```bash\nbazel build crime_scene_reports:missing_basil_089324\n```\n\nIf you need to see it again, look at the `README.md` file in [crime_scene_reports](/crime_scene_reports/README.md) for details of how to do that.\n\n## Packages\n\nEach package in this repository (e.g. [crime_scene_reports](/crime_scene_reports) and [people](people)) contains a `README.md` file which explains how to interract with the targets contained in the package.\n\nHaving an entity relationship diagram for bazel packages seems strange, but for this case it helps to describe the environment and the relationships between targets:\n\n![entity_relationship_diagram](https://user-images.githubusercontent.com/17026751/191979711-0d01e94f-fdaf-4fc7-bc61-05e042688d03.png)\n\n\n## Hints\n\nDiscovering the dependencies and reverse dependencies of targets is an important part of solving the case. For example:\n\n### Dependencies\n\n```bash\nbazel query 'deps(//people:john)' --noimplicit_deps\n# Returns all of the things that John depends on.\n# e.g. his car.\n\n//cars:74383\n```\n\n### Reverse Dependencies\n\n```bash\nbazel query 'rdeps(//..., //people:amy)'\n# Returns all of the things that depend on Amy.\n# e.g. an interview.\n\n//interviews:454235\n```\n\n### Tags\n\nBazel targets can be tagged with different identifiers. This can be useful if you only want some targets to run in certain environments (e.g. only run a set of tests locally). You can query for the targets that have specific tags:\n\n```bash\nbazel query 'attr(tags, \"blue\", cars/...)'\n# Returns all of the targets in the car package that have a tag of \"blue\"\n\n//cars:74383\n```\n\n## Checking Your Answer\n\nYou can test your answer in the following way:\n\n```bash\nbazel test solution --test_env guess=John\n# Use test_env guess=your_guess to make a guess.\n# If the test passes, your guess is correct.\n\n//solution:solution  FAILED in 0.1s\n```\n\nIn the above case, we're checking whether John took the missing basil. He didn't, he has plenty of basil already.\n\n## Full Solution Walkthrough\n\nIf you'd like a walkthrough of how to solve the case, see [solution_walkthrough.md](/solution_walkthrough.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforce%2Fbazel-mystery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalesforce%2Fbazel-mystery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforce%2Fbazel-mystery/lists"}