Skip to content

Commit

Permalink
build: unpin OpenAPI specs from v2.0.0-alpha.2 URL refs, use REMOTE
Browse files Browse the repository at this point in the history
On a high level this is a find & replace operation where the occurrences of the
first bullet point were replaced with the second bullet point:
* `"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2`
* `"$ref": "../../../../..`

The firs bullet point above is called a URL reference while the second one is
called a REMOTE references (remote as in a different spec file on the file-system).

1. With this change, we unlock the release process being able to issue code that
is working on the latest OpenAPI specifications that we are cross-referencing
from one package to another.
2. Previously you had to manually update the references in about a hundred
and fifty locations to make sure that the versions are bumped but after this
change this happens automatically as the newly introduced bundling process
and the usage of the REMOTE references instead of URL references.
3. The problem so far with the release process was that with the URL references
we dependended on the existence of a pushed git tag for a successful release build.
But we cannot git push the tag before having performed a successful release build,
so this was a chicken-egg problem that had to be somehow untangled from its
circular dependency hell and this change is what makes it happen by no longer
depending on the git tags having been pushed to the upstream repository.

Related to, but does not yet fix: https://github.com/hyperledger/cacti/issues/2175

Depends on #3288

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Jun 14, 2024
1 parent 4a9ed0a commit c18b3fc
Show file tree
Hide file tree
Showing 12 changed files with 147 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredential",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"inputAmount": {
Expand Down Expand Up @@ -147,7 +147,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredential",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"gas": {
Expand Down Expand Up @@ -186,7 +186,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredential",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"htlcId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"GetObjectRequestV1": {
"type": "object",
"required": ["key"],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
Expand Down Expand Up @@ -67,6 +68,7 @@
"SetObjectRequestV1": {
"type": "object",
"required": ["key", "value"],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
Expand Down Expand Up @@ -100,6 +102,7 @@
"HasObjectRequestV1": {
"type": "object",
"required": ["key"],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"summary": "Retrieves an object from the object store.",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/4bf8038ea4c0c341cef3a63b59f77c12cec65a46/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/object_store_get_object_v1_request_body"
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/object_store_get_object_v1_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/4bf8038ea4c0c341cef3a63b59f77c12cec65a46/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/object_store_get_object_v1_response_body"
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/responses/object_store_get_object_v1_response_body"
}
}
}
Expand All @@ -68,11 +68,11 @@
"summary": "Sets an object in the object store under the specified key.",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/4bf8038ea4c0c341cef3a63b59f77c12cec65a46/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/object_store_set_object_v1_request_body"
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/object_store_set_object_v1_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/4bf8038ea4c0c341cef3a63b59f77c12cec65a46/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/object_store_set_object_v1_response_body"
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/responses/object_store_set_object_v1_response_body"
}
}
}
Expand All @@ -89,11 +89,11 @@
"summary": "Checks the presence of an object in the object store.",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/4bf8038ea4c0c341cef3a63b59f77c12cec65a46/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/object_store_has_object_v1_request_body"
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/object_store_has_object_v1_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/4bf8038ea4c0c341cef3a63b59f77c12cec65a46/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/object_store_has_object_v1_response_body"
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/responses/object_store_has_object_v1_response_body"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"properties": {
"jws": {
"description": "The JSON Web Signature of the Cactus node.",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-core-api/src/main/json/openapi.json#/components/schemas/JWSGeneral",
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/schemas/JWSGeneral",
"nullable": false
}
}
Expand All @@ -28,7 +28,7 @@
"properties": {
"jws": {
"description": "The JSON Web Signature of the Cactus consortium.",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-core-api/src/main/json/openapi.json#/components/schemas/JWSGeneral",
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/schemas/JWSGeneral",
"nullable": false,
"format": "The general format which is a JSON object, not a string."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredentialType",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"connectorId": {
Expand Down Expand Up @@ -118,7 +118,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredentialType",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"connectorId": {
Expand Down Expand Up @@ -166,7 +166,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredentialType",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"connectorId": {
Expand Down Expand Up @@ -208,7 +208,7 @@
}
},
"web3SigningCredential": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
},
"connectorId": {
"type": "string"
Expand All @@ -232,7 +232,7 @@
"type": "string"
},
"web3SigningCredential": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
},
"connectorId": {
"type": "string"
Expand Down Expand Up @@ -269,7 +269,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredential",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"gas": {
Expand Down Expand Up @@ -333,7 +333,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/RunTransactionResponse"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/RunTransactionResponse"
}
}
}
Expand Down Expand Up @@ -367,7 +367,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
}
}
}
Expand Down Expand Up @@ -453,7 +453,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
}
}
}
Expand Down Expand Up @@ -487,7 +487,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions packages/cactus-plugin-htlc-eth-besu/src/main/json/openapi.tpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"nullable": false
},
"web3SigningCredential": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
},
"keychainId": {
"description": "keychainId for the keychian plugin",
Expand Down Expand Up @@ -94,7 +94,7 @@
"nullable": false
},
"web3SigningCredential": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
},
"connectorId": {
"description": "connectorId for the connector besu plugin",
Expand Down Expand Up @@ -141,7 +141,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredentialType",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"connectorId": {
Expand Down Expand Up @@ -193,7 +193,7 @@
},
"web3SigningCredential": {
"description": "Web3SigningCredential",
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential",
"nullable": false
},
"gas": {
Expand All @@ -218,7 +218,7 @@
}
},
"web3SigningCredential": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
},
"connectorId": {
"type": "string"
Expand All @@ -242,7 +242,7 @@
"type": "string"
},
"web3SigningCredential": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/Web3SigningCredential"
},
"connectorId": {
"type": "string"
Expand Down Expand Up @@ -306,7 +306,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
}
}
}
Expand Down Expand Up @@ -338,7 +338,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
}
}
}
Expand Down Expand Up @@ -371,7 +371,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/InvokeContractV1Response"
}
}
}
Expand Down Expand Up @@ -455,7 +455,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v2.0.0-alpha.2/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/RunTransactionResponse"
"$ref": "../../../../../packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json#/components/schemas/RunTransactionResponse"
}
}
}
Expand Down
Loading

1 comment on commit c18b3fc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 0.05.

Benchmark suite Current: c18b3fc Previous: 4a9ed0a Ratio
plugin-ledger-connector-besu_HTTP_GET_getOpenApiSpecV1 681 ops/sec (±2.65%) 713 ops/sec (±2.56%) 1.05

This comment was automatically generated by workflow using github-action-benchmark.

CC: @petermetz

Please sign in to comment.