From bc546de42316632ba3a69f878854825df263c58c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 01:11:30 +0000 Subject: [PATCH 1/6] Initial plan From a7f4a61bf00058646ca836f7f1cc41341ee8fe09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 01:15:22 +0000 Subject: [PATCH 2/6] chore: add shared openapi sync scaffolding Agent-Logs-Url: https://github.com/CenterForDigitalHumanities/rerum_server_nodejs/sessions/b8591b1e-5ffa-4f96-bdba-fc2d6341533a Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> --- .../workflows/sync-rerum-shared-openapi.yml | 34 +++++++++++++++++++ __tests__/openapi_sync_artifacts.test.js | 29 ++++++++++++++++ .../rerum-shared-components.openapi.yaml | 13 +++++++ .../rerum-shared-components.openapi.yaml | 13 +++++++ 4 files changed, 89 insertions(+) create mode 100644 .github/workflows/sync-rerum-shared-openapi.yml create mode 100644 __tests__/openapi_sync_artifacts.test.js create mode 100644 openapi/components/rerum-shared-components.openapi.yaml create mode 100644 schemas/openapi/rerum-shared-components.openapi.yaml diff --git a/.github/workflows/sync-rerum-shared-openapi.yml b/.github/workflows/sync-rerum-shared-openapi.yml new file mode 100644 index 0000000..072f1e4 --- /dev/null +++ b/.github/workflows/sync-rerum-shared-openapi.yml @@ -0,0 +1,34 @@ +name: Sync shared RERUM OpenAPI artifact + +on: + push: + branches: + - main + paths: + - openapi/components/rerum-shared-components.openapi.yaml + workflow_dispatch: + +permissions: + contents: read + +jobs: + dispatch-sync: + runs-on: ubuntu-latest + steps: + - name: Dispatch sync-provider-artifact workflow + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.BRY_PAT }} + script: | + await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { + owner: 'cubap', + repo: 'rerum_openapi', + workflow_id: 'sync-provider-artifact.yml', + ref: 'main', + inputs: { + provider_repository: '${{ github.repository }}', + provider_ref: '${{ github.sha }}', + provider_artifact_path: 'openapi/components/rerum-shared-components.openapi.yaml', + target_artifact_path: 'schemas/openapi/rerum-shared-components.openapi.yaml' + } + }) diff --git a/__tests__/openapi_sync_artifacts.test.js b/__tests__/openapi_sync_artifacts.test.js new file mode 100644 index 0000000..3881511 --- /dev/null +++ b/__tests__/openapi_sync_artifacts.test.js @@ -0,0 +1,29 @@ +import fs from "fs" +import path from "path" +import { fileURLToPath } from "url" + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const repoRoot = path.resolve(__dirname, "..") + +describe("Shared OpenAPI artifact sync scaffolding", () => { + it("keeps provider and target artifact files in place", () => { + const providerArtifactPath = path.join(repoRoot, "openapi/components/rerum-shared-components.openapi.yaml") + const targetArtifactPath = path.join(repoRoot, "schemas/openapi/rerum-shared-components.openapi.yaml") + + expect(fs.existsSync(providerArtifactPath)).toBeTruthy() + expect(fs.existsSync(targetArtifactPath)).toBeTruthy() + expect(fs.readFileSync(providerArtifactPath, "utf8")).toContain("openapi: 3.0.3") + expect(fs.readFileSync(targetArtifactPath, "utf8")).toContain("openapi: 3.0.3") + }) + + it("dispatches the shared artifact sync workflow for provider changes", () => { + const workflowPath = path.join(repoRoot, ".github/workflows/sync-rerum-shared-openapi.yml") + const workflow = fs.readFileSync(workflowPath, "utf8") + + expect(workflow).toContain("openapi/components/rerum-shared-components.openapi.yaml") + expect(workflow).toContain("sync-provider-artifact.yml") + expect(workflow).toContain("repo: 'rerum_openapi'") + expect(workflow).toContain("target_artifact_path: 'schemas/openapi/rerum-shared-components.openapi.yaml'") + }) +}) diff --git a/openapi/components/rerum-shared-components.openapi.yaml b/openapi/components/rerum-shared-components.openapi.yaml new file mode 100644 index 0000000..7219e7a --- /dev/null +++ b/openapi/components/rerum-shared-components.openapi.yaml @@ -0,0 +1,13 @@ +openapi: 3.0.3 +info: + title: RERUM Shared Components + version: 0.0.0 + description: Shared reusable OpenAPI components for RERUM v1 contracts. +externalDocs: + description: RERUM API reference + url: https://store.rerum.io/v1/API.html +x-upstream-provider: + name: rerum_server_nodejs + baseUrl: https://store.rerum.io/v1 +components: + schemas: {} diff --git a/schemas/openapi/rerum-shared-components.openapi.yaml b/schemas/openapi/rerum-shared-components.openapi.yaml new file mode 100644 index 0000000..7219e7a --- /dev/null +++ b/schemas/openapi/rerum-shared-components.openapi.yaml @@ -0,0 +1,13 @@ +openapi: 3.0.3 +info: + title: RERUM Shared Components + version: 0.0.0 + description: Shared reusable OpenAPI components for RERUM v1 contracts. +externalDocs: + description: RERUM API reference + url: https://store.rerum.io/v1/API.html +x-upstream-provider: + name: rerum_server_nodejs + baseUrl: https://store.rerum.io/v1 +components: + schemas: {} From afb306687a71162ea98411ebb0564beebad81431 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 01:16:53 +0000 Subject: [PATCH 3/6] test: tighten openapi sync scaffolding coverage Agent-Logs-Url: https://github.com/CenterForDigitalHumanities/rerum_server_nodejs/sessions/b8591b1e-5ffa-4f96-bdba-fc2d6341533a Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> --- __tests__/openapi_sync_artifacts.test.js | 8 ++++++-- openapi/components/rerum-shared-components.openapi.yaml | 2 +- schemas/openapi/rerum-shared-components.openapi.yaml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/__tests__/openapi_sync_artifacts.test.js b/__tests__/openapi_sync_artifacts.test.js index 3881511..4569c24 100644 --- a/__tests__/openapi_sync_artifacts.test.js +++ b/__tests__/openapi_sync_artifacts.test.js @@ -10,11 +10,15 @@ describe("Shared OpenAPI artifact sync scaffolding", () => { it("keeps provider and target artifact files in place", () => { const providerArtifactPath = path.join(repoRoot, "openapi/components/rerum-shared-components.openapi.yaml") const targetArtifactPath = path.join(repoRoot, "schemas/openapi/rerum-shared-components.openapi.yaml") + const providerArtifact = fs.readFileSync(providerArtifactPath, "utf8") + const targetArtifact = fs.readFileSync(targetArtifactPath, "utf8") expect(fs.existsSync(providerArtifactPath)).toBeTruthy() expect(fs.existsSync(targetArtifactPath)).toBeTruthy() - expect(fs.readFileSync(providerArtifactPath, "utf8")).toContain("openapi: 3.0.3") - expect(fs.readFileSync(targetArtifactPath, "utf8")).toContain("openapi: 3.0.3") + expect(providerArtifact).toContain("openapi: 3.0.3") + expect(providerArtifact).toContain("version: 0.1.0") + expect(targetArtifact).toContain("openapi: 3.0.3") + expect(targetArtifact).toContain("version: 0.1.0") }) it("dispatches the shared artifact sync workflow for provider changes", () => { diff --git a/openapi/components/rerum-shared-components.openapi.yaml b/openapi/components/rerum-shared-components.openapi.yaml index 7219e7a..42e0b66 100644 --- a/openapi/components/rerum-shared-components.openapi.yaml +++ b/openapi/components/rerum-shared-components.openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: RERUM Shared Components - version: 0.0.0 + version: 0.1.0 description: Shared reusable OpenAPI components for RERUM v1 contracts. externalDocs: description: RERUM API reference diff --git a/schemas/openapi/rerum-shared-components.openapi.yaml b/schemas/openapi/rerum-shared-components.openapi.yaml index 7219e7a..42e0b66 100644 --- a/schemas/openapi/rerum-shared-components.openapi.yaml +++ b/schemas/openapi/rerum-shared-components.openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: RERUM Shared Components - version: 0.0.0 + version: 0.1.0 description: Shared reusable OpenAPI components for RERUM v1 contracts. externalDocs: description: RERUM API reference From 7dd674dbb93b0ed6d88aa95a8c938581e7d2b6d9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 01:17:49 +0000 Subject: [PATCH 4/6] test: simplify openapi artifact assertions Agent-Logs-Url: https://github.com/CenterForDigitalHumanities/rerum_server_nodejs/sessions/b8591b1e-5ffa-4f96-bdba-fc2d6341533a Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> --- __tests__/openapi_sync_artifacts.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/__tests__/openapi_sync_artifacts.test.js b/__tests__/openapi_sync_artifacts.test.js index 4569c24..856be66 100644 --- a/__tests__/openapi_sync_artifacts.test.js +++ b/__tests__/openapi_sync_artifacts.test.js @@ -13,12 +13,13 @@ describe("Shared OpenAPI artifact sync scaffolding", () => { const providerArtifact = fs.readFileSync(providerArtifactPath, "utf8") const targetArtifact = fs.readFileSync(targetArtifactPath, "utf8") - expect(fs.existsSync(providerArtifactPath)).toBeTruthy() - expect(fs.existsSync(targetArtifactPath)).toBeTruthy() - expect(providerArtifact).toContain("openapi: 3.0.3") - expect(providerArtifact).toContain("version: 0.1.0") - expect(targetArtifact).toContain("openapi: 3.0.3") - expect(targetArtifact).toContain("version: 0.1.0") + for (const artifact of [providerArtifact, targetArtifact]) { + expect(artifact).toContain("openapi: 3.0.3") + expect(artifact).toContain("title: RERUM Shared Components") + expect(artifact).toContain("version: 0.1.0") + expect(artifact).toContain("components:") + expect(artifact).toContain("schemas: {}") + } }) it("dispatches the shared artifact sync workflow for provider changes", () => { From 766be1c02f7ef2cd3a9bb73384587160a1ed30c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 01:18:47 +0000 Subject: [PATCH 5/6] docs: clarify synced openapi target artifact Agent-Logs-Url: https://github.com/CenterForDigitalHumanities/rerum_server_nodejs/sessions/b8591b1e-5ffa-4f96-bdba-fc2d6341533a Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> --- __tests__/openapi_sync_artifacts.test.js | 2 +- schemas/openapi/rerum-shared-components.openapi.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/__tests__/openapi_sync_artifacts.test.js b/__tests__/openapi_sync_artifacts.test.js index 856be66..e0ff8fa 100644 --- a/__tests__/openapi_sync_artifacts.test.js +++ b/__tests__/openapi_sync_artifacts.test.js @@ -7,7 +7,7 @@ const __dirname = path.dirname(__filename) const repoRoot = path.resolve(__dirname, "..") describe("Shared OpenAPI artifact sync scaffolding", () => { - it("keeps provider and target artifact files in place", () => { + it("verifies provider and target artifact files contain valid OpenAPI structure", () => { const providerArtifactPath = path.join(repoRoot, "openapi/components/rerum-shared-components.openapi.yaml") const targetArtifactPath = path.join(repoRoot, "schemas/openapi/rerum-shared-components.openapi.yaml") const providerArtifact = fs.readFileSync(providerArtifactPath, "utf8") diff --git a/schemas/openapi/rerum-shared-components.openapi.yaml b/schemas/openapi/rerum-shared-components.openapi.yaml index 42e0b66..c3df3ed 100644 --- a/schemas/openapi/rerum-shared-components.openapi.yaml +++ b/schemas/openapi/rerum-shared-components.openapi.yaml @@ -1,3 +1,4 @@ +# Synced copy kept in-repo so provider-driven artifact updates target an existing file. openapi: 3.0.3 info: title: RERUM Shared Components From 6cd3a1b31006944711776dceca681687ca4cd492 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 01:19:48 +0000 Subject: [PATCH 6/6] test: rename openapi sync checks for clarity Agent-Logs-Url: https://github.com/CenterForDigitalHumanities/rerum_server_nodejs/sessions/b8591b1e-5ffa-4f96-bdba-fc2d6341533a Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> --- __tests__/openapi_sync_artifacts.test.js | 2 +- schemas/openapi/rerum-shared-components.openapi.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/openapi_sync_artifacts.test.js b/__tests__/openapi_sync_artifacts.test.js index e0ff8fa..d63db01 100644 --- a/__tests__/openapi_sync_artifacts.test.js +++ b/__tests__/openapi_sync_artifacts.test.js @@ -22,7 +22,7 @@ describe("Shared OpenAPI artifact sync scaffolding", () => { } }) - it("dispatches the shared artifact sync workflow for provider changes", () => { + it("verifies the shared artifact sync workflow configuration", () => { const workflowPath = path.join(repoRoot, ".github/workflows/sync-rerum-shared-openapi.yml") const workflow = fs.readFileSync(workflowPath, "utf8") diff --git a/schemas/openapi/rerum-shared-components.openapi.yaml b/schemas/openapi/rerum-shared-components.openapi.yaml index c3df3ed..aa3aec3 100644 --- a/schemas/openapi/rerum-shared-components.openapi.yaml +++ b/schemas/openapi/rerum-shared-components.openapi.yaml @@ -1,4 +1,4 @@ -# Synced copy kept in-repo so provider-driven artifact updates target an existing file. +# This file is automatically synced from openapi/components/rerum-shared-components.openapi.yaml. Do not edit manually. openapi: 3.0.3 info: title: RERUM Shared Components