{"id":16096314,"url":"https://github.com/namenu/deps-diff","last_synced_at":"2025-03-17T17:31:16.186Z","repository":{"id":196824953,"uuid":"696794511","full_name":"namenu/deps-diff","owner":"namenu","description":"A tool for comparing transitive dependencies in two deps.edn files.","archived":false,"fork":false,"pushed_at":"2024-06-14T14:20:55.000Z","size":126,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T01:29:12.014Z","etag":null,"topics":["clojure","deps-edn","diff","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namenu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-26T12:56:23.000Z","updated_at":"2024-06-14T14:20:55.000Z","dependencies_parsed_at":"2024-01-08T12:34:49.548Z","dependency_job_id":"334f7847-4ea1-447d-91d6-e368d8968e89","html_url":"https://github.com/namenu/deps-diff","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":"0.024390243902439046","last_synced_commit":"7f8e8b2932f14f08bfffe17b246a152f92333b4a"},"previous_names":["namenu/deps-diff"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namenu%2Fdeps-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namenu%2Fdeps-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namenu%2Fdeps-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namenu%2Fdeps-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namenu","download_url":"https://codeload.github.com/namenu/deps-diff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243872434,"owners_count":20361479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["clojure","deps-edn","diff","github-actions"],"created_at":"2024-10-09T17:13:16.309Z","updated_at":"2025-03-17T17:31:15.752Z","avatar_url":"https://github.com/namenu.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deps-diff\n\nA tool for comparing transitive dependencies in two deps.edn files.\n\nCertainly, the Clojure ecosystem does not strictly follow SemVer ([Spec-ulation](https://www.youtube.com/watch?v=oyLBGkS5ICk\u0026t=2789s)),\nand if there are no concrete benefits, it is recommended not to update dependencies.\nHowever, when it becomes necessary to replace an artifact, you need to be extremely careful,\nespecially when implicit transitive dependencies change, as compatibility issues may arise.\n\nFor example, consider the following dependency tree:\n\n```\n+-----+     +--------+     +--------+\n|  A  | --\u003e | B(1.0) | --\u003e | C(1.0) |\n+-----+     +--------+     +--------+\n      \\     +--------+     +--------+\n       +--\u003e | D(1.0) | --\u003e | C(1.0) |\n            +--------+     +--------+\n```\n\nLet's assume a situation where we need to update dependency B:\n\n```\n+-----+     +--------+     +--------+\n|  A  | --\u003e | B(2.0) | --\u003e | C(2.0) |\n+-----+     +--------+     +--------+\n      \\     +--------+     +--------+\n       +--\u003e | D(1.0) | --\u003e | C(1.0) |\n            +--------+     +--------+\n```\n\nIn this scenario, B internally updated C to 2.0. If we haven't explicitly specified the version of C,\nthere is no way to guarantee that D will work correctly (See [Dep selection](https://clojure.org/reference/dep_expansion#_dep_selection)).\n\nBut it's good to know that such potential risks can be detected in advance.\n`deps-diff` is a GitHub Action created for this purpose.\n\n\n## Example\n\nJust create a `.github/workflows/deps-diff.yml` file as follows.\n\n```yml\nname: Notify dependency diff\n\non:\n  pull_request:\n    paths:\n      - 'deps.edn' # only watch this\n\njobs:\n  notify:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Diff dependencies\n        id: diff\n        uses: namenu/deps-diff@main\n        with:\n          format: markdown\n          aliases: \"[:test]\"\n\n      - uses: marocchino/sticky-pull-request-comment@v2\n        if: ${{ steps.diff.outputs.exit_code != 0 }}\n        with:\n          header: deps-diff # Creates a collapsed comment with the report\n          message: |\n            ### `deps.edn` dependency changes\n\n            ${{ steps.diff.outputs.deps_diff }}\n```\n\nThis workflow will comment on your PR as shown below.\n\n\u003cimg src=\"example.png\" width=\"696\"\u003e\n\n\n## Inputs\n\n| Name        | Description                                                                                                                  | Default Value               |\n|-------------|------------------------------------------------------------------------------------------------------------------------------|-----------------------------|\n| `base`      | The git sha before the change being referenced. The default value is the git ref of the base branch of the PR.               | Git ref of PR's base branch |\n| `format`    | Determines the format of the output. You can specify `edn`, `markdown`, or `cli`. The default value is edn                   | `edn`                       |\n| `aliases`   | Specifies the aliases to be used when forming the basis. It must be expressed as a quoted sequence (e.g., `'[:dev :test]'`). | `nil`                       |\n| `project`   | Specifies the path of the `deps.edn` file.                                                                                   | `deps.edn`                  |\n\n\n## Outputs\n\n- `deps_diff` - The name of the outlet where the execution result is output. Use it along with the action's id in your workflow.\n- `exit_code` - 0 if equal or else 1.\n\n\n## Run as a tool\n\n```bash\n# install\nclojure -Ttools install-latest :lib io.github.namenu/deps-diff :as deps-diff`\n\n# resolve deps before changes\nclojure -X:deps tree :dir '\"./before\"' \u003e __before.edn\n# resolve deps after changes\nclojure -X:deps tree :dir '\"./after\"' \u003e __after.edn\n\n# then compare\nclojure -Tdeps-diff diff :base '\"__before.edn\"' :target '\"__after.edn\"' :format :cli\n\n# output will be like this\n\n  Modified  org.clojure/spec.alpha                                      0.2.194 -\u003e 0.3.218\n  Modified  com.github.seancorfield/next.jdbc                           1.2.796 -\u003e 1.3.847\n  Modified  org.clojure/core.specs.alpha                                0.2.56 -\u003e 0.2.62\n  Modified  camel-snake-kebab/camel-snake-kebab                         0.4.2 -\u003e 0.4.3\n  Modified  org.clojure/clojure                                         1.10.3 -\u003e 1.11.1\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamenu%2Fdeps-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamenu%2Fdeps-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamenu%2Fdeps-diff/lists"}