{"id":19768197,"url":"https://github.com/squareslab/melt_action","last_synced_at":"2025-07-04T19:34:57.184Z","repository":{"id":142958224,"uuid":"607321722","full_name":"squaresLab/melt_action","owner":"squaresLab","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-15T02:51:53.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T16:44:18.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/squaresLab.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,"zenodo":null}},"created_at":"2023-02-27T18:57:32.000Z","updated_at":"2024-08-23T11:57:16.000Z","dependencies_parsed_at":"2023-08-16T21:26:58.487Z","dependency_job_id":"34cecfa3-b2b7-446e-8ad8-f2af562e0a6c","html_url":"https://github.com/squaresLab/melt_action","commit_stats":null,"previous_names":["squareslab/melt_action"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/squaresLab/melt_action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaresLab%2Fmelt_action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaresLab%2Fmelt_action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaresLab%2Fmelt_action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaresLab%2Fmelt_action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squaresLab","download_url":"https://codeload.github.com/squaresLab/melt_action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaresLab%2Fmelt_action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263607139,"owners_count":23487743,"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":[],"created_at":"2024-11-12T04:36:08.494Z","updated_at":"2025-07-04T19:34:57.158Z","avatar_url":"https://github.com/squaresLab.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MELT GitHub Action\n\n## What is MELT?\n\n**MELT** is a tool that automatically generates upgrade rules when your library undergoes API-breaking changes. \nIt integrates into your workflow, making it easier for your clients to transition between different versions of your library.\nThe upgrade rules are expressed in Comby, and thus easily interpratable, adaptable, and verifiable.\n\n### Example Use Case\n\nSuppose your API originally had a function with an optional keyword argument to return a JSON response. \nYou've now refactored the API to split this functionality into two separate methods, resulting in the following breaking change:\n\n```diff\n--- a/DataService.py\n+++ b/DataService.py\n@@ -1,6 +1,9 @@\n class DataService:\n ...\n-    def fetch_data(self, endpoint: str, as_json: bool = False) -\u003e dict[str, object] | DataService:\n-        response = self._get_data(endpoint)\n-        if as_json:\n-            return response.json()\n-        return self\n+    def fetch_data(self, endpoint: str) -\u003e 'DataService':\n+        self.data = self._get_data(endpoint)\n+        return self\n+\n+    def to_json(self) -\u003e dict[str, object]:\n+        return self.data.json()\n ...\n\n```\n\nThis API change will break any client code that relies on the `as_json` argument. \nFortunately, MELT's GitHub Action can automatically generate the necessary transformation rules to help your clients update their codebase automatically. \nFor this particular change you've made, MELT would generate a transformation rule:\n\n```python\n:[[x]].fetch_data(:[endpoint], as_json=True) -\u003e :[[x]].fetch_data(:[endpoint]).to_json()\n\n    where :[x].type == \"DataService\"\n```\n`:[[x]]` is simply a placeholder value to match any indentifier.\n\nYour library clients can easily apply this transformation rule to upgrade between versions. \nThe only requirement is that they have [Comby](https://comby.dev) installed — a lightweight code transformation tool similar to sed.\n\n### How Does It Work?\n\nMELT learns how to update your API by analyzing how you've updated your internal usages in your unit or integration tests. If you're interested in learning more, check out the [technical paper](https://arxiv.org/abs/2308.14687v2). The source code for MELT is also available on [GitHub](https://github.com/squaresLab/melt).\n\n\nPlease note that MELT is a prototype. Unfortunately, I don't have the bandwidth to maintain this tooling, but if you're interested in using it or developing something better, feel free to open an issue or email me (see the paper for contact details).\n\n*This is a work in progress. The current Docker image does not contain the latest version of MELT.*\n\n## Usage\n\nTo use MELT in your GitHub workflow, add the following snippet to your `.github/workflows/main.yml` file:\n\n```yaml\non:\n  pull_request:\n    types: [opened, reopened]\n\njobs:\n  gen_rules:\n    runs-on: ubuntu-latest\n    name: Automatically generate Comby rules from the pull request\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n        with:\n          fetch-depth: 2\n          ref: ${{ github.event.pull_request.head.sha }}\n\n      - name: Generate Comby rules\n        uses: squaresLab/melt_action@v3\n        with:\n          mountpoint: /github/workspace\n          basesha: ${{ github.event.pull_request.base.sha }}\n\n      - name: Upload artifact\n        uses: actions/upload-artifact@v3\n        with:\n          path: ${{ github.workspace }}/generated_file.txt\n```\n\n## Inputs\n\n| Input       | Description                         | Required |\n|-------------|-------------------------------------|----------|\n| `mountpoint` | Mount point for your repo           | Yes      |\n| `basesha`    | SHA of the base of the merge        | Yes      |\n\n## Outputs\n\n| Output | Description                |\n|--------|----------------------------|\n| `rules`  | Rules MELT generated       |\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquareslab%2Fmelt_action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquareslab%2Fmelt_action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquareslab%2Fmelt_action/lists"}