The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Create mutation testing skill (#68978)
Eric Normand62402df8b68d
diff --git a/.claude/commands/mutation-testing.md b/.claude/commands/mutation-testing.mdnew file mode 100644index 00000000000..9943ca7a479--- /dev/null+++ b/.claude/commands/mutation-testing.md@@ -0,0 +1 @@+Run mutation testing for $ARGUMENTSdiff --git a/.claude/skills/mutation-testing/SKILL.md b/.claude/skills/mutation-testing/SKILL.mdnew file mode 100644index 00000000000..0661ff3c4bd--- /dev/null+++ b/.claude/skills/mutation-testing/SKILL.md@@ -0,0 +1,231 @@+---+name: mutation-testing+description: Run mutation testing on a Clojure namespace, generate tests to kill surviving mutations, and open draft PRs with Linear issue tracking.+---++# Mutation Testing Skill++This skill runs mutation testing on a target namespace, writes tests to kill surviving mutations, and creates draft PRs with Linear issues for each function.++## Prerequisites++- A running nREPL connected to the Metabase dev environment+- `LINEAR_API_KEY` environment variable set with a valid Linear personal API key+- `gh` CLI authenticated with GitHub++## Reference Files++- `dev/src/dev/coverage.clj` — mutation testing tool (generates reports, runs mutations)+- `dev/src/dev/mutation_testing.clj` — Linear API client and PR template helpers+- `mutation-testing-report.lib.card.md` — example report from the pilot++## Invocation++The argument is a Clojure namespace, e.g.:++```+/mutation-testing metabase.lib.order-by+```++## Workflow++### Step 1: Parse the namespace++From the argument (e.g., `metabase.lib.order-by`), derive:+- **Test namespace**: append `-test` (e.g., `metabase.lib.order-by-test`)+- **Short name**: the last segment (e.g., `order-by`)+- **Source path**: `src/metabase/lib/order_by.cljc` (replace `-` with `_` in path segments)+- **Test path**: `test/metabase/lib/order_by_test.cljc`++### Step 2: Set up Linear and load tools++```clojure+(require '[dev.coverage :as cov] :reload)+(require '[dev.mutation-testing :as mut-test] :reload)+```++If this is the first invocation (or the REPL was restarted), set up the Linear team:++```clojure+;; Find the team+(mut-test/list-teams!)+;; Set team ID from the output+(mut-test/set-config! {:team-id "<team-id>"})+```++If config is already set from a previous invocation, skip this.++### Step 3: Generate baseline report and create Linear project++```clojure+(cov/generate-report+ '<target-ns>+ ['<test-ns>]+ "mutation-testing-report.lib.<short-name>.before.md")+```++Read the generated report file. It has three sections:+- **Uncovered Functions** — never called by any test+- **Partially Covered Functions** — called but with surviving mutations+- **Fully Covered Functions** — all mutations killed++Then create a Linear project for this namespace (uses report stats in the description):++```clojure+(mut-test/create-project-for-namespace!+ "<target-ns>"+ "mutation-testing-report.lib.<short-name>.before.md")+;; => {:project-id "...", :name "Mutation Testing: metabase.lib.order-by"}+;; Automatically sets :project-id in config for subsequent create-issue! calls+```++### Step 4: Plan the work++Before creating branches, analyze the report to plan how to group the work:++1. **Identify killable functions.** For each function with surviving mutations, assess whether any mutations are killable. Run `cov/test-mutations` to see the full mutation list. If ALL mutations for a function are unkillable (schema-only, semantically equivalent, etc.), skip that function — no branch or PR needed.++2. **Group private functions by public entry point.** Private functions cannot be tested directly. Group them with the public function that exercises them. Create one branch/PR per group, not per private function.++3. **Track mutations per group.** The `:mutations-before` and `:not-killed` fields in the PR should only reflect mutations for functions covered by that specific PR — never mutations from other functions.++### Step 5: Process each group++For each group of functions that has killable mutations:++#### 5a. Create a branch++```clojure+(mut-test/create-branch! "<target-ns>" "<primary-fn-name>")+;; => "mutation-testing-lib-order-by-orderable-columns"+```++Use the primary public function name for the branch. If the group covers private functions too, name the branch after the public entry point.++#### 5b. Read context++- Read the source function(s) from the source file+- Read the full test file to understand existing test patterns, helpers, and metadata providers used+- If the function is private, identify which public function(s) call it++#### 5c. Write tests++Generate the **simplest tests** that kill the surviving mutations while still making semantic sense. Guidelines:++- **Never call private functions directly.** Always test through public API functions. Use the coverage data to identify which public functions exercise the private function.+- **Keep tests simple.** Each test should verify one meaningful behavior. Don't over-engineer tests just to chase mutation kills.+- **Follow existing patterns.** Match the style of the existing tests: same metadata providers, same helper functions, same assertion patterns.+- **Insert tests near related existing tests** for the same function, not at the end of the file. This minimizes merge conflicts between branches. If there are no existing tests for the function, find the most logical location based on the order of functions in the source file.++**IMPORTANT: Use `file_edit` (not `clojure_edit`) when editing test files.** The `clojure_edit` tool reformats the entire file, introducing unnecessary whitespace changes that pollute the diff. Use `file_edit` with exact string matching to make surgical insertions that only touch the lines you intend to change.++#### 5d. Verify mutations are killed++Use the REPL to check that the new tests kill the targeted mutations:++```clojure+;; Reload the test namespace to pick up new tests+(require '<test-ns> :reload)++;; Test mutations for the specific function+(cov/test-mutations+ '<target-ns>/<fn-name>+ ;; Set of test names that cover this function+ #{'<test-ns>/<test-name-1> '<test-ns>/<test-name-2>})+```++Check the `:survived` key in the result. If mutations still survive:+- Try writing additional tests+- If a mutation is truly unkillable (semantically equivalent), note it for the PR description+- If a mutation reveals dead/unreachable code, consider suggesting removal as a code improvement++#### 5e. Handle unkillable mutations and improvements++**Do NOT edit the source namespace just for documentation.** Instead:++- **Unkillable mutations**: Note them in the PR description with rationale+- **Code improvements** (dead code removal, expression simplification) that directly relate to surviving mutants:+ 1. Make the change in the source file+ 2. Verify all tests still pass with the change+ 3. Note the file path, line range, and the improved code+ 4. **Reset the change**: `git checkout -- <source-file>` — do NOT commit it+ 5. After creating the PR, use `add-suggested-change!` to post the improvement as a GitHub suggested change (Step 5h)+ 6. The reviewer decides whether to accept it++#### 5f. Commit and push++```clojure+;; Only commit the test file — never commit source changes for improvements+(mut-test/commit-and-push! "<target-ns>" "<primary-fn-name>"+ ["test/metabase/lib/<short_name>_test.cljc"])+```++#### 5g. Create Linear issue and draft PR++```clojure+;; Create a Linear issue (use the primary function name)+(def issue (mut-test/create-issue-for-function! "<target-ns>" "<primary-fn-name>"))+;; => {:identifier "QUE-1234", :url "https://linear.app/...", ...}++;; Create draft PR linked to the Linear issue+;; :fn-names lists ALL functions covered by this PR+;; :mutations-before counts only mutations for functions in this PR+;; :not-killed lists only unkillable mutations for functions in this PR+(def pr-url+ (mut-test/create-draft-pr!+ {:target-ns "<target-ns>"+ :fn-name "<primary-fn-name>"+ :linear-identifier (:identifier issue)+ :mutations-before 9 ;; surviving mutations for these functions only+ :tests-added 2 ;; number of new test functions+ :killed ["Replace :segment-id with :segment-id__"+ "Replace cycle-path with nil"]+ :not-killed [{:description "Replace acc with nil"+ :rationale "reduce always has single iteration"}]+ :suggested-changes []}))+;; => "https://github.com/metabase/metabase/pull/12345"+```++#### 5h. Add code improvement suggestions (if any)++If you identified code improvements in step 5e (and reset them), post each as a GitHub suggested change:++```clojure+(mut-test/add-suggested-change!+ {:pr-url pr-url+ :path "src/metabase/lib/<short_name>.cljc"+ :start-line 42 ;; first line of the code to replace+ :end-line 45 ;; last line of the code to replace+ :suggestion "(improved-code-here)" ;; the replacement code+ :comment "**Suggested improvement:** <description of the change and why it's related to the surviving mutant>"})+```++### Step 6: Return to master and repeat++```clojure+(mut-test/return-to-master!)+```++Repeat Step 5 for the next group.++### Step 7: Summary++Print a summary of what was done:+- Link to the Linear project for this namespace+- Number of functions processed+- Number of functions skipped (all mutations unkillable)+- Number of draft PRs created+- Number of mutations killed vs. unkillable+- List of test PRs with links+- List of mutation rule PRs with links (if any were created)++## Suggesting New Mutation Rules++If you notice patterns in surviving mutations that suggest the mutation testing tool should have additional rules (e.g., a common Clojure form that isn't being mutated), open a separate PR proposing additions to `dev.coverage/mutation-rules` with an explanation.++## Configuration++The `dev.mutation-testing` namespace reads `LINEAR_API_KEY` from the environment and stores team/project IDs in an atom.++- **Team ID**: Set once per REPL session via `(mut-test/list-teams!)` and `(mut-test/set-config! {:team-id "..."})` (Step 2)+- **Project ID**: Set automatically when `create-project-for-namespace!` is called (Step 3) — one project per namespacediff --git a/dev/src/dev/mutation_testing.clj b/dev/src/dev/mutation_testing.cljnew file mode 100644index 00000000000..6a8ba303c39--- /dev/null+++ b/dev/src/dev/mutation_testing.clj@@ -0,0 +1,432 @@+(ns dev.mutation-testing+ "Linear API client and PR template helpers for mutation testing automation.++ Provides functions to create Linear projects and issues, and to generate+ templated PR titles and descriptions for mutation testing PRs.++ Configuration:+ - LINEAR_API_KEY env var must be set+ - Call (set-config! {:team-id \"...\" :project-id \"...\"}) before creating issues"+ (:require+ [cheshire.core :as json]+ [clj-http.client :as http]+ [clojure.java.shell :as shell]+ [clojure.string :as str]))++(set! *warn-on-reflection* true)++;;; --- Configuration ---++(defonce ^:private config (atom {}))++(defn set-config!+ "Set configuration for Linear API calls.++ Required keys:+ - :team-id — Linear team ID+ - :project-id — Linear project ID (can be set after creating a project)"+ [m]+ (swap! config merge m))++(defn- api-key []+ (or (System/getenv "LINEAR_API_KEY")+ (throw (ex-info "LINEAR_API_KEY environment variable is not set" {}))))++(defn- team-id []+ (or (:team-id @config)+ (throw (ex-info "team-id not set. Call (set-config! {:team-id \"...\"})" {}))))++(defn- project-id []+ (or (:project-id @config)+ (throw (ex-info "project-id not set. Call (set-config! {:project-id \"...\"})" {}))))++;;; --- Linear GraphQL API ---++(defn- graphql-request+ "Execute a GraphQL request against the Linear API.+ Returns the parsed response body."+ [query variables]+ (let [response (http/post "https://api.linear.app/graphql"+ {:headers {"Authorization" (api-key)+ "Content-Type" "application/json"}+ :body (json/generate-string {:query query+ :variables variables})+ :as :json+ :throw-exceptions false})]+ (when-let [errors (get-in response [:body :errors])]+ (throw (ex-info "Linear API error" {:errors errors})))+ (:body response)))++(defn list-teams!+ "List all Linear teams accessible to the authenticated user.+ Returns a seq of {:id ... :name ... :key ...} maps."+ []+ (let [query "query { teams { nodes { id name key } } }"+ result (graphql-request query {})]+ (get-in result [:data :teams :nodes])))++(defn create-project!+ "Create a new Linear project.++ Options:+ - :name — project name (required)+ - :description — short project description, ≤255 chars (optional)+ - :content — long-form project content as markdown (optional)+ - :status-id — project status ID (optional)++ Returns a map with :project-id.+ Also updates config with the new project-id."+ [{:keys [name description content status-id]}]+ (let [query "mutation($input: ProjectCreateInput!) {+ projectCreate(input: $input) {+ success+ project { id name }+ }+ }"+ variables {:input (cond-> {:name name+ :teamIds [(team-id)]}+ description (assoc :description description)+ content (assoc :content content)+ status-id (assoc :statusId status-id))}+ result (graphql-request query variables)+ project (get-in result [:data :projectCreate :project])]+ (set-config! {:project-id (:id project)})+ {:project-id (:id project)+ :name (:name project)}))++(defn create-issue!+ "Create a new Linear issue in the configured team and project.++ Options:+ - :title — issue title (required)+ - :description — issue description (optional)++ Returns a map with :issue-id and :identifier (e.g., \"QUE-1234\")."+ [{:keys [title description]}]+ (let [query "mutation($input: IssueCreateInput!) {+ issueCreate(input: $input) {+ success+ issue { id identifier title url }+ }+ }"+ variables {:input (cond-> {:title title+ :teamId (team-id)+ :projectId (project-id)}+ description (assoc :description description))}+ result (graphql-request query variables)+ issue (get-in result [:data :issueCreate :issue])]+ {:issue-id (:id issue)+ :identifier (:identifier issue)+ :title (:title issue)+ :url (:url issue)}))++;;; --- Template helpers ---++(defn pr-title+ "Generate a PR title for a mutation testing PR.++ Example: [Mutation Testing] Kill mutations in metabase.lib.order-by/orderable-columns"+ [target-ns fn-name]+ (str "[Mutation Testing] Kill mutations in " target-ns "/" fn-name))++(defn pr-description+ "Generate a PR description for a mutation testing PR.++ Options:+ - :target-ns — the namespace under test+ - :fn-names — seq of function name strings covered by this PR+ - :linear-identifier — Linear issue identifier (e.g., \"QUE-1234\")+ - :mutations-before — number of surviving mutations before this PR (for these functions only)+ - :tests-added — number of new tests being added+ - :killed — seq of mutation description strings+ - :not-killed — seq of {:description ... :rationale ...} maps (can be empty)+ - :suggested-changes — seq of short description strings for code improvements posted as suggested changes"+ [{:keys [target-ns fn-names linear-identifier mutations-before tests-added killed not-killed suggested-changes]}]+ (let [killed-count (count killed)+ remaining (- mutations-before killed-count)]+ (str "Part of the mutation testing project for `" target-ns "`.\n"+ "\n"+ "Closes " linear-identifier "\n"+ "\n"+ "### Functions\n"+ (str/join "\n" (map #(str "- `" target-ns "/" % "`") fn-names))+ "\n"+ "\n"+ "### Stats\n"+ "- **Surviving mutations before:** " mutations-before "\n"+ "- **Tests added:** " tests-added "\n"+ "- **Mutations killed by this PR:** " killed-count "\n"+ "- **Mutations remaining:** " remaining "\n"+ "\n"+ "### Mutations killed\n"+ (if (seq killed)+ (str/join "\n" (map #(str "- " %) killed))+ "- None")+ "\n"+ "\n"+ "### Mutations not killed (with rationale)\n"+ (if (seq not-killed)+ (str/join "\n" (map #(str "- " (:description %) " — " (:rationale %)) not-killed))+ "- None (all mutations killed)")+ "\n"+ (when (seq suggested-changes)+ (str "\n"+ "### Suggested code changes\n"+ "The following improvements are posted as suggested changes on this PR. Please review:\n"+ (str/join "\n" (map #(str "- " %) suggested-changes))+ "\n")))))++(defn linear-issue-title+ "Generate a Linear issue title for a mutation testing issue.++ Example: Mutation testing: metabase.lib.order-by/orderable-columns"+ [target-ns fn-name]+ (str "Mutation testing: " target-ns "/" fn-name))++(defn linear-issue-description+ "Generate a Linear issue description for a mutation testing issue."+ [target-ns fn-name]+ (str "Write targeted tests to kill surviving mutations in `" target-ns "/" fn-name "`.\n"+ "\n"+ "Mutation testing found code paths in this function that are not adequately "+ "verified by the existing test suite. Surviving mutations indicate places where "+ "the code could be changed (e.g., swapping operators, replacing values) without "+ "any test failing — meaning bugs in those paths would go undetected.\n"+ "\n"+ "This issue tracks writing the simplest tests that kill these mutations while "+ "remaining semantically meaningful. The corresponding draft PR will list which "+ "mutations were killed and provide rationale for any that are unkillable."))++;;; --- Convenience ---++;;; --- GitHub helpers ---++(defn- sh+ "Run a shell command and return {:exit ... :out ... :err ...}.+ Throws on non-zero exit."+ [& args]+ (let [result (apply shell/sh args)]+ (when-not (zero? (:exit result))+ (throw (ex-info (str "Shell command failed: " (pr-str args) "\n" (:err result))+ result)))+ result))++(defn branch-name+ "Generate a branch name for mutation testing a function.+ Example: mutation-testing-lib-order-by-orderable-columns"+ [target-ns fn-name]+ (let [short-ns (last (clojure.string/split (str target-ns) #"\."))]+ (str "mutation-testing-lib-" short-ns "-" fn-name)))++(defn create-branch!+ "Create and checkout a new branch from master for mutation testing a function."+ [target-ns fn-name]+ (let [branch (branch-name target-ns fn-name)]+ (sh "git" "checkout" "master")+ (sh "git" "pull")+ (sh "git" "checkout" "-b" branch)+ branch))++(defn commit-and-push!+ "Stage changed files, commit with a message, and push the current branch.+ `files` is a seq of file paths to stage."+ [target-ns fn-name files]+ (doseq [f files]+ (sh "git" "add" f))+ (sh "git" "commit" "-m" (str "[Mutation Testing] Add tests for " target-ns "/" fn-name))+ (let [branch (branch-name target-ns fn-name)]+ (sh "git" "push" "-u" "origin" branch)+ branch))++(defn create-draft-pr!+ "Create a draft PR on GitHub and return the PR URL.++ Options:+ - :target-ns — the namespace under test+ - :fn-name — the function name (used for PR title)+ - :fn-names — seq of function name strings (used in PR body)+ - :linear-identifier — Linear issue identifier (e.g., \"QUE-1234\")+ - :mutations-before — number of surviving mutations before this PR+ - :tests-added — number of new tests being added+ - :killed — seq of mutation description strings+ - :not-killed — seq of {:description ... :rationale ...} maps+ - :suggested-changes — seq of short description strings"+ [{:keys [target-ns fn-name] :as opts}]+ (let [title (pr-title target-ns fn-name)+ body (pr-description opts)+ result (sh "gh" "pr" "create" "--draft"+ "--title" title+ "--body" body+ "--label" "no-backport")]+ (clojure.string/trim (:out result))))++(defn add-pr-comment!+ "Add a general comment to a PR. `pr-url-or-number` can be a PR URL or number."+ [pr-url-or-number comment-body]+ (sh "gh" "pr" "comment" (str pr-url-or-number) "--body" comment-body))++(defn- pr-number-from-url+ "Extract the PR number from a GitHub PR URL."+ [pr-url]+ (last (str/split (str pr-url) #"/")))++(defn- repo-nwo+ "Get the owner/repo for the current git repo."+ []+ (str/trim (:out (sh "gh" "repo" "view" "--json" "nameWithOwner" "-q" ".nameWithOwner"))))++(defn- head-sha+ "Get the head commit SHA for a PR."+ [pr-url-or-number]+ (str/trim (:out (sh "gh" "pr" "view" (str pr-url-or-number) "--json" "headRefOid" "-q" ".headRefOid"))))++(defn add-suggested-change!+ "Add an inline review comment with a suggested change on a PR.+ This uses GitHub's suggestion syntax so the reviewer can apply it with one click.++ Options:+ - :pr-url — the PR URL or number+ - :path — file path relative to repo root+ - :start-line — first line of the range to replace (1-indexed)+ - :end-line — last line of the range to replace (1-indexed, can equal start-line for single line)+ - :suggestion — the replacement code (string, will be placed inside a ```suggestion block)+ - :comment — explanation of the suggested change"+ [{:keys [pr-url path start-line end-line suggestion comment]}]+ (let [pr-num (pr-number-from-url pr-url)+ nwo (repo-nwo)+ sha (head-sha pr-url)+ body (str comment "\n\n```suggestion\n" suggestion "\n```")+ args (cond-> ["gh" "api" "--method" "POST"+ (str "/repos/" nwo "/pulls/" pr-num "/comments")+ "-f" (str "body=" body)+ "-f" (str "commit_id=" sha)+ "-f" (str "path=" path)+ "-F" (str "line=" end-line)+ "-f" "side=RIGHT"]+ (not= start-line end-line)+ (into ["-F" (str "start_line=" start-line)+ "-f" "start_side=RIGHT"]))]+ (apply sh args)))++(defn return-to-master!+ "Checkout master branch."+ []+ (sh "git" "checkout" "master")+ nil)++;;; --- Report helpers ---++(defn report-stats+ "Parse a mutation testing report file and return summary statistics.+ Returns a map with :total-fns, :uncovered, :partially-covered, :fully-covered,+ :pct-fully-covered, :total-surviving-mutations."+ [report-path]+ (let [content (slurp report-path)+ count-headings (fn [section-re]+ (let [section (second (re-find section-re content))]+ (if section+ (count (re-seq #"(?m)^### " section))+ 0)))+ uncovered (count-headings #"(?s)## Uncovered Functions\n(.*?)(?=\n## |\z)")+ partially (count-headings #"(?s)## Partially Covered Functions\n(.*?)(?=\n## |\z)")+ fully (count-headings #"(?s)## Fully Covered Functions\n(.*?)(?=\n## |\z)")+ total (+ uncovered partially fully)+ surviving (count (re-seq #"(?m)^#### Mutation:" content))]+ {:total-fns total+ :uncovered uncovered+ :partially-covered partially+ :fully-covered fully+ :pct-fully-covered (if (pos? total)+ (Math/round (* 100.0 (/ fully total)))+ 0)+ :total-surviving-mutations surviving}))++(defn project-name+ "Generate a Linear project name for a namespace.+ Example: Mutation Testing: metabase.lib.order-by"+ [target-ns]+ (str "Mutation Testing: " target-ns))++(defn project-description+ "Generate a Linear project description with business value and report statistics.+ Must be ≤255 characters (Linear limit).++ `stats` is a map from `report-stats`."+ [target-ns stats]+ (str "Mutation testing for " target-ns ". "+ (:total-fns stats) " fns: "+ (:uncovered stats) " untested, "+ (:partially-covered stats) " partial ("+ (:total-surviving-mutations stats) " surviving), "+ (:fully-covered stats) " covered ("+ (:pct-fully-covered stats) "%)"))++(defn project-content+ "Generate long-form markdown content for a Linear project.++ `stats` is a map from `report-stats`."+ [target-ns stats]+ (str "## Goal\n"+ "\n"+ "Improve test coverage in `" target-ns "` to catch regressions and reduce bugs "+ "in production. Mutation testing systematically finds code paths where the "+ "existing test suite would not detect introduced bugs.\n"+ "\n"+ "## Baseline Report\n"+ "\n"+ "| Metric | Count |\n"+ "| --- | --- |\n"+ "| Total functions | " (:total-fns stats) " |\n"+ "| Completely untested | " (:uncovered stats) " |\n"+ "| Partially covered | " (:partially-covered stats) " |\n"+ "| Fully covered | " (:fully-covered stats) " (" (:pct-fully-covered stats) "%) |\n"+ "| Surviving mutations | " (:total-surviving-mutations stats) " |\n"+ "\n"+ "## Process\n"+ "\n"+ "For each function with surviving mutations:\n"+ "1. Write the simplest tests that kill the mutations while remaining semantically meaningful\n"+ "2. Open a draft PR with the new tests\n"+ "3. A dev reviews the tests and any suggested code improvements\n"+ "4. Merge once approved\n"))++(defn create-project-for-namespace!+ "Create a Linear project for mutation testing a specific namespace.+ Reads statistics from the baseline report file.+ Sets status to 'In Progress'.+ Returns the project map and sets :project-id in config."+ [target-ns report-path]+ (let [stats (report-stats report-path)]+ (create-project! {:name (project-name target-ns)+ :description (project-description target-ns stats)+ :content (project-content target-ns stats)+ :status-id "29777ad8-950c-4c88-8e18-89a87dfc880f"})))++(defn create-issue-for-function!+ "Create a Linear issue for mutation testing a specific function.+ Returns the issue map with :identifier, :url, etc."+ [target-ns fn-name]+ (create-issue! {:title (linear-issue-title target-ns fn-name)+ :description (linear-issue-description target-ns fn-name)}))++(comment+ ;; Setup:+ ;; 1. Set LINEAR_API_KEY env var before starting the REPL+ ;; 2. Configure team and project:+ (set-config! {:team-id "your-team-id"})++ ;; Create a project (only needed once):+ (create-project! {:name "Mutation Testing: metabase.lib.*"+ :description "Kill surviving mutations in core query-building namespaces."})++ ;; Create an issue for a function:+ (create-issue-for-function! "metabase.lib.order-by" "orderable-columns")++ ;; Generate a PR description:+ (println (pr-description {:target-ns "metabase.lib.order-by"+ :fn-name "orderable-columns"+ :linear-identifier "QUE-1234"+ :killed ["Replace :asc with :asc__"+ "Replace = with not="]+ :not-killed [{:description "Replace nil with 0"+ :rationale "Default value is never used in practice"}]})))