From d51a46a28d5ab8e82d84b0d31e981a30cab9ed97 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 9 Jun 2026 10:24:23 -0400 Subject: [PATCH 1/6] feat: initialize syncweaver --- .syncweaver-lock.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .syncweaver-lock.json diff --git a/.syncweaver-lock.json b/.syncweaver-lock.json new file mode 100644 index 0000000..9177202 --- /dev/null +++ b/.syncweaver-lock.json @@ -0,0 +1,14 @@ +{ + "name": "NIDAP-Community/CodeOcean-MOSuite-create", + "homePage": "https://github.com/NIDAP-Community/CodeOcean-MOSuite-create", + "sources": { + "code/MOSuite": { + "repo_url": "https://github.com/CCBR/MOSuite", + "ref": "v0.3.1", + "git_sha": "c09ee39f9b282237f13d88dcf4cdfed965209c68", + "installed_by": [ + "syncweaver" + ] + } + } +} From 16b3ffa5472eccc593ce657016199e0275b522d9 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 9 Jun 2026 11:36:50 -0400 Subject: [PATCH 2/6] ci: test syncweaver update-source workflow --- .github/workflows/update-source.yml | 94 +++++++++++++++++++++++++++++ .syncweaver-lock.json | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-source.yml diff --git a/.github/workflows/update-source.yml b/.github/workflows/update-source.yml new file mode 100644 index 0000000..b18a171 --- /dev/null +++ b/.github/workflows/update-source.yml @@ -0,0 +1,94 @@ +name: update-source + +on: + repository_dispatch: + workflow_dispatch: + inputs: + source_path: + description: Tracked source path in the host repository. + required: true + type: string + lockfile: + description: Path to the syncweaver lockfile. + required: false + default: .syncweaver-lock.json + type: string + ref: + description: Optional git ref to sync from. + required: false + type: string + remote_subdir: + description: Optional remote subdirectory to vendor. + required: false + type: string + +permissions: + contents: write + pull-requests: write + +jobs: + update-source: + runs-on: ubuntu-latest + outputs: + source_url: ${{ steps.update_source.outputs.source_url }} + ref: ${{ steps.update_source.outputs.ref }} + remote_subdir: ${{ steps.update_source.outputs.remote_subdir }} + env: + SOURCE_PATH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.source_path || github.event.client_payload.source_path || '' }} + LOCKFILE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.lockfile || github.event.client_payload.lockfile || '.syncweaver-lock.json' }} + REF: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.event.client_payload.ref || '' }} + REMOTE_SUBDIR: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.remote_subdir || github.event.client_payload.remote_subdir || '' }} + steps: + - name: Generate CCBR-bot token + id: ccbr_bot + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.CCBR_BOT_APP_ID }} + private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }} + + - name: Checkout repository + uses: actions/checkout@v6 + with: + token: ${{ steps.ccbr_bot.outputs.token }} + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.14" + cache: pip + + - name: Install syncweaver + run: | + python -m pip install --upgrade pip + python -m pip install "git+https://github.com/CCBR/syncweaver.git@main" + + - name: Run update-source composite action + id: update_source + uses: CCBR/syncweaver/actions/update-source@latest + with: + source_path: ${{ env.SOURCE_PATH }} + lockfile: ${{ env.LOCKFILE }} + ref: ${{ env.REF }} + remote_subdir: ${{ env.REMOTE_SUBDIR }} + + - name: Commit changes and open PR + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ steps.ccbr_bot.outputs.token }} + branch: syncweaver/update-source/${{ env.SOURCE_PATH }} + delete-branch: true + commit-message: "chore(syncweaver): update ${{ env.SOURCE_PATH}} from ${{ steps.update_source.outputs.source_repo }}@${{ steps.update_source.outputs.ref }}" + title: "chore(syncweaver): update ${{ env.SOURCE_PATH}} from ${{ steps.update_source.outputs.source_repo }}@${{ steps.update_source.outputs.ref }}" + body: | + Automated source update from the update-source workflow. + + Inputs used: + - source_path: ${{ env.SOURCE_PATH }} + - lockfile: ${{ env.LOCKFILE }} + - ref: ${{ env.REF }} + - remote_subdir: ${{ env.REMOTE_SUBDIR }} + + Resolved from lockfile after update: + - source_url: ${{ steps.update_source.outputs.source_url }} + - ref: ${{ steps.update_source.outputs.ref }} + - remote_subdir: ${{ steps.update_source.outputs.remote_subdir }} diff --git a/.syncweaver-lock.json b/.syncweaver-lock.json index 9177202..91a307f 100644 --- a/.syncweaver-lock.json +++ b/.syncweaver-lock.json @@ -4,7 +4,7 @@ "sources": { "code/MOSuite": { "repo_url": "https://github.com/CCBR/MOSuite", - "ref": "v0.3.1", + "ref": "main", "git_sha": "c09ee39f9b282237f13d88dcf4cdfed965209c68", "installed_by": [ "syncweaver" From 6e4a36e4045913b6667983b8815645078544889d Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 9 Jun 2026 11:57:18 -0400 Subject: [PATCH 3/6] chore: rename --- .../workflows/{update-source.yml => syncweaver-update-source.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{update-source.yml => syncweaver-update-source.yml} (100%) diff --git a/.github/workflows/update-source.yml b/.github/workflows/syncweaver-update-source.yml similarity index 100% rename from .github/workflows/update-source.yml rename to .github/workflows/syncweaver-update-source.yml From ee0141f3407542466d2c5235b7ff35a1f2cbfef6 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 9 Jun 2026 19:14:05 -0400 Subject: [PATCH 4/6] ci: update name --- .github/workflows/syncweaver-update-source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/syncweaver-update-source.yml b/.github/workflows/syncweaver-update-source.yml index b18a171..c659492 100644 --- a/.github/workflows/syncweaver-update-source.yml +++ b/.github/workflows/syncweaver-update-source.yml @@ -1,4 +1,4 @@ -name: update-source +name: syncweaver-update-source on: repository_dispatch: From d0aab10a894f8198d43acd25988b6ce355a41009 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Mon, 22 Jun 2026 14:16:57 -0400 Subject: [PATCH 5/6] fix: urls for repos --- .syncweaver-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.syncweaver-lock.json b/.syncweaver-lock.json index 91a307f..4b0eee8 100644 --- a/.syncweaver-lock.json +++ b/.syncweaver-lock.json @@ -1,6 +1,6 @@ { - "name": "NIDAP-Community/CodeOcean-MOSuite-create", - "homePage": "https://github.com/NIDAP-Community/CodeOcean-MOSuite-create", + "name": "NIDAP-Community/MOSuite-create", + "homePage": "https://github.com/NIDAP-Community/MOSuite-create", "sources": { "code/MOSuite": { "repo_url": "https://github.com/CCBR/MOSuite", From 52c1fa0a11d5076094b353c986c30c820ddd5a22 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Mon, 22 Jun 2026 14:20:32 -0400 Subject: [PATCH 6/6] ci: resolve source path from repo url --- .../workflows/syncweaver-update-source.yml | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/syncweaver-update-source.yml b/.github/workflows/syncweaver-update-source.yml index c659492..073f2c6 100644 --- a/.github/workflows/syncweaver-update-source.yml +++ b/.github/workflows/syncweaver-update-source.yml @@ -6,7 +6,11 @@ on: inputs: source_path: description: Tracked source path in the host repository. - required: true + required: false + type: string + repo_url: + description: Optional source repository URL used to resolve source_path from lockfile. + required: false type: string lockfile: description: Path to the syncweaver lockfile. @@ -35,6 +39,7 @@ jobs: remote_subdir: ${{ steps.update_source.outputs.remote_subdir }} env: SOURCE_PATH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.source_path || github.event.client_payload.source_path || '' }} + REPO_URL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.repo_url || github.event.client_payload.repo_url || github.event.client_payload.source_repository || '' }} LOCKFILE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.lockfile || github.event.client_payload.lockfile || '.syncweaver-lock.json' }} REF: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.event.client_payload.ref || '' }} REMOTE_SUBDIR: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.remote_subdir || github.event.client_payload.remote_subdir || '' }} @@ -62,11 +67,41 @@ jobs: python -m pip install --upgrade pip python -m pip install "git+https://github.com/CCBR/syncweaver.git@main" + - name: Resolve source path + id: resolve_source_path + shell: python + env: + SOURCE_PATH_INPUT: ${{ env.SOURCE_PATH }} + REPO_URL_INPUT: ${{ env.REPO_URL }} + LOCKFILE_PATH: ${{ env.LOCKFILE }} + run: | + import os + import pathlib + + from syncweaver.lockfile import resolve_source_path_from_lockfile + + source_path_input = os.environ["SOURCE_PATH_INPUT"].strip() + repo_url_input = os.environ["REPO_URL_INPUT"].strip() + lockfile_path = pathlib.Path(os.environ["LOCKFILE_PATH"]) + output_path = pathlib.Path(os.environ["GITHUB_OUTPUT"]) + + try: + resolved_source_path = resolve_source_path_from_lockfile( + lockfile=lockfile_path, + source_path=source_path_input, + repo_url=repo_url_input, + ) + except ValueError as exc: + raise SystemExit(f"Error: {exc}") from exc + + with output_path.open("a", encoding="utf-8") as fh: + fh.write(f"source_path={resolved_source_path}\n") + - name: Run update-source composite action id: update_source uses: CCBR/syncweaver/actions/update-source@latest with: - source_path: ${{ env.SOURCE_PATH }} + source_path: ${{ steps.resolve_source_path.outputs.source_path }} lockfile: ${{ env.LOCKFILE }} ref: ${{ env.REF }} remote_subdir: ${{ env.REMOTE_SUBDIR }} @@ -75,15 +110,16 @@ jobs: uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.ccbr_bot.outputs.token }} - branch: syncweaver/update-source/${{ env.SOURCE_PATH }} + branch: syncweaver/update-source/${{ steps.resolve_source_path.outputs.source_path }} delete-branch: true - commit-message: "chore(syncweaver): update ${{ env.SOURCE_PATH}} from ${{ steps.update_source.outputs.source_repo }}@${{ steps.update_source.outputs.ref }}" - title: "chore(syncweaver): update ${{ env.SOURCE_PATH}} from ${{ steps.update_source.outputs.source_repo }}@${{ steps.update_source.outputs.ref }}" + commit-message: "chore(syncweaver): update ${{ steps.resolve_source_path.outputs.source_path }} from ${{ steps.update_source.outputs.source_repo }}@${{ steps.update_source.outputs.ref }}" + title: "chore(syncweaver): update ${{ steps.resolve_source_path.outputs.source_path }} from ${{ steps.update_source.outputs.source_repo }}@${{ steps.update_source.outputs.ref }}" body: | Automated source update from the update-source workflow. Inputs used: - - source_path: ${{ env.SOURCE_PATH }} + - source_path: ${{ steps.resolve_source_path.outputs.source_path }} + - repo_url: ${{ env.REPO_URL }} - lockfile: ${{ env.LOCKFILE }} - ref: ${{ env.REF }} - remote_subdir: ${{ env.REMOTE_SUBDIR }}