Skip to content

Commit

Permalink
PMM-12913 move dump and role API to v1beta1 folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Apr 9, 2024
1 parent c375f29 commit a039868
Show file tree
Hide file tree
Showing 50 changed files with 526 additions and 528 deletions.
46 changes: 21 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,24 @@ jobs:
run: bin/go-sumtype ./...

- name: Run API linter
# TODO: re-enable before merging!
if: false
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.ROBOT_TOKEN || secrets.GITHUB_TOKEN }}
run: |
if out=$(bin/buf lint -v api); code="$?"; test "$code" -ne 0; then
echo "API linter exited with code: $code"
echo "$out"
## buf uses exit code 100 for linter warnings
if [ "$code" -ne 100 ] || ${{ github.event.pull_request == null }}; then
exit $code
else
echo
# Suppress passing to reviewdog because of https://github.com/reviewdog/reviewdog/issues/1696
# TODO: re-enable before merging to v3
# echo "$out" | bin/reviewdog -f=buf -reporter=github-pr-review -fail-on-error=true
fi
else
if out=$(bin/buf lint -v api); code="$?"; test "$code" -eq 0; then
echo "$out"
exit 0
fi
echo "API linter exited with code: $code"
echo "$out"
## buf uses exit code 100 for linter warnings
if [ "$code" -ne 100 ] || ${{ github.event.pull_request == null }}; then
exit $code
fi
# One may need to suppress passing to reviewdog because of https://github.com/reviewdog/reviewdog/issues/1696
echo "$out" | bin/reviewdog -f=buf -reporter=github-pr-review -fail-on-error=true
- name: Run code linters
uses: reviewdog/action-golangci-lint@v2
with:
Expand All @@ -114,21 +111,20 @@ jobs:

- name: Run go-consistent
env:
COMMAND: 'bin/go-consistent -pedantic -exclude "tests" ./...'
REDIRECT: "| bin/reviewdog -f=go-consistent -reporter=github-pr-review -fail-on-error=true"
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.ROBOT_TOKEN || secrets.GITHUB_TOKEN }}
run: |
if out=$( ${{ env.COMMAND }} ); exit_code=$?; [ $exit_code -ne 0 ]; then
if [ $exit_code -gt 1 ] || ${{ github.event.pull_request == null }}; then
echo "$out"
exit $exit_code
else
echo "$out" ${{ env.REDIRECT }}
fi
else
if out=$(bin/go-consistent -pedantic -exclude "tests" ./...); exit_code=$?; [ $exit_code -eq 0 ]; then
echo "$out"
exit 0
fi
if [ $exit_code -gt 1 ] || ${{ github.event.pull_request == null }}; then
echo "$out"
exit $exit_code
fi
echo "$out" | bin/reviewdog -f=go-consistent -reporter=github-pr-review -fail-on-error=true
- name: Test common API
run: make test-common

Expand Down
14 changes: 7 additions & 7 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ gen-api: ## Generate PMM API
api/advisors/v1 \
api/alerting/v1 \
api/backup/v1 \
api/dump/v1 \
api/role/v1 \
api/dump/v1beta1 \
api/role/v1beta1 \
api/qan/v1 \
api/platform/v1"; \
for API in $$SPECS; do \
Expand Down Expand Up @@ -96,7 +96,7 @@ gen-api: ## Generate PMM API
api/backup/v1/json/v1.json \
api/advisors/v1/json/v1.json \
api/alerting/v1/json/v1.json \
api/dump/v1/json/v1.json \
api/dump/v1beta1/json/v1beta1.json \
api/qan/v1/json/v1.json
bin/swagger validate api/swagger/swagger.json

Expand All @@ -117,8 +117,8 @@ gen-api: ## Generate PMM API
api/alerting/v1/json/v1.json \
api/advisors/v1/json/v1.json \
api/backup/v1/json/v1.json \
api/dump/v1/json/v1.json \
api/role/v1/json/v1.json \
api/dump/v1beta1/json/v1beta1.json \
api/role/v1beta1/json/v1beta1.json \
api/qan/v1/json/v1.json \
api/platform/v1/json/v1.json

Expand Down Expand Up @@ -161,8 +161,8 @@ clean: clean_swagger ## Remove generated files
api/alerting/v1 \
api/advisors/v1 \
api/backup/v1 \
api/dump/v1 \
api/role/v1 \
api/dump/v1beta1 \
api/role/v1beta1 \
api/qan/v1 \
api/platform/v1"; \
for API in $$SPECS; do \
Expand Down
2 changes: 1 addition & 1 deletion api/MIGRATION_TO_V3.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ POST /v1/role/List GET /v1/accesscontrol/roles
POST /v1/role/SetDefault POST /v1/accesscontrol/roles:setDefault
POST /v1/role/Update PUT /v1/accesscontrol/roles/{id} Extract the role_id from the body to {id}

**MgmtService** **ManagementV1Beta1Service** NOTE: promoted to v1 from v1beta1
**MgmtService** **ManagementV1Beta1Service** NOTE: promote to v1 from v1beta1
POST /v1/management/Agent/List GET /v1/management/agents
POST /v1/management/Node/Get GET /v1/management/nodes/{id}
POST /v1/management/Node/List GET /v1/management/nodes
Expand Down
Loading

0 comments on commit a039868

Please sign in to comment.