Skip to content

Commit

Permalink
Merge pull request #1185 from RakhithaRR/4.4.0-preparations
Browse files Browse the repository at this point in the history
Add changes for APICTL 4.4.0 release
  • Loading branch information
RakhithaRR authored Sep 9, 2024
2 parents 96bb03e + 79d2c97 commit f4a0361
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 44 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
name: API Controller Build with Test

on:
push:
pull_request:
branches:
- master

workflow_dispatch:

Expand All @@ -44,7 +46,7 @@ jobs:
- name: Set up Golang
uses: actions/setup-go@v2
with:
go-version: ^1.14
go-version: ^1.20

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand All @@ -57,8 +59,8 @@ jobs:
- name: Build
run: |
cd import-export-cli
go vet ./...
./build.sh -t apictl.go -v 4.3.0
# go vet ./...
./build.sh -t apictl.go -v 4.4.0
- name: Start APIM
run: |
Expand All @@ -69,4 +71,4 @@ jobs:
- name: Test
run: |
cd import-export-cli/integration
go test -p 1 -timeout 0 -archive apictl-4.3.0-linux-x64.tar.gz -race -coverprofile=coverage.txt -covermode=atomic ./pkg/...
go test -p 1 -timeout 0 -archive apictl-4.4.0-linux-x64.tar.gz -race -coverprofile=coverage.txt -covermode=atomic ./pkg/...
8 changes: 4 additions & 4 deletions import-export-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CLI for Importing and Exporting APIs and Applications and Managing WSO2 Micro Integrator
## For WSO2 API Manager 4.3.0
## For WSO2 API Manager 4.4.0

Command Line tool for importing and exporting APIs/Applications/API Products in between different API environments of WSO2 API Manager and managing WSO2 Micro Integrator

Expand All @@ -17,7 +17,7 @@ Command Line tool for importing and exporting APIs/Applications/API Products in
- ### Building
`cd` into `product-apim-tooling/import-export-cli`

Execute `./build.sh -t apictl.go -v 4.3.0 -f` to build for all platforms.
Execute `./build.sh -t apictl.go -v 4.4.0 -f` to build for all platforms.

Created packages will be available at `build/target` directory

Expand Down Expand Up @@ -69,11 +69,11 @@ Command Line tool for importing and exporting APIs/Applications/API Products in

Usage: `docker build --build-arg version=<version> -t apictl:<version> .`

Example: `docker build --build-arg version=4.3.0.1 -t apictl:4.3.0.1 .`
Example: `docker build --build-arg version=4.4.0.1 -t apictl:4.4.0.1 .`

- ### Using the Docker Image

`docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.3.0.1 <apictl command>`
`docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.4.0.1 <apictl command>`

***

Expand Down
2 changes: 1 addition & 1 deletion import-export-cli/box/resources/init/default_api.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: api
version: v4.3.0
version: v4.4.0
data:
name:
context:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: deployment_environments
version: v4.3.0
version: v4.4.0
data:
-
displayOnDevportal: true
Expand Down
2 changes: 1 addition & 1 deletion import-export-cli/box/resources/init/document.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: document
version: v4.3.0
version: v4.4.0
data:
name: AWSSecurityDocs
type: OTHER
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: api
version: v4.3.0
version: v4.4.0
data:
id: 39325037-1508-4398-a358-e551927ff075
name: PizzaShackAPI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: api
version: v4.3.0
version: v4.4.0
data:
id: 39325037-1508-4398-a358-e551927ff075
name: PizzaShackAPI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: api
version: v4.3.0
version: v4.4.0
data:
id: 39325037-1508-4398-a358-e551927ff075
name: PizzaShackAPI
Expand Down
6 changes: 3 additions & 3 deletions import-export-cli/impl/importAPIProduct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestExtractAPIProductInfoWithCorrectJSON(t *testing.T) {
// Correct json
content := `{
"type": "api_product",
"version": "v4.3.0",
"version": "v4.4.0",
"data": {
"id": "e4d0c1be-44e9-43ad-b434-f8e2f02dad11",
"name": "APIProductName",
Expand All @@ -51,7 +51,7 @@ func TestExtractAPIProductInfoWhenDataTagMissing(t *testing.T) {
// When ID tag missing
content := `{
"type": "api_product",
"version": "v4.3.0"
"version": "v4.4.0"
}`
apiProduct, err := extractAPIProductDefinition([]byte(content))
assert.Nil(t, err, "Should return nil error")
Expand All @@ -62,7 +62,7 @@ func TestExtractAPIProductInfoWithMalformedJSON(t *testing.T) {
// Malformed json
content := `{
"type": "api_product",
"version": "v4.3.0",
"version": "v4.4.0",
"data": {
"id": "e4d0c1be-44e9-43ad-b434-f8e2f02dad11",
"name": "APIProductName",
Expand Down
4 changes: 2 additions & 2 deletions import-export-cli/impl/importAPI_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestExtractAPIInfoWithCorrectJSON(t *testing.T) {
// Correct json
content := `{
"type": "api",
"version": "v4.3.0",
"version": "v4.4.0",
"data": {
"id": "e4d0c1be-44e9-43ad-b434-f8e2f02dad11",
"name": "APIName",
Expand All @@ -52,7 +52,7 @@ func TestExtractAPIInfoWhenDataTagMissing(t *testing.T) {
// When ID tag missing
content := `{
"type": "api",
"version": "v4.3.0"
"version": "v4.4.0"
}`

api, err := extractAPIDefinition([]byte(content))
Expand Down
10 changes: 5 additions & 5 deletions import-export-cli/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ devops-rest-api-version: v0
The version of the apictl that is being integration tested.

```
apictl-version: 4.3.0
apictl-version: 4.4.0
```


Expand Down Expand Up @@ -95,7 +95,7 @@ apictl-version: 4.3.0
```
go test -p 1 -timeout 0 -archive <apictl archive name>
example: go test -p 1 -timeout 0 -archive apictl-4.3.0-linux-x64.tar.gz
example: go test -p 1 -timeout 0 -archive apictl-4.4.0-linux-x64.tar.gz
```
Expand All @@ -104,23 +104,23 @@ example: go test -p 1 -timeout 0 -archive apictl-4.3.0-linux-x64.tar.gz
```
go test -p 1 -timeout 0 -archive <apictl archive name> -run <Test function name or partial name regex>
example: go test -p 1 -timeout 0 -archive apictl-4.3.0-linux-x64.tar.gz -run TestVersion
example: go test -p 1 -timeout 0 -archive apictl-4.4.0-linux-x64.tar.gz -run TestVersion
```

- Print verbose output

```
go test -p 1 -timeout 0 -archive <apictl archive name> -v
example: go test -p 1 -timeout 0 -archive apictl-4.3.0-linux-x64.tar.gz -v
example: go test -p 1 -timeout 0 -archive apictl-4.4.0-linux-x64.tar.gz -v
```

- Print http transport request/responses

```
go test -p 1 -timeout 0 -archive <apictl archive name> -logtransport
example: go test -p 1 -timeout 0 -archive apictl-4.3.0-linux-x64.tar.gz -logtransport
example: go test -p 1 -timeout 0 -archive apictl-4.4.0-linux-x64.tar.gz -logtransport
```

---
Expand Down
4 changes: 2 additions & 2 deletions import-export-cli/integration/ci-resources/start-apim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ done

if [ -z "$DOWNLOAD_LINK" ]
then
APIM_DOWNLOAD='https://wso2.org/jenkins/job/products/job/product-apim/lastStableBuild/org.wso2.am$wso2am/artifact/org.wso2.am/wso2am/4.3.0-SNAPSHOT/wso2am-4.3.0-SNAPSHOT.zip'
APIM_DOWNLOAD='https://wso2.org/jenkins/job/products/job/product-apim/lastStableBuild/org.wso2.am$wso2am/artifact/org.wso2.am/wso2am/4.4.0-SNAPSHOT/wso2am-4.4.0-SNAPSHOT.zip'
else
APIM_DOWNLOAD=$DOWNLOAD_LINK
fi

if [ -z "$NAME" ]
then
APIM_PACK=wso2am-4.3.0-SNAPSHOT
APIM_PACK=wso2am-4.4.0-SNAPSHOT
else
APIM_PACK=$NAME
fi
Expand Down
2 changes: 1 addition & 1 deletion import-export-cli/integration/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ admin-rest-api-version: v4
devportal-rest-api-version: v3
publisher-rest-api-version: v4
devops-rest-api-version: v0
apictl-version: 4.3.0
apictl-version: 4.4.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: document
version: v4.3.0
version: v4.4.0
data:
documentId: 99343207-6374-4518-9ee2-91305feb2b69
name: Doc2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: document
version: v4.3.0
version: v4.4.0
data:
documentId: 5d79aead-eeb3-43b9-84eb-51a965e383ed
name: Doc1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
name: customAddLogMessageTestOperationPolicy
version: v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessageTestOperationPolicy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessageTestOperationPolicy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessageTestOperationPolicy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: dynamicAddLogMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: testSynapseChoreoConnectPolicy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: operation_policy_specification
version: v4.3.0
version: v4.4.0
data:
category: Mediation
name: customAddLogMessageTestOperationPolicy
Expand Down
2 changes: 1 addition & 1 deletion import-export-cli/integration/testdata/sample-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

type: api # Type of the exported artifact using APICTL
version: v4.3.0 # API Manager version
version: v4.4.0 # API Manager version
data: # Contains the meta data of the API
id: 28114236-515c-4f40-82e4-6a016e632008 ## API UUID
name: PizzaShackAPI # Name of the API without Spaces [required]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

type: api # Type of the exported artifact using APICTL
version: v4.3.0 # API Manager version
version: v4.4.0 # API Manager version
data: # Contains the meta data of the API
id: 28114236-515c-4f40-82e4-6a016e632008 ## API UUID
name: PizzaShackAPI # Name of the API without Spaces [required]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func createExportedThrottlePolicyFile(t *testing.T, client *apim.Client, policyT
}
}

exportedPolicy.Version = "v4.3.0"
exportedPolicy.Version = "v4.4.0"
policyData := client.GenerateSampleThrottlePolicyData(policyType)
policyMap, _ := PolicyStructToMap(policyData)
var yamlMap yaml.MapSlice
Expand Down
2 changes: 1 addition & 1 deletion import-export-cli/resources/README.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 id="cli-for-importing-and-exporting-apis-and-applications">CLI for Importing and Exporting APIs and Applications and Managing WSO2 Micro Integrator</h1>
<h2 id="for-wso2-api-manager-4-3-0">For WSO2 API Manager 4.3.0</h2>
<h2 id="for-wso2-api-manager-4-3-0">For WSO2 API Manager 4.4.0</h2>
<p>Command Line tool for importing and exporting APIs/Applications/API Products in between different API environments of WSO2 API Manager and managing WSO2 Micro Integrator</p>
<h2 id="getting-started">Getting Started</h2>
<ul>
Expand Down

0 comments on commit f4a0361

Please sign in to comment.